import android.os.AsyncTask;
import android.os.Bundle;
import android.os.RemoteException;
-import android.os.UserHandle;
import android.security.Credentials;
import android.security.KeyChain.KeyChainConnection;
import android.security.KeyChain;
protected void onResume() {
super.onResume();
- if (UserHandle.myUserId() != UserHandle.USER_OWNER) {
- Log.i(TAG, "Cannot install to CredentialStorage as non-primary user");
- finish();
- return;
- }
-
Intent intent = getIntent();
String action = intent.getAction();
// Show password
mShowPassword = (CheckBoxPreference) root.findPreference(KEY_SHOW_PASSWORD);
- // Credential storage, only for primary user
- if (mIsPrimary) {
- mKeyStore = KeyStore.getInstance();
- Preference credentialStorageType = root.findPreference(KEY_CREDENTIAL_STORAGE_TYPE);
+ // Credential storage
+ mKeyStore = KeyStore.getInstance();
+ Preference credentialStorageType = root.findPreference(KEY_CREDENTIAL_STORAGE_TYPE);
- final int storageSummaryRes =
- mKeyStore.isHardwareBacked() ? R.string.credential_storage_type_hardware
- : R.string.credential_storage_type_software;
- credentialStorageType.setSummary(storageSummaryRes);
+ final int storageSummaryRes =
+ mKeyStore.isHardwareBacked() ? R.string.credential_storage_type_hardware
+ : R.string.credential_storage_type_software;
+ credentialStorageType.setSummary(storageSummaryRes);
- mResetCredentials = root.findPreference(KEY_RESET_CREDENTIALS);
- } else {
- removePreference(KEY_CREDENTIALS_MANAGER);
- }
+ mResetCredentials = root.findPreference(KEY_RESET_CREDENTIALS);
+ // Application install
PreferenceGroup deviceAdminCategory= (PreferenceGroup)
root.findPreference(KEY_DEVICE_ADMIN_CATEGORY);
mToggleAppInstallation = (CheckBoxPreference) findPreference(