summaryrefslogtreecommitdiff
path: root/keystore/java/android/security/KeyStore.java
diff options
context:
space:
mode:
authorMathew Inwood <mathewi@google.com>2018-08-16 18:49:37 +0100
committerMathew Inwood <mathewi@google.com>2018-08-16 18:49:37 +0100
commit4dbdcf43ad0dfa91371ac06517317e0ea0b45b56 (patch)
treebf224c82a42e0228aae034faba6fae5f947394a7 /keystore/java/android/security/KeyStore.java
parent43f3f60ec01a1d658cbff9386a7fbf8a839894b9 (diff)
Add @UnsupportedAppUsage annotations
For packages: android.security.net.config android.security.keystore android.security.keymaster android.security This is an automatically generated CL. See go/UnsupportedAppUsage for more details. Exempted-From-Owner-Approval: Mechanical changes to the codebase which have been approved by Android API council and announced on android-eng@ Bug: 110868826 Test: m Change-Id: Ifed4da56531195f64fd53d84f14b4e8298843b2c Merged-In: I7762dd647bede8abc9be2c538af3a3a99a25a73e
Diffstat (limited to 'keystore/java/android/security/KeyStore.java')
-rw-r--r--keystore/java/android/security/KeyStore.java14
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