Skip to content

Commit

Permalink
Removing the reuse of PendingIntent.
Browse files Browse the repository at this point in the history
The variable was actually never set so this is a no-op, but
not sure we should do this because other apis can actually cancel
their intent.
https://developer.android.com/reference/com/google/android/gms/location/FusedLocationProviderApi.html#requestLocationUpdates(com.google.android.gms.common.api.GoogleApiClient, com.google.android.gms.location.LocationRequest, android.app.PendingIntent)

Change-Id: Ifaf26584a270ceac936dd5723ebdfc4053b2ff1e
  • Loading branch information
PaulRashidi committed Jan 17, 2015
1 parent 6623844 commit 1056513
Showing 1 changed file with 0 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,6 @@ public class MainActivity extends ActionBarActivity implements
*/
protected GoogleApiClient mGoogleApiClient;

/**
* Used when requesting or removing activity detection updates.
*/
private PendingIntent mActivityDetectionPendingIntent;

// UI elements.
private Button mRequestActivityUpdatesButton;
private Button mRemoveActivityUpdatesButton;
Expand Down Expand Up @@ -280,10 +275,6 @@ public void onResult(Status status) {
* Gets a PendingIntent to be sent for each activity detection.
*/
private PendingIntent getActivityDetectionPendingIntent() {
// Reuse the PendingIntent if we already have it.
if (mActivityDetectionPendingIntent != null) {
return mActivityDetectionPendingIntent;
}
Intent intent = new Intent(this, DetectedActivitiesIntentService.class);

// We use FLAG_UPDATE_CURRENT so that we get the same pending intent back when calling
Expand Down

0 comments on commit 1056513

Please sign in to comment.