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: I7762dd647bede8abc9be2c538af3a3a99a25a73e
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user