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

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

Merge "Remove DEBUG protection around keyguard display logging" into main

parents bfbc20d3 86c76233
Loading
Loading
Loading
Loading
+13 −21
Original line number Original line Diff line number Diff line
@@ -142,33 +142,28 @@ public class KeyguardDisplayManager {


    private boolean isKeyguardShowable(Display display) {
    private boolean isKeyguardShowable(Display display) {
        if (display == null) {
        if (display == null) {
            if (DEBUG) Log.i(TAG, "Cannot show Keyguard on null display");
            Log.i(TAG, "Cannot show Keyguard on null display");
            return false;
            return false;
        }
        }
        if (ShadeWindowGoesAround.isEnabled()) {
        if (ShadeWindowGoesAround.isEnabled()) {
            int shadeDisplayId = mShadePositionRepositoryProvider.get().getDisplayId().getValue();
            int shadeDisplayId = mShadePositionRepositoryProvider.get().getDisplayId().getValue();
            if (display.getDisplayId() == shadeDisplayId) {
            if (display.getDisplayId() == shadeDisplayId) {
                if (DEBUG) {
                Log.i(TAG, "Do not show KeyguardPresentation on the shade window display");
                    Log.i(TAG,
                            "Do not show KeyguardPresentation on the shade window display");
                }
                return false;
                return false;
            }
            }
        } else {
        } else {
            if (display.getDisplayId() == mDisplayTracker.getDefaultDisplayId()) {
            if (display.getDisplayId() == mDisplayTracker.getDefaultDisplayId()) {
                if (DEBUG) Log.i(TAG, "Do not show KeyguardPresentation on the default display");
                Log.i(TAG, "Do not show KeyguardPresentation on the default display");
                return false;
                return false;
            }
            }
        }
        }
        display.getDisplayInfo(mTmpDisplayInfo);
        display.getDisplayInfo(mTmpDisplayInfo);
        if ((mTmpDisplayInfo.flags & Display.FLAG_PRIVATE) != 0) {
        if ((mTmpDisplayInfo.flags & Display.FLAG_PRIVATE) != 0) {
            if (DEBUG) Log.i(TAG, "Do not show KeyguardPresentation on a private display");
            Log.i(TAG, "Do not show KeyguardPresentation on a private display");
            return false;
            return false;
        }
        }
        if ((mTmpDisplayInfo.flags & Display.FLAG_ALWAYS_UNLOCKED) != 0) {
        if ((mTmpDisplayInfo.flags & Display.FLAG_ALWAYS_UNLOCKED) != 0) {
            if (DEBUG) {
            Log.i(TAG, "Do not show KeyguardPresentation on an unlocked display");
            Log.i(TAG, "Do not show KeyguardPresentation on an unlocked display");
            }
            return false;
            return false;
        }
        }


@@ -176,14 +171,11 @@ public class KeyguardDisplayManager {
                mDeviceStateHelper.isConcurrentDisplayActive(display)
                mDeviceStateHelper.isConcurrentDisplayActive(display)
                        || mDeviceStateHelper.isRearDisplayOuterDefaultActive(display);
                        || mDeviceStateHelper.isRearDisplayOuterDefaultActive(display);
        if (mKeyguardStateController.isOccluded() && deviceStateOccludesKeyguard) {
        if (mKeyguardStateController.isOccluded() && deviceStateOccludesKeyguard) {
            if (DEBUG) {
            // When activities with FLAG_SHOW_WHEN_LOCKED are shown on top of Keyguard, the Keyguard
                // When activities with FLAG_SHOW_WHEN_LOCKED are shown on top of Keyguard, the
            // state becomes "occluded". In this case, we should not show the KeyguardPresentation,
                // Keyguard state becomes "occluded". In this case, we should not show the
            // since the activity is presenting content onto the non-default display.
                // KeyguardPresentation, since the activity is presenting content onto the
                // non-default display.
            Log.i(TAG, "Do not show KeyguardPresentation when occluded and concurrent or rear"
            Log.i(TAG, "Do not show KeyguardPresentation when occluded and concurrent or rear"
                    + " display is active");
                    + " display is active");
            }
            return false;
            return false;
        }
        }


@@ -197,7 +189,7 @@ public class KeyguardDisplayManager {
     */
     */
    private boolean showPresentation(Display display) {
    private boolean showPresentation(Display display) {
        if (!isKeyguardShowable(display)) return false;
        if (!isKeyguardShowable(display)) return false;
        if (DEBUG) Log.i(TAG, "Keyguard enabled on display: " + display);
        Log.i(TAG, "Keyguard enabled on display: " + display);
        final int displayId = display.getDisplayId();
        final int displayId = display.getDisplayId();
        Presentation presentation = mPresentations.get(displayId);
        Presentation presentation = mPresentations.get(displayId);
        if (presentation == null) {
        if (presentation == null) {
@@ -239,7 +231,7 @@ public class KeyguardDisplayManager {


    public void show() {
    public void show() {
        if (!mShowing) {
        if (!mShowing) {
            if (DEBUG) Log.v(TAG, "show");
            Log.v(TAG, "show");
            if (mMediaRouter != null) {
            if (mMediaRouter != null) {
                mMediaRouter.addCallback(MediaRouter.ROUTE_TYPE_REMOTE_DISPLAY,
                mMediaRouter.addCallback(MediaRouter.ROUTE_TYPE_REMOTE_DISPLAY,
                        mMediaRouterCallback, MediaRouter.CALLBACK_FLAG_PASSIVE_DISCOVERY);
                        mMediaRouterCallback, MediaRouter.CALLBACK_FLAG_PASSIVE_DISCOVERY);
@@ -253,7 +245,7 @@ public class KeyguardDisplayManager {


    public void hide() {
    public void hide() {
        if (mShowing) {
        if (mShowing) {
            if (DEBUG) Log.v(TAG, "hide");
            Log.v(TAG, "hide");
            if (mMediaRouter != null) {
            if (mMediaRouter != null) {
                mMediaRouter.removeCallback(mMediaRouterCallback);
                mMediaRouter.removeCallback(mMediaRouterCallback);
            }
            }