diff options
author | Julia Reynolds <juliacr@google.com> | 2014-06-30 14:09:53 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-06-26 18:35:29 +0000 |
commit | 7a5d7d9ea60321a60bea5bf59ebd24cb977b6a01 (patch) | |
tree | be610a98da58f8737a72273b6a0c4f15a5996c26 | |
parent | 1eb3f316bd20c5d3e816876229c05bcf9f0c712c (diff) | |
parent | 233ccd0cf798de779628984441f48c239fe86921 (diff) | |
download | packages_apps_Settings-7a5d7d9ea60321a60bea5bf59ebd24cb977b6a01.zip packages_apps_Settings-7a5d7d9ea60321a60bea5bf59ebd24cb977b6a01.tar.gz packages_apps_Settings-7a5d7d9ea60321a60bea5bf59ebd24cb977b6a01.tar.bz2 |
Merge "Credentials should be shown but can't be modified."
-rw-r--r-- | src/com/android/settings/SecuritySettings.java | 10 | ||||
-rw-r--r-- | src/com/android/settings/TrustedCredentialsSettings.java | 51 |
2 files changed, 10 insertions, 51 deletions
diff --git a/src/com/android/settings/SecuritySettings.java b/src/com/android/settings/SecuritySettings.java index fd8bfaf..33ad170 100644 --- a/src/com/android/settings/SecuritySettings.java +++ b/src/com/android/settings/SecuritySettings.java @@ -85,7 +85,7 @@ public class SecuritySettings extends SettingsPreferenceFragment private static final String KEY_SIM_LOCK = "sim_lock"; private static final String KEY_SHOW_PASSWORD = "show_password"; private static final String KEY_CREDENTIAL_STORAGE_TYPE = "credential_storage_type"; - private static final String KEY_RESET_CREDENTIALS = "reset_credentials"; + private static final String KEY_RESET_CREDENTIALS = "credentials_reset"; private static final String KEY_CREDENTIALS_INSTALL = "credentials_install"; private static final String KEY_TOGGLE_INSTALL_APPLICATIONS = "toggle_install_applications"; private static final String KEY_TOGGLE_VERIFY_APPLICATIONS = "toggle_verify_applications"; @@ -267,10 +267,12 @@ public class SecuritySettings extends SettingsPreferenceFragment mKeyStore.isHardwareBacked() ? R.string.credential_storage_type_hardware : R.string.credential_storage_type_software; credentialStorageType.setSummary(storageSummaryRes); - } else { - removePreference(KEY_CREDENTIALS_MANAGER); - removePreference(KEY_CREDENTIALS_INSTALL); + PreferenceGroup credentialsManager = (PreferenceGroup) + root.findPreference(KEY_CREDENTIALS_MANAGER); + credentialsManager.removePreference(root.findPreference(KEY_RESET_CREDENTIALS)); + credentialsManager.removePreference(root.findPreference(KEY_CREDENTIALS_INSTALL)); + credentialsManager.removePreference(root.findPreference(KEY_CREDENTIAL_STORAGE_TYPE)); } // Application install diff --git a/src/com/android/settings/TrustedCredentialsSettings.java b/src/com/android/settings/TrustedCredentialsSettings.java index eb7b142..98d1a53 100644 --- a/src/com/android/settings/TrustedCredentialsSettings.java +++ b/src/com/android/settings/TrustedCredentialsSettings.java @@ -66,12 +66,6 @@ public class TrustedCredentialsSettings extends Fragment { private static final String USER_ACTION = "com.android.settings.TRUSTED_CREDENTIALS_USER"; - private static final int REQUEST_PIN_CHALLENGE = 12309; - // If the restriction PIN is entered correctly. - private boolean mChallengeSucceeded; - private boolean mChallengeRequested; - - private enum Tab { SYSTEM("system", R.string.trusted_credentials_system_tab, @@ -171,10 +165,6 @@ public class TrustedCredentialsSettings extends Fragment { @Override public View onCreateView( LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) { - if (mUserManager.hasUserRestriction(UserManager.DISALLOW_CONFIG_CREDENTIALS)) { - return inflater.inflate(R.layout.credentials_disallowed_preference_screen, - parent, false); - } mTabHost = (TabHost) inflater.inflate(R.layout.trusted_credentials, parent, false); mTabHost.setup(); addTab(Tab.SYSTEM); @@ -413,21 +403,17 @@ public class TrustedCredentialsSettings extends Fragment { }); final Dialog certDialog = builder.create(); - View view = views.get(0); - ViewGroup body = (ViewGroup) view.findViewById(com.android.internal.R.id.body); + ViewGroup body = (ViewGroup) container.findViewById(com.android.internal.R.id.body); LayoutInflater inflater = LayoutInflater.from(getActivity()); Button removeButton = (Button) inflater.inflate(R.layout.trusted_credential_details, body, false); - body.addView(removeButton); + if (!mUserManager.hasUserRestriction(UserManager.DISALLOW_CONFIG_CREDENTIALS)) { + body.addView(removeButton); + } removeButton.setText(certHolder.mTab.getButtonLabel(certHolder)); removeButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { - if (mUserManager.hasRestrictionsChallenge() && !mChallengeSucceeded) { - ensurePin(); - return; - } - AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); builder.setMessage(certHolder.mTab.getButtonConfirmation(certHolder)); builder.setPositiveButton( @@ -473,35 +459,6 @@ public class TrustedCredentialsSettings extends Fragment { titles.add(sslCert.getIssuedTo().getCName()); } - @Override - public void onActivityResult(int requestCode, int resultCode, Intent data) { - if (requestCode == REQUEST_PIN_CHALLENGE) { - mChallengeRequested = false; - if (resultCode == Activity.RESULT_OK) { - mChallengeSucceeded = true; - } - return; - } - - super.onActivityResult(requestCode, resultCode, data); - } - - private void ensurePin() { - if (!mChallengeSucceeded) { - final UserManager um = UserManager.get(getActivity()); - if (!mChallengeRequested) { - if (um.hasRestrictionsChallenge()) { - Intent requestPin = - new Intent(Intent.ACTION_RESTRICTIONS_CHALLENGE); - startActivityForResult(requestPin, REQUEST_PIN_CHALLENGE); - mChallengeRequested = true; - } - } - } - mChallengeSucceeded = false; - } - - private class AliasOperation extends AsyncTask<Void, Void, Boolean> { private final CertHolder mCertHolder; private AliasOperation(CertHolder certHolder) { |