diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-05-21 12:27:14 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-05-21 12:27:14 +0000 |
commit | 997a91988ba5cab07d4651dcb8e703c5ba8d7646 (patch) | |
tree | f10668d9dc87fa0ad991810ce2644db0275ec432 | |
parent | a1c323e3a5387d1930dce55104055747a1053259 (diff) | |
parent | 70032a2eedfcb54393933c5863cf649e58451334 (diff) | |
download | development-997a91988ba5cab07d4651dcb8e703c5ba8d7646.tar.gz |
Snap for 8626064 from 70032a2eedfcb54393933c5863cf649e58451334 to mainline-go-mediaprovider-release
Change-Id: I026f9d54b3c8eafa8ef42cfddd9281f7fe87cf4c
5 files changed, 56 insertions, 23 deletions
diff --git a/samples/InlineFillService/src/com/example/android/inlinefillservice/InlineFillService.java b/samples/InlineFillService/src/com/example/android/inlinefillservice/InlineFillService.java index 27e6d2f77..1fa58c1c1 100644 --- a/samples/InlineFillService/src/com/example/android/inlinefillservice/InlineFillService.java +++ b/samples/InlineFillService/src/com/example/android/inlinefillservice/InlineFillService.java @@ -23,6 +23,7 @@ import android.service.autofill.FillCallback; import android.service.autofill.FillRequest; import android.service.autofill.FillResponse; import android.service.autofill.InlinePresentation; +import android.service.autofill.Presentations; import android.service.autofill.SaveCallback; import android.service.autofill.SaveInfo; import android.service.autofill.SaveRequest; @@ -95,14 +96,17 @@ public class InlineFillService extends AutofillService { InlinePresentation inlinePresentation = InlineRequestHelper.maybeCreateInlineAuthenticationResponse(context, inlineRequest); + final Presentations.Builder fieldPresentationsBuilder = + new Presentations.Builder(); + fieldPresentationsBuilder.setMenuPresentation(presentation); + fieldPresentationsBuilder.setInlinePresentation(inlinePresentation); response = new FillResponse.Builder() - .setAuthentication(ids, authentication, presentation, inlinePresentation) + .setAuthentication(ids, authentication, fieldPresentationsBuilder.build()) .build(); } else { response = createResponse(this, fields, maxSuggestionsCount, mAuthenticateDatasets, inlineRequest); } - callback.onSuccess(response); } @@ -130,8 +134,13 @@ public class InlineFillService extends AutofillService { response.addDataset(InlineRequestHelper.createInlineActionDataset(context, fields, inlineRequest.get(), R.drawable.ic_settings)); } + // 3. Add fill dialog + RemoteViews dialogPresentation = + ResponseHelper.newDatasetPresentation(packageName, "Dialog Header"); + response.setDialogHeader(dialogPresentation); + response.setFillDialogTriggerIds(fields.valueAt(0), fields.valueAt(1)); - // 3.Add save info + // 4.Add save info Collection<AutofillId> ids = fields.values(); AutofillId[] requiredIds = new AutofillId[ids.size()]; ids.toArray(requiredIds); @@ -139,7 +148,7 @@ public class InlineFillService extends AutofillService { // We're simple, so we're generic new SaveInfo.Builder(SaveInfo.SAVE_DATA_TYPE_GENERIC, requiredIds).build()); - // 4.Profit! + // 5.Profit! return response.build(); } diff --git a/samples/InlineFillService/src/com/example/android/inlinefillservice/ResponseHelper.java b/samples/InlineFillService/src/com/example/android/inlinefillservice/ResponseHelper.java index 59fb0cd75..d33f19cde 100644 --- a/samples/InlineFillService/src/com/example/android/inlinefillservice/ResponseHelper.java +++ b/samples/InlineFillService/src/com/example/android/inlinefillservice/ResponseHelper.java @@ -21,7 +21,9 @@ import static com.example.android.inlinefillservice.InlineFillService.TAG; import android.content.Context; import android.content.IntentSender; import android.service.autofill.Dataset; +import android.service.autofill.Field; import android.service.autofill.InlinePresentation; +import android.service.autofill.Presentations; import android.util.Log; import android.view.autofill.AutofillId; import android.view.autofill.AutofillValue; @@ -51,21 +53,31 @@ class ResponseHelper { Log.d(TAG, "hint: " + hint); final String displayValue = hint.contains("password") ? "password for #" + (index + 1) : value; - final RemoteViews presentation = newDatasetPresentation(packageName, displayValue); - // Add Inline Suggestion required info. + Field.Builder fieldBuilder = new Field.Builder(); + fieldBuilder.setValue(AutofillValue.forText(value)); + // Set presentation + final Presentations.Builder fieldPresentationsBuilder = + new Presentations.Builder(); + // Dropdown presentation + final RemoteViews presentation = newDatasetPresentation(packageName, displayValue); + fieldPresentationsBuilder.setMenuPresentation(presentation); + // Inline presentation if (inlineRequest.isPresent()) { Log.d(TAG, "Found InlineSuggestionsRequest in FillRequest: " + inlineRequest); final InlinePresentation inlinePresentation = - InlineRequestHelper.createInlineDataset(context, inlineRequest.get(), - displayValue, index); - dataset.setValue(id, AutofillValue.forText(value), presentation, - inlinePresentation); - } else { - dataset.setValue(id, AutofillValue.forText(value), presentation); + InlineRequestHelper.createInlineDataset(context, inlineRequest.get(), + displayValue, index); + fieldPresentationsBuilder.setInlinePresentation(inlinePresentation); } - } + // Dialog presentation + RemoteViews dialogPresentation = + newDatasetPresentation(packageName, "Dialog Presentation " + (index + 1)); + fieldPresentationsBuilder.setDialogPresentation(dialogPresentation); + fieldBuilder.setPresentations(fieldPresentationsBuilder.build()); + dataset.setField(id, fieldBuilder.build()); + } return dataset.build(); } @@ -84,16 +96,28 @@ class ResponseHelper { IntentSender authentication = AuthActivity.newIntentSenderForDataset(context, unlockedDataset); RemoteViews presentation = newDatasetPresentation(packageName, displayValue); + + Field.Builder fieldBuilder = new Field.Builder(); + fieldBuilder.setValue(AutofillValue.forText(value)); + // Dropdown presentation + final Presentations.Builder fieldPresentationsBuilder = + new Presentations.Builder(); + fieldPresentationsBuilder.setMenuPresentation(presentation); + // Inline presentation if (inlineRequest.isPresent()) { final InlinePresentation inlinePresentation = InlineRequestHelper.createInlineDataset(context, inlineRequest.get(), displayValue, index); - lockedDataset.setValue(id, null, presentation, inlinePresentation) - .setAuthentication(authentication); - } else { - lockedDataset.setValue(id, null, presentation) - .setAuthentication(authentication); + fieldPresentationsBuilder.setInlinePresentation(inlinePresentation); } + // Dialog presentation + RemoteViews dialogPresentation = + newDatasetPresentation(packageName, "Dialog Presentation " + (index + 1)); + fieldPresentationsBuilder.setDialogPresentation(dialogPresentation); + + fieldBuilder.setPresentations(fieldPresentationsBuilder.build()); + lockedDataset.setField(id, fieldBuilder.build()); + lockedDataset.setId(null).setAuthentication(authentication); } return lockedDataset.build(); } diff --git a/sdk/build_tools_source.prop_template b/sdk/build_tools_source.prop_template index c706081c2..8490e5927 100644 --- a/sdk/build_tools_source.prop_template +++ b/sdk/build_tools_source.prop_template @@ -1,3 +1,3 @@ Pkg.UserSrc=false -#Pkg.Revision=${PLATFORM_SDK_VERSION}.0.0 -Pkg.Revision=33.0.0 rc4 +Pkg.Revision=${PLATFORM_SDK_VERSION}.0.0 +#Pkg.Revision=33.0.0 rc4 diff --git a/sdk/platform_source.prop_template b/sdk/platform_source.prop_template index 036a6b87e..fa996c7e3 100644 --- a/sdk/platform_source.prop_template +++ b/sdk/platform_source.prop_template @@ -2,7 +2,7 @@ Pkg.Desc=Android SDK Platform ${PLATFORM_VERSION} Pkg.UserSrc=false Platform.Version=${PLATFORM_VERSION} Platform.CodeName= -Pkg.Revision=4 +Pkg.Revision=1 AndroidVersion.ApiLevel=${PLATFORM_SDK_VERSION} AndroidVersion.CodeName=${PLATFORM_VERSION_CODENAME} AndroidVersion.ExtensionLevel=${PLATFORM_SDK_EXTENSION_VERSION} diff --git a/vndk/tools/header-checker/android/envsetup.sh b/vndk/tools/header-checker/android/envsetup.sh index ef5312db0..5c04f6888 100644 --- a/vndk/tools/header-checker/android/envsetup.sh +++ b/vndk/tools/header-checker/android/envsetup.sh @@ -15,5 +15,5 @@ # limitations under the License. export LLVM_BUILD_HOST_TOOLS=true -export LLVM_PREBUILTS_VERSION=clang-r450784c -export LLVM_RELEASE_VERSION=14.0.5 +export LLVM_PREBUILTS_VERSION=clang-r450784d +export LLVM_RELEASE_VERSION=14.0.6 |