diff options
| -rw-r--r-- | policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewMediator.java | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewMediator.java b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewMediator.java index df4c661..92df7c7 100644 --- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewMediator.java +++ b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewMediator.java @@ -22,6 +22,8 @@ import android.app.Activity; import android.app.ActivityManagerNative; import android.app.AlarmManager; import android.app.PendingIntent; +import android.app.Profile; +import android.app.ProfileManager; import android.app.StatusBarManager; import android.content.BroadcastReceiver; import android.content.ContentResolver; @@ -243,6 +245,8 @@ public class KeyguardViewMediator { private int mUnlockSoundId; private int mLockSoundStreamId; + private ProfileManager mProfileManager; + /** * The volume applied to the lock/unlock sounds. */ @@ -494,6 +498,8 @@ public class KeyguardViewMediator { mKeyguardViewManager = new KeyguardViewManager(context, wm, mViewMediatorCallback, mLockPatternUtils); + mProfileManager = (ProfileManager) context.getSystemService(Context.PROFILE_SERVICE); + mUserPresentIntent = new Intent(Intent.ACTION_USER_PRESENT); mUserPresentIntent.addFlags(Intent.FLAG_RECEIVER_REPLACE_PENDING | Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT); @@ -887,6 +893,16 @@ public class KeyguardViewMediator { return; } + // if the current profile has disabled us, don't show + Profile profile = mProfileManager.getActiveProfile(); + if (profile != null) { + if (!lockedOrMissing + && profile.getScreenLockMode() == Profile.LockMode.DISABLE) { + if (DEBUG) Log.d(TAG, "doKeyguard: not showing because of profile override"); + return; + } + } + if (DEBUG) Log.d(TAG, "doKeyguard: showing the lock screen"); showLocked(options); } |
