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

Commit 9432acc7 authored by Guojing Yuan's avatar Guojing Yuan Committed by Android Build Coastguard Worker
Browse files

[DO NOT MERGE][CDM] Fix a security issue that allow 3p apps to skip prompt by setSkipPrompt

Fix: 329230490

Test: CTS
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:f28e88e53d57779fff5900d1811ffa07ab174640)
Merged-In: I6e4dd33cbf98293d7efa0a40c0668d6c5242059a
Change-Id: I6e4dd33cbf98293d7efa0a40c0668d6c5242059a
parent c713eb91
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -429,10 +429,8 @@ public class CompanionDeviceManagerService extends SystemService implements Bind
            mCallingPackage = callingPackage;
            request.setCallingPackage(callingPackage);

            if (mayAssociateWithoutPrompt(callingPackage, userId)) {
                Slog.i(LOG_TAG, "setSkipPrompt(true)");
                request.setSkipPrompt(true);
            }
            request.setSkipPrompt(mayAssociateWithoutPrompt(callingPackage, userId));

            callback.asBinder().linkToDeath(CompanionDeviceManagerService.this /* recipient */, 0);

            AndroidFuture<String> fetchProfileDescription =