Merge "Allow multiuser use of keystore"
This commit is contained in:
@@ -25,7 +25,6 @@ import android.content.res.Resources;
|
|||||||
import android.os.AsyncTask;
|
import android.os.AsyncTask;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.RemoteException;
|
import android.os.RemoteException;
|
||||||
import android.os.UserHandle;
|
|
||||||
import android.security.Credentials;
|
import android.security.Credentials;
|
||||||
import android.security.KeyChain.KeyChainConnection;
|
import android.security.KeyChain.KeyChainConnection;
|
||||||
import android.security.KeyChain;
|
import android.security.KeyChain;
|
||||||
@@ -109,12 +108,6 @@ public final class CredentialStorage extends Activity {
|
|||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
super.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();
|
Intent intent = getIntent();
|
||||||
String action = intent.getAction();
|
String action = intent.getAction();
|
||||||
|
|
||||||
|
@@ -231,21 +231,18 @@ public class SecuritySettings extends SettingsPreferenceFragment
|
|||||||
// Show password
|
// Show password
|
||||||
mShowPassword = (CheckBoxPreference) root.findPreference(KEY_SHOW_PASSWORD);
|
mShowPassword = (CheckBoxPreference) root.findPreference(KEY_SHOW_PASSWORD);
|
||||||
|
|
||||||
// Credential storage, only for primary user
|
// Credential storage
|
||||||
if (mIsPrimary) {
|
mKeyStore = KeyStore.getInstance();
|
||||||
mKeyStore = KeyStore.getInstance();
|
Preference credentialStorageType = root.findPreference(KEY_CREDENTIAL_STORAGE_TYPE);
|
||||||
Preference credentialStorageType = root.findPreference(KEY_CREDENTIAL_STORAGE_TYPE);
|
|
||||||
|
|
||||||
final int storageSummaryRes =
|
final int storageSummaryRes =
|
||||||
mKeyStore.isHardwareBacked() ? R.string.credential_storage_type_hardware
|
mKeyStore.isHardwareBacked() ? R.string.credential_storage_type_hardware
|
||||||
: R.string.credential_storage_type_software;
|
: R.string.credential_storage_type_software;
|
||||||
credentialStorageType.setSummary(storageSummaryRes);
|
credentialStorageType.setSummary(storageSummaryRes);
|
||||||
|
|
||||||
mResetCredentials = root.findPreference(KEY_RESET_CREDENTIALS);
|
mResetCredentials = root.findPreference(KEY_RESET_CREDENTIALS);
|
||||||
} else {
|
|
||||||
removePreference(KEY_CREDENTIALS_MANAGER);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
// Application install
|
||||||
mToggleAppInstallation = (CheckBoxPreference) findPreference(
|
mToggleAppInstallation = (CheckBoxPreference) findPreference(
|
||||||
KEY_TOGGLE_INSTALL_APPLICATIONS);
|
KEY_TOGGLE_INSTALL_APPLICATIONS);
|
||||||
mToggleAppInstallation.setChecked(isNonMarketAppsAllowed());
|
mToggleAppInstallation.setChecked(isNonMarketAppsAllowed());
|
||||||
|
Reference in New Issue
Block a user