Loading core/java/android/credentials/CredentialManager.java +3 −2 Original line number Diff line number Diff line Loading @@ -85,7 +85,7 @@ public final class CredentialManager { ICancellationSignal cancelRemote = null; try { cancelRemote = mService.executeGetCredential(request, new GetCredentialTransport(executor, callback)); new GetCredentialTransport(executor, callback), mContext.getOpPackageName()); } catch (RemoteException e) { e.rethrowFromSystemServer(); } Loading Loading @@ -124,7 +124,8 @@ public final class CredentialManager { ICancellationSignal cancelRemote = null; try { cancelRemote = mService.executeCreateCredential(request, new CreateCredentialTransport(executor, callback)); new CreateCredentialTransport(executor, callback), mContext.getOpPackageName()); } catch (RemoteException e) { e.rethrowFromSystemServer(); } Loading core/java/android/credentials/ICredentialManager.aidl +2 −2 Original line number Diff line number Diff line Loading @@ -29,7 +29,7 @@ import android.os.ICancellationSignal; */ interface ICredentialManager { @nullable ICancellationSignal executeGetCredential(in GetCredentialRequest request, in IGetCredentialCallback callback); @nullable ICancellationSignal executeGetCredential(in GetCredentialRequest request, in IGetCredentialCallback callback, String callingPackage); @nullable ICancellationSignal executeCreateCredential(in CreateCredentialRequest request, in ICreateCredentialCallback callback); @nullable ICancellationSignal executeCreateCredential(in CreateCredentialRequest request, in ICreateCredentialCallback callback, String callingPackage); } core/java/android/credentials/ui/ProviderData.java +22 −21 Original line number Diff line number Diff line Loading @@ -43,10 +43,10 @@ public class ProviderData implements Parcelable { "android.credentials.ui.extra.PROVIDER_DATA_LIST"; @NonNull private final String mProviderId; private final String mProviderFlattenedComponentName; @NonNull private final String mProviderDisplayName; @NonNull @Nullable private final Icon mIcon; @NonNull private final List<Entry> mCredentialEntries; Loading @@ -58,11 +58,11 @@ public class ProviderData implements Parcelable { private final @CurrentTimeMillisLong long mLastUsedTimeMillis; public ProviderData( @NonNull String providerId, @NonNull String providerDisplayName, @NonNull Icon icon, @NonNull List<Entry> credentialEntries, @NonNull String providerFlattenedComponentName, @NonNull String providerDisplayName, @Nullable Icon icon, @NonNull List<Entry> credentialEntries, @NonNull List<Entry> actionChips, @Nullable Entry authenticationEntry, @CurrentTimeMillisLong long lastUsedTimeMillis) { mProviderId = providerId; mProviderFlattenedComponentName = providerFlattenedComponentName; mProviderDisplayName = providerDisplayName; mIcon = icon; mCredentialEntries = credentialEntries; Loading @@ -73,8 +73,8 @@ public class ProviderData implements Parcelable { /** Returns the unique provider id. */ @NonNull public String getProviderId() { return mProviderId; public String getProviderFlattenedComponentName() { return mProviderFlattenedComponentName; } @NonNull Loading @@ -82,7 +82,7 @@ public class ProviderData implements Parcelable { return mProviderDisplayName; } @NonNull @Nullable public Icon getIcon() { return mIcon; } Loading @@ -108,9 +108,9 @@ public class ProviderData implements Parcelable { } protected ProviderData(@NonNull Parcel in) { String providerId = in.readString8(); mProviderId = providerId; AnnotationValidations.validate(NonNull.class, null, mProviderId); String providerFlattenedComponentName = in.readString8(); mProviderFlattenedComponentName = providerFlattenedComponentName; AnnotationValidations.validate(NonNull.class, null, mProviderFlattenedComponentName); String providerDisplayName = in.readString8(); mProviderDisplayName = providerDisplayName; Loading @@ -118,7 +118,6 @@ public class ProviderData implements Parcelable { Icon icon = in.readTypedObject(Icon.CREATOR); mIcon = icon; AnnotationValidations.validate(NonNull.class, null, mIcon); List<Entry> credentialEntries = new ArrayList<>(); in.readTypedList(credentialEntries, Entry.CREATOR); Loading @@ -139,7 +138,7 @@ public class ProviderData implements Parcelable { @Override public void writeToParcel(@NonNull Parcel dest, int flags) { dest.writeString8(mProviderId); dest.writeString8(mProviderFlattenedComponentName); dest.writeString8(mProviderDisplayName); dest.writeTypedObject(mIcon, flags); dest.writeTypedList(mCredentialEntries); Loading Loading @@ -171,26 +170,27 @@ public class ProviderData implements Parcelable { * @hide */ public static class Builder { private @NonNull String mProviderId; private @NonNull String mProviderFlattenedComponentName; private @NonNull String mProviderDisplayName; private @NonNull Icon mIcon; private @Nullable Icon mIcon; private @NonNull List<Entry> mCredentialEntries = new ArrayList<>(); private @NonNull List<Entry> mActionChips = new ArrayList<>(); private @Nullable Entry mAuthenticationEntry = null; private @CurrentTimeMillisLong long mLastUsedTimeMillis = 0L; /** Constructor with required properties. */ public Builder(@NonNull String providerId, @NonNull String providerDisplayName, @NonNull Icon icon) { mProviderId = providerId; public Builder(@NonNull String providerFlattenedComponentName, @NonNull String providerDisplayName, @Nullable Icon icon) { mProviderFlattenedComponentName = providerFlattenedComponentName; mProviderDisplayName = providerDisplayName; mIcon = icon; } /** Sets the unique provider id. */ @NonNull public Builder setProviderId(@NonNull String providerId) { mProviderId = providerId; public Builder setProviderFlattenedComponentName(@NonNull String providerFlattenedComponentName) { mProviderFlattenedComponentName = providerFlattenedComponentName; return this; } Loading Loading @@ -239,7 +239,8 @@ public class ProviderData implements Parcelable { /** Builds a {@link ProviderData}. */ @NonNull public ProviderData build() { return new ProviderData(mProviderId, mProviderDisplayName, mIcon, mCredentialEntries, return new ProviderData(mProviderFlattenedComponentName, mProviderDisplayName, mIcon, mCredentialEntries, mActionChips, mAuthenticationEntry, mLastUsedTimeMillis); } } Loading core/java/android/service/credentials/CredentialEntry.java +2 −2 Original line number Diff line number Diff line Loading @@ -140,8 +140,8 @@ public final class CredentialEntry implements Parcelable { public static final class Builder { private String mType; private Slice mSlice; private PendingIntent mPendingIntent; private Credential mCredential; private PendingIntent mPendingIntent = null; private Credential mCredential = null; private boolean mAutoSelectAllowed = false; /** Loading core/java/android/service/credentials/CredentialProviderException.java +18 −0 Original line number Diff line number Diff line Loading @@ -30,6 +30,22 @@ import java.lang.annotation.RetentionPolicy; public class CredentialProviderException extends Exception { public static final int ERROR_UNKNOWN = 0; /** * For internal use only. * Error code to be used when the provider request times out. * * @hide */ public static final int ERROR_TIMEOUT = 1; /** * For internal use only. * Error code to be used when the async task is canceled internally. * * @hide */ public static final int ERROR_TASK_CANCELED = 2; private final int mErrorCode; /** Loading @@ -37,6 +53,8 @@ public class CredentialProviderException extends Exception { */ @IntDef(prefix = {"ERROR_"}, value = { ERROR_UNKNOWN, ERROR_TIMEOUT, ERROR_TASK_CANCELED }) @Retention(RetentionPolicy.SOURCE) public @interface CredentialProviderError { } Loading Loading
core/java/android/credentials/CredentialManager.java +3 −2 Original line number Diff line number Diff line Loading @@ -85,7 +85,7 @@ public final class CredentialManager { ICancellationSignal cancelRemote = null; try { cancelRemote = mService.executeGetCredential(request, new GetCredentialTransport(executor, callback)); new GetCredentialTransport(executor, callback), mContext.getOpPackageName()); } catch (RemoteException e) { e.rethrowFromSystemServer(); } Loading Loading @@ -124,7 +124,8 @@ public final class CredentialManager { ICancellationSignal cancelRemote = null; try { cancelRemote = mService.executeCreateCredential(request, new CreateCredentialTransport(executor, callback)); new CreateCredentialTransport(executor, callback), mContext.getOpPackageName()); } catch (RemoteException e) { e.rethrowFromSystemServer(); } Loading
core/java/android/credentials/ICredentialManager.aidl +2 −2 Original line number Diff line number Diff line Loading @@ -29,7 +29,7 @@ import android.os.ICancellationSignal; */ interface ICredentialManager { @nullable ICancellationSignal executeGetCredential(in GetCredentialRequest request, in IGetCredentialCallback callback); @nullable ICancellationSignal executeGetCredential(in GetCredentialRequest request, in IGetCredentialCallback callback, String callingPackage); @nullable ICancellationSignal executeCreateCredential(in CreateCredentialRequest request, in ICreateCredentialCallback callback); @nullable ICancellationSignal executeCreateCredential(in CreateCredentialRequest request, in ICreateCredentialCallback callback, String callingPackage); }
core/java/android/credentials/ui/ProviderData.java +22 −21 Original line number Diff line number Diff line Loading @@ -43,10 +43,10 @@ public class ProviderData implements Parcelable { "android.credentials.ui.extra.PROVIDER_DATA_LIST"; @NonNull private final String mProviderId; private final String mProviderFlattenedComponentName; @NonNull private final String mProviderDisplayName; @NonNull @Nullable private final Icon mIcon; @NonNull private final List<Entry> mCredentialEntries; Loading @@ -58,11 +58,11 @@ public class ProviderData implements Parcelable { private final @CurrentTimeMillisLong long mLastUsedTimeMillis; public ProviderData( @NonNull String providerId, @NonNull String providerDisplayName, @NonNull Icon icon, @NonNull List<Entry> credentialEntries, @NonNull String providerFlattenedComponentName, @NonNull String providerDisplayName, @Nullable Icon icon, @NonNull List<Entry> credentialEntries, @NonNull List<Entry> actionChips, @Nullable Entry authenticationEntry, @CurrentTimeMillisLong long lastUsedTimeMillis) { mProviderId = providerId; mProviderFlattenedComponentName = providerFlattenedComponentName; mProviderDisplayName = providerDisplayName; mIcon = icon; mCredentialEntries = credentialEntries; Loading @@ -73,8 +73,8 @@ public class ProviderData implements Parcelable { /** Returns the unique provider id. */ @NonNull public String getProviderId() { return mProviderId; public String getProviderFlattenedComponentName() { return mProviderFlattenedComponentName; } @NonNull Loading @@ -82,7 +82,7 @@ public class ProviderData implements Parcelable { return mProviderDisplayName; } @NonNull @Nullable public Icon getIcon() { return mIcon; } Loading @@ -108,9 +108,9 @@ public class ProviderData implements Parcelable { } protected ProviderData(@NonNull Parcel in) { String providerId = in.readString8(); mProviderId = providerId; AnnotationValidations.validate(NonNull.class, null, mProviderId); String providerFlattenedComponentName = in.readString8(); mProviderFlattenedComponentName = providerFlattenedComponentName; AnnotationValidations.validate(NonNull.class, null, mProviderFlattenedComponentName); String providerDisplayName = in.readString8(); mProviderDisplayName = providerDisplayName; Loading @@ -118,7 +118,6 @@ public class ProviderData implements Parcelable { Icon icon = in.readTypedObject(Icon.CREATOR); mIcon = icon; AnnotationValidations.validate(NonNull.class, null, mIcon); List<Entry> credentialEntries = new ArrayList<>(); in.readTypedList(credentialEntries, Entry.CREATOR); Loading @@ -139,7 +138,7 @@ public class ProviderData implements Parcelable { @Override public void writeToParcel(@NonNull Parcel dest, int flags) { dest.writeString8(mProviderId); dest.writeString8(mProviderFlattenedComponentName); dest.writeString8(mProviderDisplayName); dest.writeTypedObject(mIcon, flags); dest.writeTypedList(mCredentialEntries); Loading Loading @@ -171,26 +170,27 @@ public class ProviderData implements Parcelable { * @hide */ public static class Builder { private @NonNull String mProviderId; private @NonNull String mProviderFlattenedComponentName; private @NonNull String mProviderDisplayName; private @NonNull Icon mIcon; private @Nullable Icon mIcon; private @NonNull List<Entry> mCredentialEntries = new ArrayList<>(); private @NonNull List<Entry> mActionChips = new ArrayList<>(); private @Nullable Entry mAuthenticationEntry = null; private @CurrentTimeMillisLong long mLastUsedTimeMillis = 0L; /** Constructor with required properties. */ public Builder(@NonNull String providerId, @NonNull String providerDisplayName, @NonNull Icon icon) { mProviderId = providerId; public Builder(@NonNull String providerFlattenedComponentName, @NonNull String providerDisplayName, @Nullable Icon icon) { mProviderFlattenedComponentName = providerFlattenedComponentName; mProviderDisplayName = providerDisplayName; mIcon = icon; } /** Sets the unique provider id. */ @NonNull public Builder setProviderId(@NonNull String providerId) { mProviderId = providerId; public Builder setProviderFlattenedComponentName(@NonNull String providerFlattenedComponentName) { mProviderFlattenedComponentName = providerFlattenedComponentName; return this; } Loading Loading @@ -239,7 +239,8 @@ public class ProviderData implements Parcelable { /** Builds a {@link ProviderData}. */ @NonNull public ProviderData build() { return new ProviderData(mProviderId, mProviderDisplayName, mIcon, mCredentialEntries, return new ProviderData(mProviderFlattenedComponentName, mProviderDisplayName, mIcon, mCredentialEntries, mActionChips, mAuthenticationEntry, mLastUsedTimeMillis); } } Loading
core/java/android/service/credentials/CredentialEntry.java +2 −2 Original line number Diff line number Diff line Loading @@ -140,8 +140,8 @@ public final class CredentialEntry implements Parcelable { public static final class Builder { private String mType; private Slice mSlice; private PendingIntent mPendingIntent; private Credential mCredential; private PendingIntent mPendingIntent = null; private Credential mCredential = null; private boolean mAutoSelectAllowed = false; /** Loading
core/java/android/service/credentials/CredentialProviderException.java +18 −0 Original line number Diff line number Diff line Loading @@ -30,6 +30,22 @@ import java.lang.annotation.RetentionPolicy; public class CredentialProviderException extends Exception { public static final int ERROR_UNKNOWN = 0; /** * For internal use only. * Error code to be used when the provider request times out. * * @hide */ public static final int ERROR_TIMEOUT = 1; /** * For internal use only. * Error code to be used when the async task is canceled internally. * * @hide */ public static final int ERROR_TASK_CANCELED = 2; private final int mErrorCode; /** Loading @@ -37,6 +53,8 @@ public class CredentialProviderException extends Exception { */ @IntDef(prefix = {"ERROR_"}, value = { ERROR_UNKNOWN, ERROR_TIMEOUT, ERROR_TASK_CANCELED }) @Retention(RetentionPolicy.SOURCE) public @interface CredentialProviderError { } Loading