Fix in isServiceEnabled for credMan

Test: Built localy

Change-Id: I7dd1eb23e2b66929dc285c8a69e496efdea08e99
This commit is contained in:
Reema Bajwa
2022-12-19 20:09:11 +00:00
parent 392a8cb434
commit eddf6560fc

View File

@@ -270,9 +270,22 @@ public final class CredentialManager {
*
* @hide
*/
public static boolean isServiceEnabled() {
public static boolean isServiceEnabled(Context context) {
if (context == null) {
return false;
}
CredentialManager credentialManager =
(CredentialManager) context.getSystemService(Context.CREDENTIAL_SERVICE);
if (credentialManager != null) {
return credentialManager.isServiceEnabled();
}
return false;
}
private boolean isServiceEnabled() {
return DeviceConfig.getBoolean(
DeviceConfig.NAMESPACE_CREDENTIAL, DEVICE_CONFIG_ENABLE_CREDENTIAL_MANAGER, true);
DeviceConfig.NAMESPACE_CREDENTIAL, DEVICE_CONFIG_ENABLE_CREDENTIAL_MANAGER,
true);
}
private static class GetCredentialTransport extends IGetCredentialCallback.Stub {