summaryrefslogtreecommitdiff
path: root/packages/CompanionDeviceManager/src
diff options
context:
space:
mode:
author Evan Chen <evanxinchen@google.com> 2024-06-27 22:24:40 +0000
committer Evan Chen <evanxinchen@google.com> 2024-07-08 20:51:09 +0000
commitbf3d1545a4450eafe7ba47e7e0d4fe2eebdfaffb (patch)
treef2a706e437dd65c94cfe3af0e48e957cabf2b932 /packages/CompanionDeviceManager/src
parent177af6b61a94ee76fc8c5a059d592c2eda2af96e (diff)
Fix screen is flickering after selecting the deivce
Early terminate after user selects the device for same OEM request. Flag: EXEMPT bugfix Test: cts Bug: 303300448 Change-Id: I80d52f10f710692c4da4e3ea723ca08f9dab2b40
Diffstat (limited to 'packages/CompanionDeviceManager/src')
-rw-r--r--packages/CompanionDeviceManager/src/com/android/companiondevicemanager/CompanionAssociationActivity.java18
1 files changed, 11 insertions, 7 deletions
diff --git a/packages/CompanionDeviceManager/src/com/android/companiondevicemanager/CompanionAssociationActivity.java b/packages/CompanionDeviceManager/src/com/android/companiondevicemanager/CompanionAssociationActivity.java
index 66ab81bf02b1..e00533422072 100644
--- a/packages/CompanionDeviceManager/src/com/android/companiondevicemanager/CompanionAssociationActivity.java
+++ b/packages/CompanionDeviceManager/src/com/android/companiondevicemanager/CompanionAssociationActivity.java
@@ -554,11 +554,18 @@ public class CompanionAssociationActivity extends FragmentActivity implements
mSelectedDevice = requireNonNull(selectedDevice);
Slog.d(TAG, "onDeviceClicked(): " + mSelectedDevice.toShortString());
-
+ // The permission consent dialog should not be displayed if it's a isSkipPrompt(true)
+ // AssociationRequest or when there is no device profile available
+ // for the multiple devices dialog.
+ // See AssociationRequestsProcessor#mayAssociateWithoutPrompt.
+ final String deviceProfile = mRequest.getDeviceProfile();
+ if (deviceProfile == null || mRequest.isSkipPrompt()) {
+ onUserSelectedDevice(mSelectedDevice);
+ return;
+ }
+ // The permission consent dialog should be displayed for the multiple device
+ // dialog if a device profile exists.
updateSingleDeviceUi();
-
- if (mRequest.isSkipPrompt()) return;
-
mSummary.setVisibility(View.VISIBLE);
mButtonAllow.setVisibility(View.VISIBLE);
mButtonNotAllow.setVisibility(View.VISIBLE);
@@ -588,9 +595,6 @@ public class CompanionAssociationActivity extends FragmentActivity implements
if (deviceProfile == null && mRequest.isSingleDevice()) {
summary = getHtmlFromResources(this, summaryResourceId, remoteDeviceName);
mConstraintList.setVisibility(View.GONE);
- } else if (deviceProfile == null) {
- onUserSelectedDevice(mSelectedDevice);
- return;
} else {
summary = getHtmlFromResources(
this, summaryResourceId, getString(R.string.device_type));