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

Commit 8458fc31 authored by Ashwini Munigala's avatar Ashwini Munigala Committed by Andre Eisenbach
Browse files

MAP: Cleanup PendingIntent in cancelUserTimeoutAlarm.

Handle cleanup for timeout Intent and pending Intent
in cancelUserTimeoutAlarm API.

Change-Id: I4f4184785675b2deffa3be8c9dd70b2673020b51
parent 7cbec75e
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;
    }