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

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

No need to show user consent for SingleDevice && isSkipPrompt

Test: atest CtsCompanionDeviceManagerCoreTestCases
      atest CtsCompanionDeviceManagerUiAutomationTestCases
      atest CtsOsTestCases:CompanionDeviceManagerTest
Fix: 230393501
Change-Id: I29dd4c07b69021c87fb044a385aadb85334cdea2
parent bf068a06
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -484,6 +484,14 @@ public class CompanionDeviceActivity extends FragmentActivity implements
        if (deviceFilterPairs.isEmpty()) return;

        mSelectedDevice = requireNonNull(deviceFilterPairs.get(0));
        // No need to show user consent dialog if it is a singleDevice
        // and isSkipPrompt(true) AssociationRequest.
        // See AssociationRequestsProcessor#mayAssociateWithoutPrompt.
        if (mRequest.isSkipPrompt()) {
            mSingleDeviceSpinner.setVisibility(View.GONE);
            onUserSelectedDevice(mSelectedDevice);
            return;
        }

        final String deviceName = mSelectedDevice.getDisplayName();
        final Spanned title = getHtmlFromResources(