Loading core/java/com/android/internal/widget/LockPatternUtils.java +17 −0 Original line number Diff line number Diff line Loading @@ -154,6 +154,7 @@ public class LockPatternUtils { public final static String LOCKSCREEN_POWER_BUTTON_INSTANTLY_LOCKS = "lockscreen.power_button_instantly_locks"; public final static String LOCKSCREEN_WIDGETS_ENABLED = "lockscreen.widgets_enabled"; public final static String LOCKSCREEN_CAMERA_ENABLED = "lockscreen.camera_enabled"; public final static String PASSWORD_HISTORY_KEY = "lockscreen.passwordhistory"; Loading Loading @@ -1431,6 +1432,22 @@ public class LockPatternUtils { setBoolean(LOCKSCREEN_WIDGETS_ENABLED, enabled, userId); } public boolean getCameraEnabled() { return getCameraEnabled(getCurrentOrCallingUserId()); } public boolean getCameraEnabled(int userId) { return getBoolean(LOCKSCREEN_CAMERA_ENABLED, true, userId); } public void setCameraEnabled(boolean enabled) { setCameraEnabled(enabled, getCurrentOrCallingUserId()); } public void setCameraEnabled(boolean enabled, int userId) { setBoolean(LOCKSCREEN_CAMERA_ENABLED, enabled, userId); } /** * @hide * Set the lock-before-unlock option (show widgets before the secure Loading packages/Keyguard/src/com/android/keyguard/KeyguardHostView.java +2 −1 Original line number Diff line number Diff line Loading @@ -476,7 +476,8 @@ public class KeyguardHostView extends KeyguardViewBase { private boolean cameraDisabledByDpm() { return mCameraDisabled || (mDisabledFeatures & DevicePolicyManager.KEYGUARD_DISABLE_SECURE_CAMERA) != 0; || (mDisabledFeatures & DevicePolicyManager.KEYGUARD_DISABLE_SECURE_CAMERA) != 0 || !mLockPatternUtils.getCameraEnabled(); } private void updateSecurityViews() { Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java +6 −1 Original line number Diff line number Diff line Loading @@ -50,6 +50,7 @@ import android.view.accessibility.AccessibilityManager.TouchExplorationStateChan import android.widget.ImageView; import android.widget.LinearLayout; import com.android.internal.widget.LockPatternUtils; import com.android.systemui.R; import com.android.systemui.statusbar.BaseStatusBar; import com.android.systemui.statusbar.DelegateViewHelper; Loading @@ -73,6 +74,7 @@ public class NavigationBarView extends LinearLayout { private boolean mInEditMode; private NavbarEditor mEditBar; private NavBarReceiver mNavBarReceiver; private LockPatternUtils mLockUtils; private OnClickListener mRecentsClickListener; private OnTouchListener mRecentsPreloadListener; private OnTouchListener mHomeSearchActionListener; Loading Loading @@ -232,6 +234,8 @@ public class NavigationBarView extends LinearLayout { mNavBarReceiver = new NavBarReceiver(); mContext.registerReceiverAsUser(mNavBarReceiver, UserHandle.ALL, new IntentFilter(NAVBAR_EDIT_ACTION), null, null); mLockUtils = new LockPatternUtils(context); } private void watchForDevicePolicyChanges() { Loading Loading @@ -469,7 +473,8 @@ public class NavigationBarView extends LinearLayout { setButtonWithTagVisibility(NavbarEditor.NAVBAR_SEARCH, !disableRecent); final boolean showSearch = disableHome && !disableSearch; final boolean showCamera = showSearch && !mCameraDisabledByDpm; final boolean showCamera = showSearch && !mCameraDisabledByDpm && mLockUtils.getCameraEnabled(); setVisibleOrGone(getSearchLight(), showSearch); setVisibleOrGone(getCameraButton(), showCamera); Loading Loading
core/java/com/android/internal/widget/LockPatternUtils.java +17 −0 Original line number Diff line number Diff line Loading @@ -154,6 +154,7 @@ public class LockPatternUtils { public final static String LOCKSCREEN_POWER_BUTTON_INSTANTLY_LOCKS = "lockscreen.power_button_instantly_locks"; public final static String LOCKSCREEN_WIDGETS_ENABLED = "lockscreen.widgets_enabled"; public final static String LOCKSCREEN_CAMERA_ENABLED = "lockscreen.camera_enabled"; public final static String PASSWORD_HISTORY_KEY = "lockscreen.passwordhistory"; Loading Loading @@ -1431,6 +1432,22 @@ public class LockPatternUtils { setBoolean(LOCKSCREEN_WIDGETS_ENABLED, enabled, userId); } public boolean getCameraEnabled() { return getCameraEnabled(getCurrentOrCallingUserId()); } public boolean getCameraEnabled(int userId) { return getBoolean(LOCKSCREEN_CAMERA_ENABLED, true, userId); } public void setCameraEnabled(boolean enabled) { setCameraEnabled(enabled, getCurrentOrCallingUserId()); } public void setCameraEnabled(boolean enabled, int userId) { setBoolean(LOCKSCREEN_CAMERA_ENABLED, enabled, userId); } /** * @hide * Set the lock-before-unlock option (show widgets before the secure Loading
packages/Keyguard/src/com/android/keyguard/KeyguardHostView.java +2 −1 Original line number Diff line number Diff line Loading @@ -476,7 +476,8 @@ public class KeyguardHostView extends KeyguardViewBase { private boolean cameraDisabledByDpm() { return mCameraDisabled || (mDisabledFeatures & DevicePolicyManager.KEYGUARD_DISABLE_SECURE_CAMERA) != 0; || (mDisabledFeatures & DevicePolicyManager.KEYGUARD_DISABLE_SECURE_CAMERA) != 0 || !mLockPatternUtils.getCameraEnabled(); } private void updateSecurityViews() { Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarView.java +6 −1 Original line number Diff line number Diff line Loading @@ -50,6 +50,7 @@ import android.view.accessibility.AccessibilityManager.TouchExplorationStateChan import android.widget.ImageView; import android.widget.LinearLayout; import com.android.internal.widget.LockPatternUtils; import com.android.systemui.R; import com.android.systemui.statusbar.BaseStatusBar; import com.android.systemui.statusbar.DelegateViewHelper; Loading @@ -73,6 +74,7 @@ public class NavigationBarView extends LinearLayout { private boolean mInEditMode; private NavbarEditor mEditBar; private NavBarReceiver mNavBarReceiver; private LockPatternUtils mLockUtils; private OnClickListener mRecentsClickListener; private OnTouchListener mRecentsPreloadListener; private OnTouchListener mHomeSearchActionListener; Loading Loading @@ -232,6 +234,8 @@ public class NavigationBarView extends LinearLayout { mNavBarReceiver = new NavBarReceiver(); mContext.registerReceiverAsUser(mNavBarReceiver, UserHandle.ALL, new IntentFilter(NAVBAR_EDIT_ACTION), null, null); mLockUtils = new LockPatternUtils(context); } private void watchForDevicePolicyChanges() { Loading Loading @@ -469,7 +473,8 @@ public class NavigationBarView extends LinearLayout { setButtonWithTagVisibility(NavbarEditor.NAVBAR_SEARCH, !disableRecent); final boolean showSearch = disableHome && !disableSearch; final boolean showCamera = showSearch && !mCameraDisabledByDpm; final boolean showCamera = showSearch && !mCameraDisabledByDpm && mLockUtils.getCameraEnabled(); setVisibleOrGone(getSearchLight(), showSearch); setVisibleOrGone(getCameraButton(), showCamera); Loading