Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bf3d1545 authored by Evan Chen's avatar Evan Chen
Browse files

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
parent 177af6b6
Loading
Loading
Loading
Loading
+11 −7
Original line number Diff line number Diff line
@@ -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));