diff options
author | dcashman <dcashman@google.com> | 2014-08-14 09:54:51 -0700 |
---|---|---|
committer | dcashman <dcashman@google.com> | 2014-08-14 22:13:24 -0700 |
commit | c6f22499f3046684d7175e10ca42cce1492cd36f (patch) | |
tree | 64ae9686ff5c0a99576d996d90834218558ddcbb /core/java/android/app/ApplicationPackageManager.java | |
parent | 14690b0aa380697179eb0432939a8ce96e6561f0 (diff) | |
download | frameworks_base-c6f22499f3046684d7175e10ca42cce1492cd36f.zip frameworks_base-c6f22499f3046684d7175e10ca42cce1492cd36f.tar.gz frameworks_base-c6f22499f3046684d7175e10ca42cce1492cd36f.tar.bz2 |
Address KeySet API Review
Hide KeySet API. Change getKeySetByAlias to not require aliases from the calling
package. Make KeySet parcelable. Add hashCode method.
Bug: 16895228
Bug: 17009318
Change-Id: I75951947dfc7a3cca9f8873bda72576d11abaaf0
Diffstat (limited to 'core/java/android/app/ApplicationPackageManager.java')
-rw-r--r-- | core/java/android/app/ApplicationPackageManager.java | 29 |
1 files changed, 12 insertions, 17 deletions
diff --git a/core/java/android/app/ApplicationPackageManager.java b/core/java/android/app/ApplicationPackageManager.java index a935dc0..c55b894 100644 --- a/core/java/android/app/ApplicationPackageManager.java +++ b/core/java/android/app/ApplicationPackageManager.java @@ -1494,57 +1494,52 @@ final class ApplicationPackageManager extends PackageManager { return false; } + /** @hide */ @Override public KeySet getKeySetByAlias(String packageName, String alias) { Preconditions.checkNotNull(packageName); Preconditions.checkNotNull(alias); - IBinder keySetToken; + KeySet ks; try { - keySetToken = mPM.getKeySetByAlias(packageName, alias); + ks = mPM.getKeySetByAlias(packageName, alias); } catch (RemoteException e) { return null; } - if (keySetToken == null) { - return null; - } - return new KeySet(keySetToken); + return ks; } + /** @hide */ @Override public KeySet getSigningKeySet(String packageName) { Preconditions.checkNotNull(packageName); - IBinder keySetToken; + KeySet ks; try { - keySetToken = mPM.getSigningKeySet(packageName); + ks = mPM.getSigningKeySet(packageName); } catch (RemoteException e) { return null; } - if (keySetToken == null) { - return null; - } - return new KeySet(keySetToken); + return ks; } - + /** @hide */ @Override public boolean isSignedBy(String packageName, KeySet ks) { Preconditions.checkNotNull(packageName); Preconditions.checkNotNull(ks); - IBinder keySetToken = ks.getToken(); try { - return mPM.isPackageSignedByKeySet(packageName, keySetToken); + return mPM.isPackageSignedByKeySet(packageName, ks); } catch (RemoteException e) { return false; } } + /** @hide */ @Override public boolean isSignedByExactly(String packageName, KeySet ks) { Preconditions.checkNotNull(packageName); Preconditions.checkNotNull(ks); - IBinder keySetToken = ks.getToken(); try { - return mPM.isPackageSignedByKeySetExactly(packageName, keySetToken); + return mPM.isPackageSignedByKeySetExactly(packageName, ks); } catch (RemoteException e) { return false; } |