Browse files

Ignore the network country code if TelephonyManager reports PHONE_TYP…

…E_NONE
  • Loading branch information...
1 parent 3d00a75 commit 7657e5b873fd46ed233954a8c34b81fb61ffb1b0 Sam Steele committed Feb 22, 2012
View
3 app/src/fm/last/android/player/RadioPlayerService.java
@@ -154,7 +154,7 @@
public static boolean radioAvailable(Context context) {
TelephonyManager tm = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
- if (tm == null || tm.getNetworkCountryIso() == null|| tm.getNetworkCountryIso().length() == 0
+ if (tm == null || tm.getPhoneType() == TelephonyManager.PHONE_TYPE_NONE || tm.getNetworkCountryIso() == null|| tm.getNetworkCountryIso().length() == 0
|| tm.getNetworkCountryIso().equals("us") || tm.getNetworkCountryIso().equals("310") || tm.getNetworkCountryIso().equals("311") || tm.getNetworkCountryIso().equals("312") || tm.getNetworkCountryIso().equals("313") || tm.getNetworkCountryIso().equals("314") || tm.getNetworkCountryIso().equals("315")
|| tm.getNetworkCountryIso().equals("gb") || tm.getNetworkCountryIso().equals("234") || tm.getNetworkCountryIso().equals("235")
|| tm.getNetworkCountryIso().equals("de") || tm.getNetworkCountryIso().equals("262")) {
@@ -1385,6 +1385,7 @@ public void pause() throws DeadObjectException {
if(mState == STATE_PAUSED && mp != null)
mp.setVolume(1.0f, 1.0f);
RadioPlayerService.this.pause();
+ lostDataConnection = false;
}
public void stop() throws DeadObjectException {
View
9 app/src/fm/last/android/scrobbler/ScrobblerService.java
@@ -519,6 +519,15 @@ public void handleIntent(Intent intent) {
return;
}
+ /*if(intent.getAction() != null) { //Dump the intent to the log for troubleshooting buggy apps
+ logger.info("Intent: " + intent.getAction());
+ if(intent.getExtras() != null && intent.getExtras().size() > 0) {
+ for(String key : intent.getExtras().keySet()) {
+ logger.info("Key: " + key + " value: " + intent.getExtras().get(key));
+ }
+ }
+ }*/
+
if (intent.getAction().equals(META_CHANGED)) {
long startTime = System.currentTimeMillis() / 1000;
long position = intent.getLongExtra("position", 0) / 1000;

0 comments on commit 7657e5b

Please sign in to comment.