Loading core/java/android/service/credentials/BeginGetCredentialOption.java +7 −0 Original line number Diff line number Diff line Loading @@ -39,6 +39,8 @@ import com.android.internal.util.Preconditions; */ @SuppressLint("ParcelNotFinal") public class BeginGetCredentialOption implements Parcelable { private static final String BUNDLE_ID_KEY = "android.service.credentials.BeginGetCredentialOption.BUNDLE_ID_KEY"; /** * A unique id associated with this request option. */ Loading Loading @@ -129,6 +131,11 @@ public class BeginGetCredentialOption implements Parcelable { mType = Preconditions.checkStringNotEmpty(type, "type must not be empty"); mCandidateQueryData = requireNonNull( candidateQueryData, "candidateQueryData must not be null"); addIdToBundle(); } private void addIdToBundle() { mCandidateQueryData.putString(BUNDLE_ID_KEY, mId); } private BeginGetCredentialOption(@NonNull Parcel in) { Loading services/credentials/java/com/android/server/credentials/ProviderCreateSession.java +4 −3 Original line number Diff line number Diff line Loading @@ -96,13 +96,14 @@ public final class ProviderCreateSession extends ProviderSession< if (propagateToProvider) { return new BeginCreateCredentialRequest( type, candidateQueryData candidateQueryData, callingAppInfo ); } return new BeginCreateCredentialRequest( type, candidateQueryData, callingAppInfo); candidateQueryData ); } @Nullable Loading services/credentials/java/com/android/server/credentials/ProviderGetSession.java +5 −3 Original line number Diff line number Diff line Loading @@ -305,18 +305,20 @@ public final class ProviderGetSession extends ProviderSession<BeginGetCredential Log.i(TAG, "in prepareUiProviderData creating ui entry with id " + entryId); credentialUiEntries.add(new Entry(CREDENTIAL_ENTRY_KEY, entryId, credentialEntry.getSlice(), /*fillInIntent=*/setUpFillInIntent(credentialEntry.getType()))); /*fillInIntent=*/setUpFillInIntent(credentialEntry .getBeginGetCredentialOption().getId()))); } return credentialUiEntries; } private Intent setUpFillInIntent(@Nullable String id) { private Intent setUpFillInIntent(@NonNull String id) { // TODO: Determine if we should skip this entry if entry id is not set, or is set // but does not resolve to a valid option. For now, not skipping it because // it may be possible that the provider adds their own extras and expects to receive // those and complete the flow. if (id == null || mBeginGetOptionToCredentialOptionMap.get(id) == null) { if (mBeginGetOptionToCredentialOptionMap.get(id) == null) { Log.i(TAG, "Id from Credential Entry does not resolve to a valid option"); return new Intent(); } return new Intent().putExtra(CredentialProviderService.EXTRA_GET_CREDENTIAL_REQUEST, new GetCredentialRequest( Loading Loading
core/java/android/service/credentials/BeginGetCredentialOption.java +7 −0 Original line number Diff line number Diff line Loading @@ -39,6 +39,8 @@ import com.android.internal.util.Preconditions; */ @SuppressLint("ParcelNotFinal") public class BeginGetCredentialOption implements Parcelable { private static final String BUNDLE_ID_KEY = "android.service.credentials.BeginGetCredentialOption.BUNDLE_ID_KEY"; /** * A unique id associated with this request option. */ Loading Loading @@ -129,6 +131,11 @@ public class BeginGetCredentialOption implements Parcelable { mType = Preconditions.checkStringNotEmpty(type, "type must not be empty"); mCandidateQueryData = requireNonNull( candidateQueryData, "candidateQueryData must not be null"); addIdToBundle(); } private void addIdToBundle() { mCandidateQueryData.putString(BUNDLE_ID_KEY, mId); } private BeginGetCredentialOption(@NonNull Parcel in) { Loading
services/credentials/java/com/android/server/credentials/ProviderCreateSession.java +4 −3 Original line number Diff line number Diff line Loading @@ -96,13 +96,14 @@ public final class ProviderCreateSession extends ProviderSession< if (propagateToProvider) { return new BeginCreateCredentialRequest( type, candidateQueryData candidateQueryData, callingAppInfo ); } return new BeginCreateCredentialRequest( type, candidateQueryData, callingAppInfo); candidateQueryData ); } @Nullable Loading
services/credentials/java/com/android/server/credentials/ProviderGetSession.java +5 −3 Original line number Diff line number Diff line Loading @@ -305,18 +305,20 @@ public final class ProviderGetSession extends ProviderSession<BeginGetCredential Log.i(TAG, "in prepareUiProviderData creating ui entry with id " + entryId); credentialUiEntries.add(new Entry(CREDENTIAL_ENTRY_KEY, entryId, credentialEntry.getSlice(), /*fillInIntent=*/setUpFillInIntent(credentialEntry.getType()))); /*fillInIntent=*/setUpFillInIntent(credentialEntry .getBeginGetCredentialOption().getId()))); } return credentialUiEntries; } private Intent setUpFillInIntent(@Nullable String id) { private Intent setUpFillInIntent(@NonNull String id) { // TODO: Determine if we should skip this entry if entry id is not set, or is set // but does not resolve to a valid option. For now, not skipping it because // it may be possible that the provider adds their own extras and expects to receive // those and complete the flow. if (id == null || mBeginGetOptionToCredentialOptionMap.get(id) == null) { if (mBeginGetOptionToCredentialOptionMap.get(id) == null) { Log.i(TAG, "Id from Credential Entry does not resolve to a valid option"); return new Intent(); } return new Intent().putExtra(CredentialProviderService.EXTRA_GET_CREDENTIAL_REQUEST, new GetCredentialRequest( Loading