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

Commit 50a006d7 authored by Alex Salo's avatar Alex Salo Committed by android-build-merger
Browse files

Merge "Merge "Prevent deadlock in AttentionManagerService" into qt-dev am:...

Merge "Merge "Prevent deadlock in AttentionManagerService" into qt-dev am: bcfa3c15 am: e19629a0" into qt-r1-dev-plus-aosp
am: 25b6bb5d

Change-Id: Ibf27ae2cd548f99dc9b17b9483c13fa488b226b0
parents f45d7975 25b6bb5d
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -115,6 +115,14 @@ public class AttentionManagerService extends SystemService {
        mAttentionHandler = handler;
    }

    @Override
    public void onBootPhase(int phase) {
        if (phase == SystemService.PHASE_SYSTEM_SERVICES_READY) {
            mContext.registerReceiver(new ScreenStateReceiver(),
                    new IntentFilter(Intent.ACTION_SCREEN_OFF));
        }
    }

    @Override
    public void onStart() {
        publishBinderService(Context.ATTENTION_SERVICE, new BinderService());
@@ -135,10 +143,6 @@ public class AttentionManagerService extends SystemService {
    private boolean isServiceAvailable() {
        if (mComponentName == null) {
            mComponentName = resolveAttentionService(mContext);
            if (mComponentName != null) {
                mContext.registerReceiver(new ScreenStateReceiver(),
                        new IntentFilter(Intent.ACTION_SCREEN_OFF));
            }
        }
        return mComponentName != null;
    }