Fixes for pin-restricted settings.

- Reprompt for pin after screen has been locked and unlocked.
- For protected preferences, store the Preference and continue if pin entry is successful.
- Protect whole UserSettings and DevelopmentSettings pages.

Bug: 10543207
Change-Id: If1d4b31ca94a8cfc103625b74385bcd0bdd3d88b
This commit is contained in:
Maggie Benthall
2013-08-29 10:49:13 -04:00
parent 02f3f2028f
commit 4453496448
3 changed files with 76 additions and 28 deletions

View File

@@ -74,7 +74,6 @@ import java.io.File;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Locale;
/*
* Displays preferences for application developers.
@@ -224,7 +223,7 @@ public class DevelopmentSettings extends RestrictedSettingsFragment
private boolean mUnavailable;
public DevelopmentSettings() {
super(null /* Don't ask for restrictions pin on creation. */);
super(RESTRICTIONS_PIN_SET);
}
@Override
@@ -276,13 +275,6 @@ public class DevelopmentSettings extends RestrictedSettingsFragment
disableForUser(mPassword);
}
if (shouldBePinProtected(RESTRICTIONS_PIN_SET)) {
protectByRestrictions(mEnableAdb);
protectByRestrictions(mClearAdbKeys);
protectByRestrictions(mEnableTerminal);
protectByRestrictions(mPassword);
}
mDebugAppPref = findPreference(DEBUG_APP_KEY);
mAllPrefs.add(mDebugAppPref);
mWaitForDebugger = findAndInitCheckboxPref(WAIT_FOR_DEBUGGER_KEY);
@@ -1212,9 +1204,6 @@ public class DevelopmentSettings extends RestrictedSettingsFragment
@Override
public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, Preference preference) {
if (super.onPreferenceTreeClick(preferenceScreen, preference)) {
return true;
}
if (Utils.isMonkeyRunning()) {
return false;
}