summaryrefslogtreecommitdiff
path: root/keystore/java/android/security/KeyStore.java
diff options
context:
space:
mode:
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 4f4ca3f47009..0a4ac8cc5fec 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());
}
@@ -197,6 +205,7 @@ public class KeyStore {
return get(key, uid, false);
}
+ @UnsupportedAppUsage
public byte[] get(String key) {
return get(key, UID_SELF);
}
@@ -247,6 +256,7 @@ public class KeyStore {
}
}
+ @UnsupportedAppUsage
public boolean delete(String key) {
return delete(key, UID_SELF);
}
@@ -283,6 +293,7 @@ public class KeyStore {
return list(prefix, UID_SELF);
}
+ @UnsupportedAppUsage
public boolean reset() {
try {
return mBinder.reset() == NO_ERROR;
@@ -333,6 +344,7 @@ public class KeyStore {
}
}
+ @UnsupportedAppUsage
public boolean unlock(String password) {
return unlock(UserHandle.getUserId(Process.myUid()), password);
}
@@ -349,6 +361,7 @@ public class KeyStore {
}
}
+ @UnsupportedAppUsage
public boolean isEmpty() {
return isEmpty(UserHandle.myUserId());
}
@@ -818,6 +831,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