Added a null check for the RingerProcessingService starting intent

closes #134
This commit is contained in:
2012-08-08 09:46:31 -04:00
parent 5ad5cb4a00
commit 7a726f22c5
2 changed files with 10 additions and 4 deletions

View File

@@ -2,8 +2,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.TwentyCodes.android.LocationRinger" package="com.TwentyCodes.android.LocationRinger"
android:installLocation="internalOnly" android:installLocation="internalOnly"
android:versionCode="137" android:versionCode="143"
android:versionName="fc8952e" > android:versionName="5ad5cb4" >
<uses-sdk android:minSdkVersion="7"/> <uses-sdk android:minSdkVersion="7"/>

View File

@@ -230,11 +230,17 @@ public class RingerProcessingService extends Service {
e.printStackTrace(); e.printStackTrace();
} }
if(intent == null)
stopSelf(startId);
if (intent.getParcelableExtra(LocationLibraryConstants.INTENT_EXTRA_LOCATION_CHANGED) != null) { if (intent.getParcelableExtra(LocationLibraryConstants.INTENT_EXTRA_LOCATION_CHANGED) != null) {
mLocation = intent.getParcelableExtra(LocationLibraryConstants.INTENT_EXTRA_LOCATION_CHANGED); mLocation = intent.getParcelableExtra(LocationLibraryConstants.INTENT_EXTRA_LOCATION_CHANGED);
processRingers(); processRingers();
} else if (Debug.DEBUG) } else {
if (Debug.DEBUG)
Log.d(TAG, "Location was null"); Log.d(TAG, "Location was null");
stopSelf(startId);
}
return super.onStartCommand(intent, flags, startId); return super.onStartCommand(intent, flags, startId);
} }