Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b74f5d74 authored by Ashwini Munigala's avatar Ashwini Munigala Committed by android-build-merger
Browse files

Merge "MAP: Cleanup PendingIntent in cancelUserTimeoutAlarm."

am: da10fe73

* commit 'da10fe73':
  MAP: Cleanup PendingIntent in cancelUserTimeoutAlarm.
parents 1fd6b928 da10fe73
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -859,10 +859,12 @@ public class BluetoothMapService extends ProfileService {

    private void cancelUserTimeoutAlarm(){
        if (DEBUG) Log.d(TAG,"cancelUserTimeOutAlarm()");
        Intent intent = new Intent(this, BluetoothMapService.class);
        PendingIntent sender = PendingIntent.getBroadcast(this, 0, intent, 0);
        Intent timeoutIntent = new Intent(USER_CONFIRM_TIMEOUT_ACTION);
        PendingIntent pIntent = PendingIntent.getBroadcast(this, 0, timeoutIntent, 0);
        pIntent.cancel();

        AlarmManager alarmManager = (AlarmManager) this.getSystemService(Context.ALARM_SERVICE);
        alarmManager.cancel(sender);
        alarmManager.cancel(pIntent);
        mRemoveTimeoutMsg = false;
    }