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

Commit de15991a authored by Thomas Vannet's avatar Thomas Vannet Committed by Android (Google) Code Review
Browse files

Merge "Catch exception when stopping OTP session twice" into tm-dev

parents 7fb93979 fb818c51
Loading
Loading
Loading
Loading
+15 −3
Original line number Diff line number Diff line
@@ -317,9 +317,21 @@ public class OneTimePermissionUserManager {
            synchronized (mInnerLock) {
                mIsFinished = true;
                cancelAlarmLocked();
                try {
                    mActivityManager.removeOnUidImportanceListener(mStartTimerListener);
                } catch (IllegalArgumentException e) {
                    Log.e(LOG_TAG, "Could not remove start timer listener", e);
                }
                try {
                    mActivityManager.removeOnUidImportanceListener(mSessionKillableListener);
                } catch (IllegalArgumentException e) {
                    Log.e(LOG_TAG, "Could not remove session killable listener", e);
                }
                try {
                    mActivityManager.removeOnUidImportanceListener(mGoneListener);
                } catch (IllegalArgumentException e) {
                    Log.e(LOG_TAG, "Could not remove gone listener", e);
                }
            }
        }