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

Commit 4cb149c2 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Add fallback to FROZEN_CALLEE_POLICY_UNSET" into main

parents ec7ea5ab b246d740
Loading
Loading
Loading
Loading
+16 −4
Original line number Diff line number Diff line
@@ -194,15 +194,27 @@ public class RemoteCallbackList<E extends IInterface> {
            }
        }

        public void maybeSubscribeToFrozenCallback() throws RemoteException {
        void maybeSubscribeToFrozenCallback() throws RemoteException {
            if (mFrozenCalleePolicy != FROZEN_CALLEE_POLICY_UNSET) {
                try {
                    mBinder.addFrozenStateChangeCallback(this);
                } catch (UnsupportedOperationException e) {
                    // The kernel does not support frozen notifications. In this case we want to
                    // silently fall back to FROZEN_CALLEE_POLICY_UNSET. This is done by simply
                    // ignoring the error and moving on. mCurrentState would always be
                    // STATE_UNFROZEN and all callbacks are invoked immediately.
                }
            }
        }

        public void maybeUnsubscribeFromFrozenCallback() {
        void maybeUnsubscribeFromFrozenCallback() {
            if (mFrozenCalleePolicy != FROZEN_CALLEE_POLICY_UNSET) {
                try {
                    mBinder.removeFrozenStateChangeCallback(this);
                } catch (UnsupportedOperationException e) {
                    // The kernel does not support frozen notifications. Ignore the error and move
                    // on.
                }
            }
        }