summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Becca Hughes <beccahughes@google.com> 2023-03-22 22:11:27 +0000
committer Becca Hughes <beccahughes@google.com> 2023-03-24 21:10:16 +0000
commit66e89d3e89bc3eb2511c58d5378e94b56042466f (patch)
tree9c84e441f8898028262abbaf25674039935e2e8b
parent26b284138c013247ef77ac0446459e69dfb29031 (diff)
Remove deprected capability API
As per request of API council remove this API. Test: CTS & make Bug: 274510418 Merged-In: I65b7a24ed0170233dd6f3cc85961d5b61de2f42d Change-Id: I65b7a24ed0170233dd6f3cc85961d5b61de2f42d
-rw-r--r--core/api/current.txt1
-rw-r--r--core/java/android/service/credentials/CredentialProviderInfoFactory.java40
-rw-r--r--core/java/android/service/credentials/CredentialProviderService.java8
3 files changed, 0 insertions, 49 deletions
diff --git a/core/api/current.txt b/core/api/current.txt
index b91144b3a045..3d771c0d5e27 100644
--- a/core/api/current.txt
+++ b/core/api/current.txt
@@ -40732,7 +40732,6 @@ package android.service.credentials {
method public abstract void onBeginGetCredential(@NonNull android.service.credentials.BeginGetCredentialRequest, @NonNull android.os.CancellationSignal, @NonNull android.os.OutcomeReceiver<android.service.credentials.BeginGetCredentialResponse,android.credentials.GetCredentialException>);
method @NonNull public final android.os.IBinder onBind(@NonNull android.content.Intent);
method public abstract void onClearCredentialState(@NonNull android.service.credentials.ClearCredentialStateRequest, @NonNull android.os.CancellationSignal, @NonNull android.os.OutcomeReceiver<java.lang.Void,android.credentials.ClearCredentialStateException>);
- field @Deprecated public static final String CAPABILITY_META_DATA_KEY = "android.credentials.capabilities";
field public static final String EXTRA_BEGIN_GET_CREDENTIAL_REQUEST = "android.service.credentials.extra.BEGIN_GET_CREDENTIAL_REQUEST";
field public static final String EXTRA_BEGIN_GET_CREDENTIAL_RESPONSE = "android.service.credentials.extra.BEGIN_GET_CREDENTIAL_RESPONSE";
field public static final String EXTRA_CREATE_CREDENTIAL_EXCEPTION = "android.service.credentials.extra.CREATE_CREDENTIAL_EXCEPTION";
diff --git a/core/java/android/service/credentials/CredentialProviderInfoFactory.java b/core/java/android/service/credentials/CredentialProviderInfoFactory.java
index 8069414c3e6e..b9249a5e50e4 100644
--- a/core/java/android/service/credentials/CredentialProviderInfoFactory.java
+++ b/core/java/android/service/credentials/CredentialProviderInfoFactory.java
@@ -240,14 +240,6 @@ public final class CredentialProviderInfoFactory {
Log.e(TAG, "Failed to get XML metadata", e);
}
- // 5. Extract the legacy metadata.
- try {
- builder.addCapabilities(
- populateLegacyProviderCapabilities(resources, metadata, serviceInfo));
- } catch (Exception e) {
- Log.e(TAG, "Failed to get legacy metadata ", e);
- }
-
return builder;
}
@@ -341,38 +333,6 @@ public final class CredentialProviderInfoFactory {
return capabilities;
}
- private static Set<String> populateLegacyProviderCapabilities(
- Resources resources, Bundle metadata, ServiceInfo serviceInfo) {
- Set<String> output = new HashSet<>();
- Set<String> capabilities = new HashSet<>();
-
- try {
- String[] discovered =
- resources.getStringArray(
- metadata.getInt(CredentialProviderService.CAPABILITY_META_DATA_KEY));
- if (discovered != null) {
- capabilities.addAll(Arrays.asList(discovered));
- }
- } catch (Resources.NotFoundException | NullPointerException e) {
- Log.e(TAG, "Failed to get capabilities: ", e);
- }
-
- if (capabilities.size() == 0) {
- Log.e(TAG, "No capabilities found for provider:" + serviceInfo);
- return output;
- }
-
- for (String capability : capabilities) {
- if (capability == null || capability.isEmpty()) {
- Log.w(TAG, "Skipping empty/null capability");
- continue;
- }
- Log.i(TAG, "Capabilities found for provider: " + capability);
- output.add(capability);
- }
- return output;
- }
-
private static ServiceInfo getServiceInfoOrThrow(
@NonNull ComponentName serviceComponent, int userId)
throws PackageManager.NameNotFoundException {
diff --git a/core/java/android/service/credentials/CredentialProviderService.java b/core/java/android/service/credentials/CredentialProviderService.java
index 6824159706cd..b97760656059 100644
--- a/core/java/android/service/credentials/CredentialProviderService.java
+++ b/core/java/android/service/credentials/CredentialProviderService.java
@@ -156,14 +156,6 @@ public abstract class CredentialProviderService extends Service {
private static final String TAG = "CredProviderService";
- /**
- * The list of capabilities exposed by a credential provider.
- *
- * @deprecated Replaced with {@link android.service.credentials#SERVICE_META_DATA}
- */
- @Deprecated
- public static final String CAPABILITY_META_DATA_KEY = "android.credentials.capabilities";
-
/**
* Name under which a Credential Provider service component publishes information
* about itself. This meta-data must reference an XML resource containing