diff options
author | Dan Sandler <dsandler@android.com> | 2015-03-06 00:39:10 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-03-06 00:39:10 +0000 |
commit | 1c20d3cf3fe55ebfeb2c4f5cfaff47ed1112e7aa (patch) | |
tree | 9dbda8745408b509e7582ee474160e993946b16b /packages | |
parent | 9488813873735174d762615ea8a78cf60c21c10f (diff) | |
parent | eef3fbcf6825a5e5e0cb150123d9bc87956fbb23 (diff) | |
download | frameworks_base-1c20d3cf3fe55ebfeb2c4f5cfaff47ed1112e7aa.zip frameworks_base-1c20d3cf3fe55ebfeb2c4f5cfaff47ed1112e7aa.tar.gz frameworks_base-1c20d3cf3fe55ebfeb2c4f5cfaff47ed1112e7aa.tar.bz2 |
am eef3fbcf: am 8deb6d95: am e6a4b445: am 3581f4c9: Merge "Avoid crashing on startup when policy forbids lockscreen camera." into lmp-mr1-dev
* commit 'eef3fbcf6825a5e5e0cb150123d9bc87956fbb23':
Avoid crashing on startup when policy forbids lockscreen camera.
Diffstat (limited to 'packages')
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java | 9 | ||||
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java | 7 |
2 files changed, 15 insertions, 1 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java index 3a812cc..37d9a73 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java @@ -59,6 +59,7 @@ import android.service.notification.NotificationListenerService.RankingMap; import android.service.notification.StatusBarNotification; import android.text.TextUtils; import android.util.Log; +import android.util.Slog; import android.util.SparseArray; import android.util.SparseBooleanArray; import android.view.Display; @@ -2150,6 +2151,14 @@ public abstract class BaseStatusBar extends SystemUI implements } public boolean isKeyguardSecure() { + if (mStatusBarKeyguardViewManager == null) { + // startKeyguard() hasn't been called yet, so we don't know. + // Make sure anything that needs to know isKeyguardSecure() checks and re-checks this + // value onVisibilityChanged(). + Slog.w(TAG, "isKeyguardSecure() called before startKeyguard(), returning false", + new Throwable()); + return false; + } return mStatusBarKeyguardViewManager.isSecure(); } } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java index acf7af9..0c21b20 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java @@ -220,6 +220,7 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL public void setPhoneStatusBar(PhoneStatusBar phoneStatusBar) { mPhoneStatusBar = phoneStatusBar; + updateCameraVisibility(); // in case onFinishInflate() was called too early } private Intent getCameraIntent() { @@ -231,6 +232,10 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL } private void updateCameraVisibility() { + if (mCameraImageView == null) { + // Things are not set up yet; reply hazy, ask again later + return; + } ResolveInfo resolved = mContext.getPackageManager().resolveActivityAsUser(getCameraIntent(), PackageManager.MATCH_DEFAULT_ONLY, mLockPatternUtils.getCurrentUser()); @@ -253,7 +258,7 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL private boolean isCameraDisabledByDpm() { final DevicePolicyManager dpm = (DevicePolicyManager) getContext().getSystemService(Context.DEVICE_POLICY_SERVICE); - if (dpm != null) { + if (dpm != null && mPhoneStatusBar != null) { try { final int userId = ActivityManagerNative.getDefault().getCurrentUser().id; final int disabledFlags = dpm.getKeyguardDisabledFeatures(null, userId); |