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

Commit 92c989dc authored by Tony Mak's avatar Tony Mak
Browse files

Set lock screen to be in public mode if one of its profile is secure

Change-Id: I7d819c7d4a52ff45705b1a1b9e215faf0957cccb
Fix: 27118634
parent 38745971
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) {