diff options
author | Kenny Root <kroot@google.com> | 2013-03-28 14:32:50 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2013-03-28 14:32:50 -0700 |
commit | a86453096979d027d65390f657568c945fea1b3d (patch) | |
tree | e8d29b65aaa5c400662a07472a351130e73de1e0 /src | |
parent | 02e8ca3e9ad966bd523241aaa1eecf58865027a8 (diff) | |
parent | 0d52fc184defef46378e7ba095091c7bab1ee459 (diff) | |
download | packages_apps_Settings-a86453096979d027d65390f657568c945fea1b3d.zip packages_apps_Settings-a86453096979d027d65390f657568c945fea1b3d.tar.gz packages_apps_Settings-a86453096979d027d65390f657568c945fea1b3d.tar.bz2 |
am 0d52fc18: am 9dc478ec: Merge "Add ability to install credentials as other UID"
* commit '0d52fc184defef46378e7ba095091c7bab1ee459':
Add ability to install credentials as other UID
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/settings/CredentialStorage.java | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/com/android/settings/CredentialStorage.java b/src/com/android/settings/CredentialStorage.java index c737c7d..1444a73 100644 --- a/src/com/android/settings/CredentialStorage.java +++ b/src/com/android/settings/CredentialStorage.java @@ -197,12 +197,14 @@ public final class CredentialStorage extends Activity { Bundle bundle = mInstallBundle; mInstallBundle = null; + final int uid = bundle.getInt(Credentials.EXTRA_INSTALL_AS_UID, -1); + if (bundle.containsKey(Credentials.EXTRA_USER_PRIVATE_KEY_NAME)) { String key = bundle.getString(Credentials.EXTRA_USER_PRIVATE_KEY_NAME); byte[] value = bundle.getByteArray(Credentials.EXTRA_USER_PRIVATE_KEY_DATA); - if (!mKeyStore.importKey(key, value)) { - Log.e(TAG, "Failed to install " + key); + if (!mKeyStore.importKey(key, value, uid)) { + Log.e(TAG, "Failed to install " + key + " as user " + uid); return; } } @@ -211,8 +213,8 @@ public final class CredentialStorage extends Activity { String certName = bundle.getString(Credentials.EXTRA_USER_CERTIFICATE_NAME); byte[] certData = bundle.getByteArray(Credentials.EXTRA_USER_CERTIFICATE_DATA); - if (!mKeyStore.put(certName, certData)) { - Log.e(TAG, "Failed to install " + certName); + if (!mKeyStore.put(certName, certData, uid)) { + Log.e(TAG, "Failed to install " + certName + " as user " + uid); return; } } @@ -221,11 +223,10 @@ public final class CredentialStorage extends Activity { String caListName = bundle.getString(Credentials.EXTRA_CA_CERTIFICATES_NAME); byte[] caListData = bundle.getByteArray(Credentials.EXTRA_CA_CERTIFICATES_DATA); - if (!mKeyStore.put(caListName, caListData)) { - Log.e(TAG, "Failed to install " + caListName); + if (!mKeyStore.put(caListName, caListData, uid)) { + Log.e(TAG, "Failed to install " + caListName + " as user " + uid); return; } - } setResult(RESULT_OK); |