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

Commit cd5c3178 authored by Matt Pietal's avatar Matt Pietal
Browse files

Check if slice provider was initialized

If dagger fails to inject the object properly, it captures and logs
the exception but continues to start the slice provider as if
everything was fine. Check for this, log an error, and return false.

Test: manual - this is a rare injection issue
Flag: EXEMPT bugfix
Fixes: 376019842
Change-Id: I012e4ff52c3c9b75acf7b6f5138e7ed43267bf6a
parent ee829765
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -319,6 +319,11 @@ public class KeyguardSliceProvider extends SliceProvider implements
    @Override
    public boolean onCreateSliceProvider() {
        mContextAvailableCallback.onContextAvailable(getContext());
        if (mMediaManager == null) {
            Log.e(TAG, "Dagger injection failed, cannot start. See any above warnings with string: "
                    + "\"No injector for class\"");
            return false;
        }
        mMediaWakeLock = new SettableWakeLock(
                WakeLock.createPartial(getContext(), mWakeLockLogger, "media"), "media");
        synchronized (KeyguardSliceProvider.sInstanceLock) {