diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2018-08-17 07:46:52 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2018-08-17 07:46:52 +0000 |
commit | d9381f5e56f5d9b7ce10c72c50795dcb1c38a8a2 (patch) | |
tree | 154183925851a49b0914605e087ec033c24837c2 /keystore/java/android/security/KeyStore.java | |
parent | 2495ca3c29aebe72a66670909b2dc02fde3000f4 (diff) | |
parent | 4dbdcf43ad0dfa91371ac06517317e0ea0b45b56 (diff) |
Merge "Add @UnsupportedAppUsage annotations"
Diffstat (limited to 'keystore/java/android/security/KeyStore.java')
-rw-r--r-- | keystore/java/android/security/KeyStore.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/keystore/java/android/security/KeyStore.java b/keystore/java/android/security/KeyStore.java index 3ea1f2645af8..799900f3bd6a 100644 --- a/keystore/java/android/security/KeyStore.java +++ b/keystore/java/android/security/KeyStore.java @@ -16,6 +16,7 @@ package android.security; +import android.annotation.UnsupportedAppUsage; import android.app.ActivityManager; import android.app.ActivityThread; import android.app.Application; @@ -57,6 +58,7 @@ public class KeyStore { private static final String TAG = "KeyStore"; // ResponseCodes - see system/security/keystore/include/keystore/keystore.h + @UnsupportedAppUsage public static final int NO_ERROR = 1; public static final int LOCKED = 2; public static final int UNINITIALIZED = 3; @@ -129,7 +131,9 @@ public class KeyStore { // States public enum State { + @UnsupportedAppUsage UNLOCKED, + @UnsupportedAppUsage LOCKED, UNINITIALIZED }; @@ -146,6 +150,7 @@ public class KeyStore { mContext = getApplicationContext(); } + @UnsupportedAppUsage public static Context getApplicationContext() { Application application = ActivityThread.currentApplication(); if (application == null) { @@ -155,6 +160,7 @@ public class KeyStore { return application; } + @UnsupportedAppUsage public static KeyStore getInstance() { IKeystoreService keystore = IKeystoreService.Stub.asInterface(ServiceManager .getService("android.security.keystore")); @@ -168,6 +174,7 @@ public class KeyStore { return mToken; } + @UnsupportedAppUsage public State state(int userId) { final int ret; try { @@ -185,6 +192,7 @@ public class KeyStore { } } + @UnsupportedAppUsage public State state() { return state(UserHandle.myUserId()); } @@ -206,6 +214,7 @@ public class KeyStore { } } + @UnsupportedAppUsage public byte[] get(String key) { return get(key, UID_SELF); } @@ -236,6 +245,7 @@ public class KeyStore { } } + @UnsupportedAppUsage public boolean delete(String key) { return delete(key, UID_SELF); } @@ -272,6 +282,7 @@ public class KeyStore { return list(prefix, UID_SELF); } + @UnsupportedAppUsage public boolean reset() { try { return mBinder.reset() == NO_ERROR; @@ -322,6 +333,7 @@ public class KeyStore { } } + @UnsupportedAppUsage public boolean unlock(String password) { return unlock(UserHandle.getUserId(Process.myUid()), password); } @@ -338,6 +350,7 @@ public class KeyStore { } } + @UnsupportedAppUsage public boolean isEmpty() { return isEmpty(UserHandle.myUserId()); } @@ -807,6 +820,7 @@ public class KeyStore { * Returns a {@link KeyStoreException} corresponding to the provided keystore/keymaster error * code. */ + @UnsupportedAppUsage public static KeyStoreException getKeyStoreException(int errorCode) { if (errorCode > 0) { // KeyStore layer error |