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

Commit b4c3c1fc authored by Tony Mak's avatar Tony Mak Committed by android-build-merger
Browse files

Merge "Set lock screen to be in public mode if one of its profile is secure" into nyc-dev

am: 95a127cb

* commit '95a127cb':
  Set lock screen to be in public mode if one of its profile is secure

Change-Id: Ibeaf86c324644aa088eafe47171c5dab811201d4
parents 609bfc39 95a127cb
Loading
Loading
Loading
Loading
+12 −3
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@ import android.content.Intent;
import android.content.IntentFilter;
import android.content.pm.IPackageManager;
import android.content.pm.PackageManager;
import android.content.pm.UserInfo;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.database.ContentObserver;
@@ -3950,9 +3951,17 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
    }

    private void updatePublicMode() {
        setLockscreenPublicMode(
                mStatusBarKeyguardViewManager.isShowing() && mStatusBarKeyguardViewManager
                        .isSecure(mCurrentUserId));
        boolean isPublic = false;
        if (mStatusBarKeyguardViewManager.isShowing()) {
            for (int i = mCurrentProfiles.size() - 1; i >= 0; i--) {
                UserInfo userInfo = mCurrentProfiles.valueAt(i);
                if (mStatusBarKeyguardViewManager.isSecure(userInfo.id)) {
                    isPublic = true;
                    break;
                }
            }
        }
        setLockscreenPublicMode(isPublic);
    }

    protected void updateKeyguardState(boolean goingToFullShade, boolean fromShadeLocked) {