diff options
author | DvTonder <david.vantonder@gmail.com> | 2012-11-28 22:22:42 -0500 |
---|---|---|
committer | DvTonder <david.vantonder@gmail.com> | 2012-11-28 22:27:47 -0500 |
commit | a97412e49a388e7b1e61d4c05755f368b07b7902 (patch) | |
tree | 691bed8e1d40584edb339b82986f418a71a53d0f /policy | |
parent | 38328494183e2a9296056c53c71ec67c46e43619 (diff) | |
download | frameworks_base-a97412e49a388e7b1e61d4c05755f368b07b7902.zip frameworks_base-a97412e49a388e7b1e61d4c05755f368b07b7902.tar.gz frameworks_base-a97412e49a388e7b1e61d4c05755f368b07b7902.tar.bz2 |
Framework: Restore Keyguard-obsolete to AOSP state
Some of the CM features code got merged into the obsolete keyguard
code, revert to pure AOSP state.
Change-Id: I6980f9254b49cf1208dd1536f625951d804445ae
Diffstat (limited to 'policy')
2 files changed, 18 insertions, 72 deletions
diff --git a/policy/src/com/android/internal/policy/impl/keyguard_obsolete/KeyguardStatusViewManager.java b/policy/src/com/android/internal/policy/impl/keyguard_obsolete/KeyguardStatusViewManager.java index a210fa7..b6ffde0 100644 --- a/policy/src/com/android/internal/policy/impl/keyguard_obsolete/KeyguardStatusViewManager.java +++ b/policy/src/com/android/internal/policy/impl/keyguard_obsolete/KeyguardStatusViewManager.java @@ -1,6 +1,5 @@ /* * Copyright (C) 2011 The Android Open Source Project - * Copyright (C) 2012 The CyanogenMod Project (Weather, Calendar) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,17 +16,6 @@ package com.android.internal.policy.impl.keyguard_obsolete; -import android.content.ContentResolver; -import android.content.Context; -import android.provider.Settings; -import android.text.TextUtils; -import android.text.format.DateFormat; -import android.util.Log; -import android.view.View; -import android.view.View.OnClickListener; -import android.widget.Button; -import android.widget.TextView; - import com.android.internal.R; import com.android.internal.telephony.IccCardConstants; import com.android.internal.widget.DigitalClock; @@ -39,6 +27,17 @@ import java.util.Date; import libcore.util.MutableInt; +import android.content.ContentResolver; +import android.content.Context; +import android.provider.Settings; +import android.text.TextUtils; +import android.text.format.DateFormat; +import android.util.Log; +import android.view.View; +import android.view.View.OnClickListener; +import android.widget.Button; +import android.widget.TextView; + /*** * Manages a number of views inside of LockScreen layouts. See below for a list of widgets * @@ -216,22 +215,6 @@ class KeyguardStatusViewManager implements OnClickListener { } } - /** - * Split the MultiSelectListPreference string based on a separator of ',' and - * stripping off the start [ and the end ] - * @param val - * @return - */ - private static String[] parseStoredValue(String val) { - if (val == null || val.isEmpty()) - return null; - else { - // Strip off the start [ and the end ] before splitting - val = val.substring(1, val.length() -1); - return (val.split(",")); - } - } - private boolean inWidgetMode() { return mTransportView != null && mTransportView.getVisibility() == View.VISIBLE; } diff --git a/policy/src/com/android/internal/policy/impl/keyguard_obsolete/KeyguardViewMediator.java b/policy/src/com/android/internal/policy/impl/keyguard_obsolete/KeyguardViewMediator.java index bf43199..3de1428 100644 --- a/policy/src/com/android/internal/policy/impl/keyguard_obsolete/KeyguardViewMediator.java +++ b/policy/src/com/android/internal/policy/impl/keyguard_obsolete/KeyguardViewMediator.java @@ -25,8 +25,6 @@ import com.android.internal.widget.LockPatternUtils; 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; @@ -250,8 +248,6 @@ public class KeyguardViewMediator implements KeyguardViewCallback { private int mUnlockSoundId; private int mLockSoundStreamId; - private ProfileManager mProfileManager; - /** * The volume applied to the lock/unlock sounds. */ @@ -373,7 +369,6 @@ public class KeyguardViewMediator implements KeyguardViewCallback { mWakeAndHandOff.setReferenceCounted(false); mContext.registerReceiver(mBroadcastReceiver, new IntentFilter(DELAYED_KEYGUARD_ACTION)); - mProfileManager = (ProfileManager) context.getSystemService(Context.PROFILE_SERVICE); mAlarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE); @@ -439,21 +434,11 @@ public class KeyguardViewMediator implements KeyguardViewCallback { mScreenOn = false; if (DEBUG) Log.d(TAG, "onScreenTurnedOff(" + why + ")"); - // Prepare for handling Lock/Slide lock delay and timeout - boolean lockImmediately = false; - final ContentResolver cr = mContext.getContentResolver(); - boolean separateSlideLockTimeoutEnabled = Settings.System.getInt(cr, - Settings.System.SCREEN_LOCK_SLIDE_DELAY_TOGGLE, 0) == 1; - if (mLockPatternUtils.isSecure()) { - // Lock immediately based on setting if secure (user has a pin/pattern/password) - // This is retained as-is to ensue AOSP security integrity is maintained - lockImmediately = mLockPatternUtils.getPowerButtonInstantlyLocks(); - } else { - // Unless a separate slide lock timeout is enabled, this "locks" the device when - // not secure to provide easy access to the camera while preventing unwanted input - lockImmediately = separateSlideLockTimeoutEnabled ? false - : mLockPatternUtils.getPowerButtonInstantlyLocks(); - } + // Lock immediately based on setting if secure (user has a pin/pattern/password). + // This also "locks" the device when not secure to provide easy access to the + // camera while preventing unwanted input. + final boolean lockImmediately = + mLockPatternUtils.getPowerButtonInstantlyLocks() || !mLockPatternUtils.isSecure(); if (mExitSecureCallback != null) { if (DEBUG) Log.d(TAG, "pending exit secure callback cancelled"); @@ -472,6 +457,7 @@ public class KeyguardViewMediator implements KeyguardViewCallback { // to enable it a little bit later (i.e, give the user a chance // to turn the screen back on within a certain window without // having to unlock the screen) + final ContentResolver cr = mContext.getContentResolver(); // From DisplaySettings long displayTimeout = Settings.System.getInt(cr, SCREEN_OFF_TIMEOUT, @@ -482,33 +468,17 @@ public class KeyguardViewMediator implements KeyguardViewCallback { Settings.Secure.LOCK_SCREEN_LOCK_AFTER_TIMEOUT, KEYGUARD_LOCK_AFTER_DELAY_DEFAULT); - // From CyanogenMod specific Settings - int slideLockTimeoutDelay = (why == WindowManagerPolicy.OFF_BECAUSE_OF_TIMEOUT ? Settings.System - .getInt(cr, Settings.System.SCREEN_LOCK_SLIDE_TIMEOUT_DELAY, - KEYGUARD_LOCK_AFTER_DELAY_DEFAULT) : Settings.System.getInt(cr, - Settings.System.SCREEN_LOCK_SLIDE_SCREENOFF_DELAY, 0)); - // From DevicePolicyAdmin final long policyTimeout = mLockPatternUtils.getDevicePolicyManager() .getMaximumTimeToLock(null); - if (DEBUG) Log.d(TAG, "Security lock screen timeout delay is " + lockAfterTimeout - + " ms; slide lock screen timeout delay is " - + slideLockTimeoutDelay - + " ms; Separate slide lock delay settings considered: " - + separateSlideLockTimeoutEnabled - + "; Policy timeout is " - + policyTimeout - + " ms"); - long timeout; if (policyTimeout > 0) { // policy in effect. Make sure we don't go beyond policy limit. displayTimeout = Math.max(displayTimeout, 0); // ignore negative values timeout = Math.min(policyTimeout - displayTimeout, lockAfterTimeout); } else { - // Not sure lockAfterTimeout is needed any more but keeping it for AOSP compatibility - timeout = separateSlideLockTimeoutEnabled ? slideLockTimeoutDelay : lockAfterTimeout; + timeout = lockAfterTimeout; } if (timeout <= 0) { @@ -738,13 +708,6 @@ public class KeyguardViewMediator implements KeyguardViewCallback { return; } - // if the current profile has disabled us, don't show - if (!lockedOrMissing - && mProfileManager.getActiveProfile().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(); } |