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

Commit 8eb5097e authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Add wakefullness calls on main thread" into sc-v2-dev

parents 041b74ab c35d18f7
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -261,8 +261,10 @@ public class CarrierTextManager {
            mCarrierTextCallback = callback;
            if (mNetworkSupported.get()) {
                // Keyguard update monitor expects callbacks from main thread
                mMainExecutor.execute(() -> mKeyguardUpdateMonitor.registerCallback(mCallback));
                mMainExecutor.execute(() -> {
                    mKeyguardUpdateMonitor.registerCallback(mCallback);
                    mWakefulnessLifecycle.addObserver(mWakefulnessObserver);
                });
                mTelephonyListenerManager.addActiveDataSubscriptionIdListener(mPhoneStateListener);
            } else {
                // Don't listen and clear out the text when the device isn't a phone.
@@ -272,8 +274,10 @@ public class CarrierTextManager {
            }
        } else {
            mCarrierTextCallback = null;
            mMainExecutor.execute(() -> mKeyguardUpdateMonitor.removeCallback(mCallback));
            mMainExecutor.execute(() -> {
                mKeyguardUpdateMonitor.removeCallback(mCallback);
                mWakefulnessLifecycle.removeObserver(mWakefulnessObserver);
            });
            mTelephonyListenerManager.removeActiveDataSubscriptionIdListener(mPhoneStateListener);
        }
    }