From bf3d1545a4450eafe7ba47e7e0d4fe2eebdfaffb Mon Sep 17 00:00:00 2001 From: Evan Chen Date: Thu, 27 Jun 2024 22:24:40 +0000 Subject: 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 --- .../CompanionAssociationActivity.java | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'packages/CompanionDeviceManager/src') 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)); -- cgit v1.2.3-59-g8ed1b