Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java +2 −19 Original line number Diff line number Diff line Loading @@ -397,24 +397,6 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL && pm.resolveActivity(PHONE_INTENT, 0) != null; } private boolean isCameraDisabledByDpm() { final DevicePolicyManager dpm = (DevicePolicyManager) getContext().getSystemService(Context.DEVICE_POLICY_SERVICE); if (dpm != null && mStatusBar != null) { try { final int userId = ActivityManager.getService().getCurrentUser().id; final int disabledFlags = dpm.getKeyguardDisabledFeatures(null, userId); final boolean disabledBecauseKeyguardSecure = (disabledFlags & DevicePolicyManager.KEYGUARD_DISABLE_SECURE_CAMERA) != 0 && mStatusBar.isKeyguardSecure(); return dpm.getCameraDisabled(null) || disabledBecauseKeyguardSecure; } catch (RemoteException e) { Log.e(TAG, "Can't get userId", e); } } return false; } private void watchForCameraPolicyChanges() { final IntentFilter filter = new IntentFilter(); filter.addAction(DevicePolicyManager.ACTION_DEVICE_POLICY_MANAGER_STATE_CHANGED); Loading Loading @@ -865,7 +847,8 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL @Override public IconState getIcon() { ResolveInfo resolved = resolveCameraIntent(); mIconState.isVisible = !isCameraDisabledByDpm() && resolved != null boolean isCameraDisabled = (mStatusBar != null) && !mStatusBar.isCameraAllowedByAdmin(); mIconState.isVisible = !isCameraDisabled && resolved != null && getResources().getBoolean(R.bool.config_keyguardShowCameraAffordance) && mUserSetupComplete; mIconState.drawable = mContext.getDrawable(R.drawable.ic_camera_alt_24dp); Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java +6 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ import android.graphics.Color; import android.graphics.Paint; import android.graphics.Rect; import android.util.AttributeSet; import android.util.EventLog; import android.util.FloatProperty; import android.util.MathUtils; import android.view.MotionEvent; Loading Loading @@ -2440,6 +2441,11 @@ public class NotificationPanelView extends PanelView implements * @param keyguardIsShowing whether keyguard is being shown */ public boolean canCameraGestureBeLaunched(boolean keyguardIsShowing) { if (!mStatusBar.isCameraAllowedByAdmin()) { EventLog.writeEvent(0x534e4554, "63787722", -1, ""); return false; } ResolveInfo resolveInfo = mKeyguardBottomArea.resolveCameraIntent(); String packageToLaunch = (resolveInfo == null || resolveInfo.activityInfo == null) ? null : resolveInfo.activityInfo.packageName; Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +16 −2 Original line number Diff line number Diff line /* * Copyright (C) 2010 The Android Open Source Project * Loading Loading @@ -5040,6 +5038,18 @@ public class StatusBar extends SystemUI implements DemoMode, } } boolean isCameraAllowedByAdmin() { if (mDevicePolicyManager.getCameraDisabled(null, mCurrentUserId)) { return false; } else if (isKeyguardShowing() && isKeyguardSecure()) { // Check if the admin has disabled the camera specifically for the keyguard return (mDevicePolicyManager.getKeyguardDisabledFeatures(null, mCurrentUserId) & DevicePolicyManager.KEYGUARD_DISABLE_SECURE_CAMERA) == 0; } return true; } public void notifyFpAuthModeChanged() { updateDozing(); } Loading @@ -5062,6 +5072,10 @@ public class StatusBar extends SystemUI implements DemoMode, } public boolean isKeyguardShowing() { if (mStatusBarKeyguardViewManager == null) { Slog.i(TAG, "isKeyguardShowing() called before startKeyguard(), returning true"); return true; } return mStatusBarKeyguardViewManager.isShowing(); } Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java +2 −19 Original line number Diff line number Diff line Loading @@ -397,24 +397,6 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL && pm.resolveActivity(PHONE_INTENT, 0) != null; } private boolean isCameraDisabledByDpm() { final DevicePolicyManager dpm = (DevicePolicyManager) getContext().getSystemService(Context.DEVICE_POLICY_SERVICE); if (dpm != null && mStatusBar != null) { try { final int userId = ActivityManager.getService().getCurrentUser().id; final int disabledFlags = dpm.getKeyguardDisabledFeatures(null, userId); final boolean disabledBecauseKeyguardSecure = (disabledFlags & DevicePolicyManager.KEYGUARD_DISABLE_SECURE_CAMERA) != 0 && mStatusBar.isKeyguardSecure(); return dpm.getCameraDisabled(null) || disabledBecauseKeyguardSecure; } catch (RemoteException e) { Log.e(TAG, "Can't get userId", e); } } return false; } private void watchForCameraPolicyChanges() { final IntentFilter filter = new IntentFilter(); filter.addAction(DevicePolicyManager.ACTION_DEVICE_POLICY_MANAGER_STATE_CHANGED); Loading Loading @@ -865,7 +847,8 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL @Override public IconState getIcon() { ResolveInfo resolved = resolveCameraIntent(); mIconState.isVisible = !isCameraDisabledByDpm() && resolved != null boolean isCameraDisabled = (mStatusBar != null) && !mStatusBar.isCameraAllowedByAdmin(); mIconState.isVisible = !isCameraDisabled && resolved != null && getResources().getBoolean(R.bool.config_keyguardShowCameraAffordance) && mUserSetupComplete; mIconState.drawable = mContext.getDrawable(R.drawable.ic_camera_alt_24dp); Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java +6 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ import android.graphics.Color; import android.graphics.Paint; import android.graphics.Rect; import android.util.AttributeSet; import android.util.EventLog; import android.util.FloatProperty; import android.util.MathUtils; import android.view.MotionEvent; Loading Loading @@ -2440,6 +2441,11 @@ public class NotificationPanelView extends PanelView implements * @param keyguardIsShowing whether keyguard is being shown */ public boolean canCameraGestureBeLaunched(boolean keyguardIsShowing) { if (!mStatusBar.isCameraAllowedByAdmin()) { EventLog.writeEvent(0x534e4554, "63787722", -1, ""); return false; } ResolveInfo resolveInfo = mKeyguardBottomArea.resolveCameraIntent(); String packageToLaunch = (resolveInfo == null || resolveInfo.activityInfo == null) ? null : resolveInfo.activityInfo.packageName; Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java +16 −2 Original line number Diff line number Diff line /* * Copyright (C) 2010 The Android Open Source Project * Loading Loading @@ -5040,6 +5038,18 @@ public class StatusBar extends SystemUI implements DemoMode, } } boolean isCameraAllowedByAdmin() { if (mDevicePolicyManager.getCameraDisabled(null, mCurrentUserId)) { return false; } else if (isKeyguardShowing() && isKeyguardSecure()) { // Check if the admin has disabled the camera specifically for the keyguard return (mDevicePolicyManager.getKeyguardDisabledFeatures(null, mCurrentUserId) & DevicePolicyManager.KEYGUARD_DISABLE_SECURE_CAMERA) == 0; } return true; } public void notifyFpAuthModeChanged() { updateDozing(); } Loading @@ -5062,6 +5072,10 @@ public class StatusBar extends SystemUI implements DemoMode, } public boolean isKeyguardShowing() { if (mStatusBarKeyguardViewManager == null) { Slog.i(TAG, "isKeyguardShowing() called before startKeyguard(), returning true"); return true; } return mStatusBarKeyguardViewManager.isShowing(); } Loading