Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.freshollie.monkeyboard.keystoneradio.playback;
- import android.app.Service;
- import android.content.ContentResolver;
- import android.content.Context;
- import android.content.Intent;
- import android.content.SharedPreferences;
- import android.content.SharedPreferences.Editor;
- import android.graphics.Bitmap;
- import android.media.AudioManager;
- import android.media.AudioManager.OnAudioFocusChangeListener;
- import android.os.Binder;
- import android.os.Build.VERSION;
- import android.os.Handler;
- import android.os.IBinder;
- import android.preference.PreferenceManager;
- import android.provider.Settings.System;
- import android.support.v4.media.MediaMetadataCompat;
- import android.support.v4.media.MediaMetadataCompat.a;
- import android.support.v4.media.g;
- import android.support.v4.media.session.MediaButtonReceiver;
- import android.support.v4.media.session.MediaControllerCompat;
- import android.support.v4.media.session.MediaSessionCompat;
- import android.support.v4.media.session.MediaSessionCompat.a;
- import android.support.v4.media.session.PlaybackStateCompat;
- import android.support.v4.media.session.PlaybackStateCompat.a;
- import android.util.Log;
- import android.view.KeyEvent;
- import com.freshollie.monkeyboard.keystoneradio.a.b.b;
- import com.freshollie.monkeyboard.keystoneradio.a.b.d;
- import com.freshollie.monkeyboard.keystoneradio.a.b.f;
- import com.freshollie.monkeyboard.keystoneradio.a.c;
- import com.freshollie.monkeyboard.keystoneradio.a.c.a;
- import com.freshollie.monkeyboard.keystoneradio.a.c.b;
- import com.freshollie.monkeyboard.keystoneradio.a.d;
- import java.util.ArrayList;
- import java.util.Arrays;
- import java.util.Comparator;
- import java.util.HashSet;
- import java.util.Iterator;
- import java.util.Set;
- import java.util.concurrent.ExecutorService;
- import java.util.concurrent.Executors;
- import org.json.JSONException;
- import org.json.JSONObject;
- public class RadioPlayerService
- extends Service
- implements AudioManager.OnAudioFocusChangeListener
- {
- static int AbbayedeBelloc = 10000;
- public static int Abondance = 15;
- private static String Alverca = RadioPlayerService.class.getSimpleName();
- HashSet<c> Airedale = new HashSet();
- private ExecutorService Appenzell = Executors.newSingleThreadExecutor();
- private IBinder Aragon = new d();
- private a Ardrahan;
- private com.freshollie.monkeyboard.keystoneradio.a.b AubisquePyrenees;
- private d[] Beaufort = new d[0];
- private int Bierkase = 0;
- private int Blarney;
- private ArrayList<d> BleudeSeptmoncel = new ArrayList();
- private d Braudostur;
- private AudioManager Brick;
- private MediaSessionCompat CanadianCheddar;
- private g Cantal;
- private PlaybackStateCompat.a Chaumes;
- private Runnable Cheddar;
- private int Cheshire;
- private int Chevres = -1;
- private b Chontaleno;
- private int Cojack = 13;
- private boolean ColbyJack = false;
- private boolean Crowley = false;
- private boolean DevonBlue = false;
- private a DevonGarland = a.AbbayedeBelloc;
- private int DoubleGloucester = -1;
- private int Edam = 88000;
- private SharedPreferences Edelpilz;
- private b.b Esbareich = new b.b()
- {
- public void AbbayedeBelloc(int paramAnonymousInt1, int paramAnonymousInt2)
- {
- Log.v(RadioPlayerService.Friesla(), String.format("Collected %s/%s", new Object[] { Integer.valueOf(paramAnonymousInt1), Integer.valueOf(paramAnonymousInt2) }));
- RadioPlayerService.AbbayedeBelloc(RadioPlayerService.this, paramAnonymousInt1, paramAnonymousInt2);
- }
- public void AbbayedeBelloc(d[] paramAnonymousArrayOfd)
- {
- Log.v(RadioPlayerService.Friesla(), "Collected all stations");
- ArrayList localArrayList = new ArrayList();
- int j = paramAnonymousArrayOfd.length;
- int i = 0;
- while (i < j)
- {
- d locald = paramAnonymousArrayOfd[i];
- if (locald.Airedale() != -1) {
- localArrayList.add(locald);
- }
- i += 1;
- }
- RadioPlayerService.AbbayedeBelloc(RadioPlayerService.this, (d[])localArrayList.toArray(new d[localArrayList.size()]), paramAnonymousArrayOfd.length);
- RadioPlayerService.AbbayedeBelloc(RadioPlayerService.this, false);
- if (RadioPlayerService.AbbayedeBelloc(RadioPlayerService.this).length > 0)
- {
- RadioPlayerService.this.Fontal();
- return;
- }
- RadioPlayerService.Abondance(RadioPlayerService.this);
- }
- };
- private b.d Esrom = new b.d()
- {
- public void AbbayedeBelloc()
- {
- RadioPlayerService.Airedale(RadioPlayerService.this);
- }
- public void AbbayedeBelloc(int paramAnonymousInt)
- {
- RadioPlayerService.this.Airedale();
- RadioPlayerService.AbbayedeBelloc(RadioPlayerService.this, paramAnonymousInt);
- }
- public void AbbayedeBelloc(int paramAnonymousInt1, int paramAnonymousInt2)
- {
- RadioPlayerService.Abondance(RadioPlayerService.this, paramAnonymousInt1, paramAnonymousInt2);
- }
- };
- private c.a Filetta = new c.a()
- {
- public void AbbayedeBelloc()
- {
- RadioPlayerService.Abondance(RadioPlayerService.this, false);
- RadioPlayerService.Alverca(RadioPlayerService.this);
- }
- public void Abondance()
- {
- RadioPlayerService.Abondance(RadioPlayerService.this, false);
- }
- public void Airedale()
- {
- RadioPlayerService.Abondance(RadioPlayerService.this, false);
- if (RadioPlayerService.Appenzell(RadioPlayerService.this).isAlive()) {
- RadioPlayerService.Appenzell(RadioPlayerService.this).interrupt();
- }
- RadioPlayerService.Abondance(RadioPlayerService.this, 1);
- }
- };
- private boolean Fontal = false;
- private Thread FourmedAmbert = new Thread();
- private Runnable Friesla = new Runnable()
- {
- public void run()
- {
- Log.v(RadioPlayerService.Friesla(), "Starting a wait for attachment thread");
- long l = System.currentTimeMillis();
- while ((!RadioPlayerService.Aragon(RadioPlayerService.this).Chontaleno()) && (System.currentTimeMillis() - l < RadioPlayerService.AbbayedeBelloc)) {
- if (Thread.interrupted()) {
- return;
- }
- }
- if (RadioPlayerService.Aragon(RadioPlayerService.this).Chontaleno())
- {
- Log.v(RadioPlayerService.Friesla(), "Keystone radio connected");
- RadioPlayerService.Aragon(RadioPlayerService.this).Abondance();
- return;
- }
- RadioPlayerService.Abondance(RadioPlayerService.this, false);
- new Handler(RadioPlayerService.this.getMainLooper()).post(new Runnable()
- {
- public void run()
- {
- RadioPlayerService.Ardrahan(RadioPlayerService.this);
- }
- });
- }
- };
- private boolean Fynbo = false;
- private c.b Geitost = new c.b()
- {
- public void AbbayedeBelloc(Bitmap paramAnonymousBitmap)
- {
- RadioPlayerService.AbbayedeBelloc(RadioPlayerService.this, paramAnonymousBitmap);
- }
- public void AbbayedeBelloc(String paramAnonymousString)
- {
- RadioPlayerService.AbbayedeBelloc(RadioPlayerService.this, paramAnonymousString);
- }
- public void Abondance(int paramAnonymousInt) {}
- public void Abondance(String paramAnonymousString)
- {
- RadioPlayerService.Abondance(RadioPlayerService.this, paramAnonymousString);
- }
- public void Airedale(int paramAnonymousInt) {}
- public void Alverca(int paramAnonymousInt) {}
- public void Appenzell(int paramAnonymousInt) {}
- public void Aragon(int paramAnonymousInt) {}
- public void Ardrahan(int paramAnonymousInt)
- {
- if (RadioPlayerService.Cantal(RadioPlayerService.this) == 1)
- {
- Log.v(RadioPlayerService.Friesla(), "Search frequency changed");
- RadioPlayerService.Appenzell(RadioPlayerService.this, paramAnonymousInt);
- RadioPlayerService.Aragon(RadioPlayerService.this, paramAnonymousInt);
- }
- }
- public void AubisquePyrenees(int paramAnonymousInt)
- {
- RadioPlayerService.Ardrahan(RadioPlayerService.this, paramAnonymousInt);
- }
- public void a_(int paramAnonymousInt)
- {
- if (RadioPlayerService.Cantal(RadioPlayerService.this) == 1) {
- if ((paramAnonymousInt == 1) && (RadioPlayerService.this.Cheshire()))
- {
- RadioPlayerService.Alverca(RadioPlayerService.this, true);
- RadioPlayerService.Abondance(RadioPlayerService.this, 1);
- }
- }
- while (!RadioPlayerService.Chaumes(RadioPlayerService.this))
- {
- do
- {
- return;
- } while ((RadioPlayerService.this.Cheshire()) || (paramAnonymousInt == 3) || (paramAnonymousInt == 1) || (!RadioPlayerService.Chaumes(RadioPlayerService.this)));
- RadioPlayerService.Alverca(RadioPlayerService.this, false);
- RadioPlayerService.Abondance(RadioPlayerService.this, 3);
- return;
- }
- RadioPlayerService.Alverca(RadioPlayerService.this, false);
- RadioPlayerService.Abondance(RadioPlayerService.this, 3);
- }
- };
- public static int AbbayedeBelloc(int paramInt1, int paramInt2)
- {
- return (paramInt1 % paramInt2 + paramInt2) % paramInt2;
- }
- private void AbbayedeBelloc(Bitmap paramBitmap)
- {
- if (this.CanadianCheddar != null) {
- this.CanadianCheddar.AbbayedeBelloc(new MediaMetadataCompat.a(Beaufort()).AbbayedeBelloc("android.media.metadata.ART", paramBitmap).AbbayedeBelloc());
- }
- }
- private void AbbayedeBelloc(Runnable paramRunnable)
- {
- if (this.AubisquePyrenees.Cojack())
- {
- this.Appenzell.submit(paramRunnable);
- return;
- }
- this.Cheddar = paramRunnable;
- Alverca();
- }
- private void AbbayedeBelloc(String paramString)
- {
- if (this.Braudostur == null) {
- Braudostur(this.Edam);
- }
- this.Braudostur.AbbayedeBelloc(paramString);
- if ((Chaumes() > -1) && (!((d)this.BleudeSeptmoncel.get(Chaumes())).AbbayedeBelloc().equals(paramString)))
- {
- ((d)this.BleudeSeptmoncel.get(Chaumes())).AbbayedeBelloc(paramString);
- Gloucester();
- }
- Abondance(this.Braudostur);
- }
- private void AbbayedeBelloc(d[] paramArrayOfd, int paramInt)
- {
- this.Beaufort = paramArrayOfd;
- this.Bierkase = paramInt;
- Gjetost();
- }
- private void Abondance(int paramInt1, int paramInt2)
- {
- Iterator localIterator = this.Airedale.iterator();
- while (localIterator.hasNext()) {
- ((c)localIterator.next()).AbbayedeBelloc(paramInt1, paramInt2);
- }
- }
- private void Abondance(d paramd)
- {
- if ((this.CanadianCheddar == null) || ((Ardrahan().Abondance() != null) && (Ardrahan().Abondance().Airedale("android.media.metadata.TRACK_NUMBER") == paramd.Abondance()))) {
- return;
- }
- this.CanadianCheddar.AbbayedeBelloc(new MediaMetadataCompat.a().AbbayedeBelloc("android.media.metadata.TITLE", paramd.AbbayedeBelloc()).AbbayedeBelloc("android.media.metadata.ARTIST", paramd.Alverca()).AbbayedeBelloc("android.media.metadata.GENRE", b.f.AbbayedeBelloc(paramd.Airedale())).AbbayedeBelloc("android.media.metadata.TRACK_NUMBER", paramd.Abondance()).AbbayedeBelloc());
- }
- private void Abondance(String paramString)
- {
- if (this.CanadianCheddar != null) {
- this.CanadianCheddar.AbbayedeBelloc(new MediaMetadataCompat.a(Beaufort()).AbbayedeBelloc("android.media.metadata.DISPLAY_DESCRIPTION", paramString).AbbayedeBelloc());
- }
- }
- private void Airedale(int paramInt1, int paramInt2)
- {
- Iterator localIterator = this.Airedale.iterator();
- while (localIterator.hasNext()) {
- ((c)localIterator.next()).Abondance(paramInt1, paramInt2);
- }
- }
- private void Ardrahan(int paramInt)
- {
- this.Cheshire = paramInt;
- this.Chevres = -1;
- Braudostur(this.Edam);
- Goutu();
- }
- private void AubisquePyrenees(int paramInt)
- {
- this.DoubleGloucester = paramInt;
- Grabetto();
- }
- private void Beaufort(int paramInt)
- {
- this.Edam = paramInt;
- Graddost();
- }
- private void Bierkase(int paramInt)
- {
- this.Cojack = paramInt;
- if (Cheshire()) {
- AbbayedeBelloc(new Runnable()
- {
- public void run()
- {
- RadioPlayerService.Aragon(RadioPlayerService.this).AbbayedeBelloc(RadioPlayerService.Brick(RadioPlayerService.this));
- }
- });
- }
- }
- private void Blarney(int paramInt)
- {
- if (paramInt == 0) {}
- d[] arrayOfd;
- do
- {
- do
- {
- return;
- if (Bierkase() != 0) {
- break;
- }
- } while (Braudostur().length <= 0);
- Airedale(AbbayedeBelloc(this.DoubleGloucester + paramInt, Braudostur().length));
- return;
- arrayOfd = Brick();
- } while (arrayOfd.length <= 0);
- int i = Chaumes();
- int j = arrayOfd.length;
- if (i < 0)
- {
- i = 0;
- k = j;
- if (i < arrayOfd.length)
- {
- if (arrayOfd[i].Abondance() <= BleudeSeptmoncel().Abondance()) {
- break label122;
- }
- k = j;
- if (paramInt <= 0) {}
- }
- }
- for (int k = i;; k = i + paramInt)
- {
- Alverca(arrayOfd[AbbayedeBelloc(k, arrayOfd.length)].Abondance());
- return;
- label122:
- if (paramInt < 0) {
- j = i;
- }
- i += 1;
- break;
- }
- }
- private void BleudeSeptmoncel(int paramInt)
- {
- if (this.CanadianCheddar != null) {
- this.CanadianCheddar.AbbayedeBelloc(this.Chaumes.AbbayedeBelloc(paramInt, 0L, 1.0F).AbbayedeBelloc(127L).AbbayedeBelloc());
- }
- }
- private void Braudostur(int paramInt)
- {
- paramInt = paramInt / 100 * 100;
- if ((this.Braudostur != null) && (paramInt == this.Braudostur.Abondance())) {
- return;
- }
- this.Braudostur = new d();
- this.Braudostur.AbbayedeBelloc(paramInt);
- if (Chaumes() > -1) {
- this.Braudostur.AbbayedeBelloc(((d)this.BleudeSeptmoncel.get(Chaumes())).AbbayedeBelloc());
- }
- Abondance(this.Braudostur);
- }
- private void Brick(int paramInt)
- {
- if (this.Braudostur == null) {
- Braudostur(this.Edam);
- }
- this.Braudostur.Abondance(paramInt);
- Abondance(this.Braudostur);
- }
- private void CanadianCheddar(int paramInt)
- {
- Iterator localIterator = this.Airedale.iterator();
- while (localIterator.hasNext()) {
- ((c)localIterator.next()).Bierkase(paramInt);
- }
- }
- private void Cantal(int paramInt)
- {
- Iterator localIterator = this.Airedale.iterator();
- while (localIterator.hasNext()) {
- ((c)localIterator.next()).Beaufort(paramInt);
- }
- }
- private void Chaumes(int paramInt)
- {
- Iterator localIterator = this.Airedale.iterator();
- while (localIterator.hasNext()) {
- ((c)localIterator.next()).Blarney(paramInt);
- }
- }
- private void Fynbo()
- {
- if (Build.VERSION.SDK_INT < 21)
- {
- this.Chontaleno = new b(this, new Handler(getMainLooper()), new b.a()
- {
- public void AbbayedeBelloc(int paramAnonymousInt)
- {
- RadioPlayerService.this.AbbayedeBelloc(paramAnonymousInt);
- Log.v(RadioPlayerService.Friesla(), "Volume set: " + RadioPlayerService.this.Blarney());
- RadioPlayerService.Airedale(RadioPlayerService.this, RadioPlayerService.this.Blarney());
- }
- });
- getApplicationContext().getContentResolver().registerContentObserver(Settings.System.CONTENT_URI, true, this.Chontaleno);
- this.CanadianCheddar.Abondance(3);
- Log.v(Alverca, "Registering settings content observer");
- return;
- }
- this.Cantal = new g(2, Abondance, this.Cojack)
- {
- public void Abondance(int paramAnonymousInt)
- {
- super.Abondance(paramAnonymousInt);
- RadioPlayerService.this.AbbayedeBelloc(paramAnonymousInt);
- Log.v(RadioPlayerService.Friesla(), "Volume set: " + RadioPlayerService.this.Blarney());
- RadioPlayerService.Airedale(RadioPlayerService.this, RadioPlayerService.this.Blarney());
- }
- public void Airedale(int paramAnonymousInt)
- {
- super.Airedale(paramAnonymousInt);
- if (paramAnonymousInt != 0)
- {
- RadioPlayerService.this.AbbayedeBelloc(RadioPlayerService.this.Blarney() + paramAnonymousInt);
- Log.v(RadioPlayerService.Friesla(), "Volume adjusted: " + RadioPlayerService.this.Blarney());
- RadioPlayerService.Airedale(RadioPlayerService.this, RadioPlayerService.this.Blarney());
- }
- }
- };
- this.CanadianCheddar.AbbayedeBelloc(this.Cantal);
- }
- private void Geitost()
- {
- Object localObject2 = this.Edelpilz.getStringSet(getString(2131558401), null);
- Object localObject1 = this.Edelpilz.getStringSet(getString(2131558404), null);
- if (localObject2 != null)
- {
- this.Beaufort = new d[((Set)localObject2).size()];
- this.Bierkase = this.Edelpilz.getInt(getString(2131558410), 0);
- try
- {
- localObject2 = ((Set)localObject2).iterator();
- i = 0;
- while (((Iterator)localObject2).hasNext())
- {
- JSONObject localJSONObject = new JSONObject((String)((Iterator)localObject2).next());
- this.Beaufort[i] = new d(localJSONObject);
- i += 1;
- }
- Arrays.sort(this.Beaufort, new Comparator()
- {
- public int AbbayedeBelloc(d paramAnonymousd1, d paramAnonymousd2)
- {
- return Integer.valueOf(paramAnonymousd1.Abondance()).compareTo(Integer.valueOf(paramAnonymousd2.Abondance()));
- }
- });
- }
- catch (JSONException localJSONException2)
- {
- for (;;)
- {
- label225:
- localJSONException2.printStackTrace();
- Log.e(Alverca, "Could not load dab station list");
- }
- }
- if (localObject1 != null)
- {
- this.BleudeSeptmoncel.clear();
- try
- {
- localObject1 = ((Set)localObject1).iterator();
- while (((Iterator)localObject1).hasNext())
- {
- localObject2 = new JSONObject((String)((Iterator)localObject1).next());
- this.BleudeSeptmoncel.add(new d((JSONObject)localObject2));
- }
- this.DoubleGloucester = this.Edelpilz.getInt(getString(2131558400), 0);
- }
- catch (JSONException localJSONException1)
- {
- localJSONException1.printStackTrace();
- Log.e(Alverca, "Could not load dab station list");
- }
- }
- this.Edam = this.Edelpilz.getInt(getString(2131558403), 87500);
- if (!this.Edelpilz.getBoolean(getString(2131558408), false)) {
- break label375;
- }
- }
- label375:
- for (int i = 0;; i = 1)
- {
- this.Cheshire = i;
- if (!this.Edelpilz.getBoolean(getString(2131558409), true)) {
- this.Cojack = this.Edelpilz.getInt(getString(2131558411), 13);
- }
- return;
- this.Beaufort = new d[0];
- break;
- Gouda();
- break label225;
- }
- }
- private void Gjetost()
- {
- SharedPreferences.Editor localEditor = this.Edelpilz.edit();
- HashSet localHashSet = new HashSet();
- d[] arrayOfd = this.Beaufort;
- int j = arrayOfd.length;
- int i = 0;
- while (i < j)
- {
- localHashSet.add(arrayOfd[i].Appenzell());
- i += 1;
- }
- localEditor.putStringSet(getString(2131558401), localHashSet);
- localEditor.putInt(getString(2131558410), this.Bierkase);
- localEditor.apply();
- }
- private void Gloucester()
- {
- SharedPreferences.Editor localEditor = this.Edelpilz.edit();
- HashSet localHashSet = new HashSet();
- Iterator localIterator = this.BleudeSeptmoncel.iterator();
- while (localIterator.hasNext()) {
- localHashSet.add(((d)localIterator.next()).Appenzell());
- }
- localEditor.putStringSet(getString(2131558404), localHashSet);
- localEditor.apply();
- }
- private void Gouda()
- {
- d[] arrayOfd = (d[])this.BleudeSeptmoncel.toArray(new d[this.BleudeSeptmoncel.size()]);
- Arrays.sort(arrayOfd, new Comparator()
- {
- public int AbbayedeBelloc(d paramAnonymousd1, d paramAnonymousd2)
- {
- return Integer.valueOf(paramAnonymousd1.Abondance()).compareTo(Integer.valueOf(paramAnonymousd2.Abondance()));
- }
- });
- this.BleudeSeptmoncel = new ArrayList(Arrays.asList(arrayOfd));
- }
- private void Goutu()
- {
- SharedPreferences.Editor localEditor = this.Edelpilz.edit();
- String str = getString(2131558408);
- if (this.Cheshire == 0) {}
- for (boolean bool = true;; bool = false)
- {
- localEditor.putBoolean(str, bool).apply();
- return;
- }
- }
- private void Grabetto()
- {
- Log.v(Alverca, "Saving DAB index " + this.DoubleGloucester);
- this.Edelpilz.edit().putInt(getString(2131558400), this.DoubleGloucester).apply();
- }
- private void Graddost()
- {
- this.Edelpilz.edit().putInt(getString(2131558403), this.Edam).apply();
- }
- private void Greve()
- {
- AbbayedeBelloc(new Runnable()
- {
- public void run()
- {
- RadioPlayerService.Aragon(RadioPlayerService.this).Cheshire();
- RadioPlayerService.Alverca(RadioPlayerService.this, RadioPlayerService.Aragon(RadioPlayerService.this).Chaumes());
- RadioPlayerService.AubisquePyrenees(RadioPlayerService.this);
- }
- });
- if (this.Ardrahan != null) {
- this.Ardrahan.Airedale();
- }
- this.Ardrahan = new a(this);
- if (this.Cheddar != null)
- {
- AbbayedeBelloc(this.Cheddar);
- this.Cheddar = null;
- }
- if (Bierkase() == 0) {
- Airedale(CanadianCheddar());
- }
- for (;;)
- {
- if (AubisquePyrenees() == 3) {
- Chontaleno();
- }
- return;
- Alverca(Cantal());
- }
- }
- private void Herrgardsost()
- {
- int i = 0;
- if ((this.Edelpilz.getBoolean(getString(2131558482), false)) || (Bierkase() == 0)) {
- i = 1;
- }
- if ((this.Chevres != i) && (this.AubisquePyrenees.Airedale(i))) {
- this.Chevres = i;
- }
- }
- private boolean Herve()
- {
- Log.v(Alverca, "Requesting board to set channel to: " + this.Edam);
- if (this.AubisquePyrenees.Beaufort() == 1) {
- this.AubisquePyrenees.AubisquePyrenees();
- }
- if (this.AubisquePyrenees.Abondance(Bierkase(), this.Edam))
- {
- Log.v(Alverca, "Approved, updating meta");
- Braudostur(this.Edam);
- return true;
- }
- return false;
- }
- private boolean Juustoleipa()
- {
- if (this.Bierkase != this.Blarney)
- {
- this.AubisquePyrenees.Cheshire();
- this.Blarney = this.AubisquePyrenees.Chaumes();
- }
- if ((Braudostur().length < 1) || (this.Bierkase != this.Blarney)) {
- if (this.Blarney > 0) {
- if (Braudostur().length < 1)
- {
- Log.v(Alverca, "No stations stored on device");
- Airedale();
- }
- }
- }
- do
- {
- do
- {
- for (;;)
- {
- return false;
- Log.v(Alverca, "" + this.Bierkase);
- Log.v(Alverca, "" + this.Blarney);
- break;
- Log.v(Alverca, "No stations stored, need to perform channel search");
- MeyerVintageGouda();
- }
- } while (Braudostur().length <= 0);
- Log.v(Alverca, "Requesting board to set channel to: " + BleudeSeptmoncel().AbbayedeBelloc());
- } while (!this.AubisquePyrenees.Abondance(Bierkase(), this.Beaufort[this.DoubleGloucester].Abondance()));
- Log.v(Alverca, "Approved, updating meta");
- Abondance(BleudeSeptmoncel());
- return true;
- }
- private void Kikorangi()
- {
- this.Crowley = true;
- this.AubisquePyrenees.AbbayedeBelloc(this.Edelpilz.getInt(getString(2131558402), 3));
- }
- private void Leerdammer()
- {
- this.Crowley = false;
- this.AubisquePyrenees.AbbayedeBelloc(Blarney());
- }
- private void Maasdam()
- {
- DevonBlue();
- Maribo();
- }
- private void Mamirolle()
- {
- Log.v(Alverca, "Requesting Audio Focus");
- if (this.Brick.requestAudioFocus(this, 3, 1) == 1)
- {
- Log.v(Alverca, "Request granted");
- this.DevonGarland = a.Airedale;
- return;
- }
- Log.v(Alverca, "Could not gain full focus");
- this.DevonGarland = a.Abondance;
- }
- private void Maribo()
- {
- Log.v(Alverca, "Abandoning audio focus");
- if (Cheddar()) {
- this.Brick.abandonAudioFocus(this);
- }
- this.DevonGarland = a.AbbayedeBelloc;
- }
- private void Matocq()
- {
- Log.v(Alverca, "Timed out waiting for device to attach");
- Iterator localIterator = this.Airedale.iterator();
- while (localIterator.hasNext()) {
- ((c)localIterator.next()).Abondance();
- }
- }
- private void Meira()
- {
- Iterator localIterator = this.Airedale.iterator();
- while (localIterator.hasNext()) {
- ((c)localIterator.next()).Alverca();
- }
- }
- private void Menonita()
- {
- Iterator localIterator = this.Airedale.iterator();
- while (localIterator.hasNext())
- {
- final c localc = (c)localIterator.next();
- new Handler(getMainLooper()).post(new Runnable()
- {
- public void run()
- {
- localc.c_();
- }
- });
- }
- }
- private void MeyerVintageGouda()
- {
- Iterator localIterator = this.Airedale.iterator();
- while (localIterator.hasNext()) {
- ((c)localIterator.next()).b_();
- }
- }
- public void AbbayedeBelloc(int paramInt)
- {
- if ((-1 < paramInt) && (paramInt < Abondance + 1) && (paramInt != Blarney()))
- {
- if (!this.AubisquePyrenees.Cojack()) {
- break label43;
- }
- Bierkase(paramInt);
- }
- for (;;)
- {
- Abondance(paramInt);
- return;
- label43:
- this.Cojack = paramInt;
- }
- }
- public void AbbayedeBelloc(d paramd)
- {
- this.BleudeSeptmoncel.remove(paramd);
- Gloucester();
- }
- public void AbbayedeBelloc(c paramc)
- {
- this.Airedale.add(paramc);
- }
- public boolean AbbayedeBelloc()
- {
- d locald = new d();
- locald.AbbayedeBelloc(this.Braudostur.AbbayedeBelloc());
- locald.Abondance(this.Braudostur.Airedale());
- locald.AbbayedeBelloc(this.Braudostur.Abondance());
- if (this.Braudostur != null)
- {
- Iterator localIterator = this.BleudeSeptmoncel.iterator();
- while (localIterator.hasNext()) {
- if (((d)localIterator.next()).Abondance() / 100 * 100 == locald.Abondance() / 100 * 100) {
- return false;
- }
- }
- this.BleudeSeptmoncel.add(locald);
- Gouda();
- Gloucester();
- return true;
- }
- return false;
- }
- public void Abondance()
- {
- this.BleudeSeptmoncel.clear();
- Gloucester();
- }
- public void Abondance(int paramInt)
- {
- SharedPreferences.Editor localEditor = this.Edelpilz.edit();
- localEditor.putInt(getString(2131558411), paramInt);
- localEditor.apply();
- if (this.Edelpilz.getBoolean(getString(2131558409), true)) {
- this.Brick.setStreamVolume(3, paramInt, 0);
- }
- if (this.Cantal != null) {
- this.Cantal.AbbayedeBelloc(paramInt);
- }
- }
- public void Abondance(c paramc)
- {
- this.Airedale.remove(paramc);
- }
- public void Airedale()
- {
- if (!this.DevonBlue)
- {
- this.DevonBlue = true;
- this.AubisquePyrenees.AbbayedeBelloc(this.Esbareich);
- AubisquePyrenees(0);
- Meira();
- }
- }
- public void Airedale(final int paramInt)
- {
- if ((paramInt < 0) || (paramInt >= this.Beaufort.length)) {
- return;
- }
- AubisquePyrenees(paramInt);
- if (this.AubisquePyrenees.Chontaleno())
- {
- AbbayedeBelloc(new Runnable()
- {
- public void run()
- {
- if (paramInt == RadioPlayerService.Beaufort(RadioPlayerService.this)) {
- RadioPlayerService.Bierkase(RadioPlayerService.this);
- }
- }
- });
- return;
- }
- Abondance(BleudeSeptmoncel());
- }
- public void Alverca()
- {
- if ((!this.FourmedAmbert.isAlive()) && (!this.Fontal))
- {
- Log.v(Alverca, "Starting device connection");
- if (this.Ardrahan != null) {
- this.Ardrahan.Airedale();
- }
- this.Ardrahan = new a(this);
- this.Fontal = true;
- this.FourmedAmbert = new Thread(this.Friesla);
- this.FourmedAmbert.start();
- }
- }
- public void Alverca(final int paramInt)
- {
- Beaufort(paramInt);
- if (this.AubisquePyrenees.Chontaleno())
- {
- AbbayedeBelloc(new Runnable()
- {
- public void run()
- {
- if (paramInt == RadioPlayerService.Blarney(RadioPlayerService.this)) {
- RadioPlayerService.BleudeSeptmoncel(RadioPlayerService.this);
- }
- }
- });
- return;
- }
- Braudostur(this.Edam);
- }
- public com.freshollie.monkeyboard.keystoneradio.a.b Appenzell()
- {
- return this.AubisquePyrenees;
- }
- public void Appenzell(int paramInt)
- {
- Ardrahan(paramInt);
- Cojack();
- CanadianCheddar(paramInt);
- if (paramInt == 0)
- {
- this.Braudostur = null;
- Airedale(this.DoubleGloucester);
- return;
- }
- Alverca(this.Edam);
- }
- public MediaSessionCompat Aragon()
- {
- return this.CanadianCheddar;
- }
- public void Aragon(final int paramInt)
- {
- AbbayedeBelloc(new Runnable()
- {
- public void run()
- {
- RadioPlayerService.Aragon(RadioPlayerService.this).AubisquePyrenees();
- RadioPlayerService.Aragon(RadioPlayerService.this).Abondance(paramInt);
- }
- });
- }
- public MediaControllerCompat Ardrahan()
- {
- return this.CanadianCheddar.Airedale();
- }
- public int AubisquePyrenees()
- {
- return Ardrahan().AbbayedeBelloc().AbbayedeBelloc();
- }
- public MediaMetadataCompat Beaufort()
- {
- return Ardrahan().Abondance();
- }
- public int Bierkase()
- {
- return this.Cheshire;
- }
- public int Blarney()
- {
- int i = this.Cojack;
- if (this.Edelpilz.getBoolean(getString(2131558409), true))
- {
- int j = this.Brick.getStreamVolume(3);
- i = j;
- if (this.Cantal != null)
- {
- i = j;
- if (j != this.Cantal.AbbayedeBelloc())
- {
- this.Cantal.AbbayedeBelloc(j);
- i = j;
- }
- }
- }
- return i;
- }
- public d BleudeSeptmoncel()
- {
- if (Bierkase() == 0)
- {
- if (this.Beaufort.length > 0) {
- return this.Beaufort[CanadianCheddar()];
- }
- return null;
- }
- return this.Braudostur;
- }
- public d[] Braudostur()
- {
- return this.Beaufort;
- }
- public d[] Brick()
- {
- return (d[])this.BleudeSeptmoncel.toArray(new d[this.BleudeSeptmoncel.size()]);
- }
- public int CanadianCheddar()
- {
- return this.DoubleGloucester;
- }
- public int Cantal()
- {
- return this.Edam;
- }
- public int Chaumes()
- {
- if (BleudeSeptmoncel() != null)
- {
- int i = 0;
- while (i < this.BleudeSeptmoncel.size())
- {
- if (((((d)this.BleudeSeptmoncel.get(i)).AbbayedeBelloc().equals(BleudeSeptmoncel().AbbayedeBelloc())) && (!BleudeSeptmoncel().AbbayedeBelloc().isEmpty())) || (this.Edam / 100 == ((d)this.BleudeSeptmoncel.get(i)).Abondance() / 100)) {
- return i;
- }
- i += 1;
- }
- }
- return -1;
- }
- public boolean Cheddar()
- {
- return this.DevonGarland == a.Airedale;
- }
- public boolean Cheshire()
- {
- return AubisquePyrenees() == 3;
- }
- public boolean Chevres()
- {
- return this.Crowley;
- }
- public void Chontaleno()
- {
- Log.v(Alverca, "Handling a play request");
- int i;
- if (Bierkase() == 0) {
- if ((this.DoubleGloucester == -1) || (Braudostur().length < 1))
- {
- Log.v(Alverca, "No station to play, ignoring request");
- AbbayedeBelloc(new Runnable()
- {
- public void run()
- {
- RadioPlayerService.Bierkase(RadioPlayerService.this);
- }
- });
- i = -1;
- }
- }
- for (;;)
- {
- if (i != -1) {
- AbbayedeBelloc(new Runnable()
- {
- public void run()
- {
- if (!RadioPlayerService.this.Cheddar()) {
- RadioPlayerService.Braudostur(RadioPlayerService.this);
- }
- if (RadioPlayerService.this.Cheddar()) {
- if (RadioPlayerService.this.Bierkase() != 0) {
- break label74;
- }
- }
- label74:
- for (boolean bool = RadioPlayerService.Bierkase(RadioPlayerService.this); bool; bool = RadioPlayerService.BleudeSeptmoncel(RadioPlayerService.this))
- {
- Log.v(RadioPlayerService.Friesla(), "Updating playstate");
- RadioPlayerService.this.Crowley();
- RadioPlayerService.Abondance(RadioPlayerService.this, 3);
- return;
- }
- Log.v(RadioPlayerService.Friesla(), "Board denied play request");
- }
- });
- }
- return;
- i = this.DoubleGloucester;
- continue;
- i = this.Edam;
- }
- }
- public void Cojack()
- {
- AbbayedeBelloc(new Runnable()
- {
- public void run()
- {
- RadioPlayerService.AubisquePyrenees(RadioPlayerService.this);
- }
- });
- }
- public void ColbyJack()
- {
- AbbayedeBelloc(new Runnable()
- {
- public void run()
- {
- RadioPlayerService.Airedale(RadioPlayerService.this, true);
- RadioPlayerService.Aragon(RadioPlayerService.this).AbbayedeBelloc(0);
- }
- });
- }
- public void Crowley()
- {
- AbbayedeBelloc(new Runnable()
- {
- public void run()
- {
- RadioPlayerService.Airedale(RadioPlayerService.this, false);
- RadioPlayerService.Aragon(RadioPlayerService.this).AbbayedeBelloc(RadioPlayerService.this.Blarney());
- }
- });
- }
- public void DevonBlue()
- {
- if (!this.AubisquePyrenees.Chontaleno())
- {
- BleudeSeptmoncel(1);
- return;
- }
- AbbayedeBelloc(new Runnable()
- {
- public void run()
- {
- RadioPlayerService.Airedale(RadioPlayerService.this, true);
- while ((!RadioPlayerService.Aragon(RadioPlayerService.this).AbbayedeBelloc(0)) && (RadioPlayerService.Aragon(RadioPlayerService.this).Cojack())) {}
- if ((RadioPlayerService.Aragon(RadioPlayerService.this).Cojack()) && (RadioPlayerService.Aragon(RadioPlayerService.this).Beaufort() == 1)) {
- RadioPlayerService.Aragon(RadioPlayerService.this).AubisquePyrenees();
- }
- RadioPlayerService.Abondance(RadioPlayerService.this, 1);
- }
- });
- }
- public void DevonGarland()
- {
- Blarney(1);
- }
- public void DoubleGloucester()
- {
- Blarney(-1);
- }
- public void Edam()
- {
- Aragon(1);
- }
- public void Edelpilz()
- {
- Aragon(0);
- }
- public void Esbareich()
- {
- AbbayedeBelloc(new Runnable()
- {
- public void run()
- {
- RadioPlayerService.Aragon(RadioPlayerService.this).Chevres();
- }
- });
- }
- public void Esrom()
- {
- this.Beaufort = new d[0];
- this.AubisquePyrenees.AbbayedeBelloc(this.Esrom);
- }
- public void Filetta()
- {
- if (this.FourmedAmbert.isAlive()) {
- this.FourmedAmbert.interrupt();
- }
- if (this.Ardrahan != null) {
- this.Ardrahan.Airedale();
- }
- this.Ardrahan = null;
- Maribo();
- if (this.AubisquePyrenees.Cojack())
- {
- DevonBlue();
- this.AubisquePyrenees.Airedale();
- }
- }
- public void Fontal()
- {
- Iterator localIterator = this.Airedale.iterator();
- while (localIterator.hasNext()) {
- ((c)localIterator.next()).d_();
- }
- }
- public void FourmedAmbert()
- {
- Iterator localIterator = this.Airedale.iterator();
- while (localIterator.hasNext()) {
- ((c)localIterator.next()).e_();
- }
- }
- public void onAudioFocusChange(int paramInt)
- {
- Log.v(Alverca, "Audio focus changed");
- switch (paramInt)
- {
- default:
- case -1:
- case 0:
- case -3:
- case -2:
- do
- {
- do
- {
- return;
- Maasdam();
- return;
- DevonBlue();
- return;
- } while (!this.AubisquePyrenees.Chontaleno());
- Kikorangi();
- return;
- } while (!this.AubisquePyrenees.Chontaleno());
- ColbyJack();
- return;
- }
- Leerdammer();
- }
- public IBinder onBind(Intent paramIntent)
- {
- return this.Aragon;
- }
- public void onCreate()
- {
- this.Edelpilz = PreferenceManager.getDefaultSharedPreferences(this);
- this.Brick = ((AudioManager)getSystemService("audio"));
- if (!this.Edelpilz.getBoolean(getString(2131558409), true)) {}
- for (this.Cojack = this.Edelpilz.getInt(getString(2131558411), 13);; this.Cojack = this.Brick.getStreamVolume(3))
- {
- Log.d(Alverca, "Start volume: " + this.Cojack);
- this.CanadianCheddar = new MediaSessionCompat(this, getClass().getSimpleName());
- this.CanadianCheddar.AbbayedeBelloc(new b(null));
- this.CanadianCheddar.AbbayedeBelloc(3);
- Fynbo();
- this.Chaumes = new PlaybackStateCompat.a();
- BleudeSeptmoncel(1);
- Abondance(new d());
- this.AubisquePyrenees = new com.freshollie.monkeyboard.keystoneradio.a.b(getApplicationContext());
- this.AubisquePyrenees.AbbayedeBelloc().AbbayedeBelloc(this.Geitost);
- this.AubisquePyrenees.AbbayedeBelloc().AbbayedeBelloc(this.Filetta);
- Abondance(this.Cojack);
- Geitost();
- Alverca();
- return;
- }
- }
- public void onDestroy()
- {
- Log.v(Alverca, "Stopping service");
- Filetta();
- if (this.FourmedAmbert.isAlive()) {
- this.FourmedAmbert.interrupt();
- }
- if (this.Chontaleno != null) {
- getApplicationContext().getContentResolver().unregisterContentObserver(this.Chontaleno);
- }
- for (;;)
- {
- this.CanadianCheddar.AbbayedeBelloc(null);
- this.CanadianCheddar.AbbayedeBelloc();
- this.AubisquePyrenees.AbbayedeBelloc().Abondance(this.Geitost);
- this.AubisquePyrenees.AbbayedeBelloc().Abondance(this.Filetta);
- if (this.AubisquePyrenees.Cojack()) {
- this.AubisquePyrenees.Airedale();
- }
- return;
- if (this.Cantal != null) {
- this.CanadianCheddar.Abondance(3);
- }
- }
- }
- public int onStartCommand(Intent paramIntent, int paramInt1, int paramInt2)
- {
- Log.v(Alverca, "Got an intent");
- String str;
- if ((paramIntent != null) && (paramIntent.getAction() != null))
- {
- Log.v(Alverca, "Received intent:" + paramIntent.getAction());
- str = paramIntent.getAction();
- paramInt1 = -1;
- switch (str.hashCode())
- {
- }
- }
- for (;;)
- {
- switch (paramInt1)
- {
- default:
- MediaButtonReceiver.AbbayedeBelloc(this.CanadianCheddar, paramIntent);
- return 2;
- if (str.equals("com.freshollie..monkeyboard.keystoneradio.playback.radioplayerservice.action.STOP"))
- {
- paramInt1 = 0;
- continue;
- if (str.equals("com.freshollie.monkeyboard.keystoneradio.playback.radioplayerservice.action.SEARCH_FORWARDS"))
- {
- paramInt1 = 1;
- continue;
- if (str.equals("com.freshollie..monkeyboard.keystoneradio.playback.radioplayerservice.action.NEXT"))
- {
- paramInt1 = 2;
- continue;
- if (str.equals("com.freshollie..monkeyboard.keystoneradio.playback.radioplayerservice.action.PAUSE"))
- {
- paramInt1 = 3;
- continue;
- if (str.equals("com.freshollie..monkeyboard.keystoneradio.playback.radioplayerservice.action.PREVIOUS"))
- {
- paramInt1 = 4;
- continue;
- if (str.equals("com.freshollie.monkeyboard.keystoneradio.playback.radioplayerservice.action.SEARCH_BACKWARDS"))
- {
- paramInt1 = 5;
- continue;
- if (str.equals("com.freshollie..monkeyboard.keystoneradio.playback.radioplayerservice.action.PLAY")) {
- paramInt1 = 6;
- }
- }
- }
- }
- }
- }
- }
- break;
- }
- }
- FourmedAmbert();
- Filetta();
- return 2;
- Edam();
- return 2;
- DevonGarland();
- return 2;
- DevonBlue();
- return 2;
- DoubleGloucester();
- return 2;
- Edelpilz();
- return 2;
- Chontaleno();
- return 2;
- }
- private static enum a
- {
- private a() {}
- }
- private class b
- extends MediaSessionCompat.a
- {
- private b() {}
- public boolean AbbayedeBelloc(Intent paramIntent)
- {
- Log.v(RadioPlayerService.Friesla(), "Got media button intent");
- paramIntent = (KeyEvent)paramIntent.getParcelableExtra("android.intent.extra.KEY_EVENT");
- if (paramIntent.getAction() == 1)
- {
- switch (paramIntent.getKeyCode())
- {
- default:
- return false;
- case 85:
- if (RadioPlayerService.CanadianCheddar(RadioPlayerService.this).getBoolean(RadioPlayerService.this.getString(2131558406), false)) {
- RadioPlayerService.this.Chontaleno();
- }
- for (;;)
- {
- return true;
- if (RadioPlayerService.this.Cheshire()) {
- RadioPlayerService.this.DevonBlue();
- } else {
- RadioPlayerService.this.Chontaleno();
- }
- }
- case 126:
- Abondance();
- return true;
- case 87:
- Alverca();
- return true;
- case 90:
- Aragon();
- return true;
- case 89:
- Ardrahan();
- return true;
- case 88:
- Appenzell();
- return true;
- }
- Airedale();
- return true;
- }
- return false;
- }
- public void Abondance()
- {
- RadioPlayerService.this.Chontaleno();
- }
- public void Airedale()
- {
- RadioPlayerService.this.DevonBlue();
- }
- public void Alverca()
- {
- if (RadioPlayerService.CanadianCheddar(RadioPlayerService.this).getBoolean(RadioPlayerService.this.getString(2131558485), true))
- {
- RadioPlayerService.this.DevonGarland();
- return;
- }
- RadioPlayerService.this.Edam();
- }
- public void Appenzell()
- {
- if (RadioPlayerService.CanadianCheddar(RadioPlayerService.this).getBoolean(RadioPlayerService.this.getString(2131558485), true))
- {
- RadioPlayerService.this.DoubleGloucester();
- return;
- }
- RadioPlayerService.this.Edelpilz();
- }
- public void Aragon()
- {
- super.Aragon();
- RadioPlayerService.this.Edam();
- }
- public void Ardrahan()
- {
- super.Ardrahan();
- RadioPlayerService.this.Edelpilz();
- }
- public void AubisquePyrenees()
- {
- RadioPlayerService.this.FourmedAmbert();
- }
- }
- public static abstract interface c
- {
- public abstract void AbbayedeBelloc(int paramInt1, int paramInt2);
- public abstract void Abondance();
- public abstract void Abondance(int paramInt1, int paramInt2);
- public abstract void Alverca();
- public abstract void Beaufort(int paramInt);
- public abstract void Bierkase(int paramInt);
- public abstract void Blarney(int paramInt);
- public abstract void b_();
- public abstract void c_();
- public abstract void d_();
- public abstract void e_();
- }
- public class d
- extends Binder
- {
- public d() {}
- public RadioPlayerService AbbayedeBelloc()
- {
- return RadioPlayerService.this;
- }
- }
- }
Add Comment
Please, Sign In to add comment