commit | f28e88e53d57779fff5900d1811ffa07ab174640 | [log] [tgz] |
---|---|---|
author | Guojing Yuan <guojing@google.com> | Thu Mar 21 22:12:07 2024 +0000 |
committer | Guojing Yuan <guojing@google.com> | Tue Apr 02 17:35:47 2024 +0000 |
tree | 01593bf78c1d61d886c5216186479fdad653ab14 | |
parent | 30ed0c5552ab4002cca8efc245110e39fab5d21f [diff] |
[DO NOT MERGE][CDM] Fix a security issue that allow 3p apps to skip prompt by setSkipPrompt Fix: 329230490 Change-Id: I6e4dd33cbf98293d7efa0a40c0668d6c5242059a Test: CTS
diff --git a/services/companion/java/com/android/server/companion/CompanionDeviceManagerService.java b/services/companion/java/com/android/server/companion/CompanionDeviceManagerService.java index 5445b63..2f02ebd 100644 --- a/services/companion/java/com/android/server/companion/CompanionDeviceManagerService.java +++ b/services/companion/java/com/android/server/companion/CompanionDeviceManagerService.java
@@ -429,10 +429,8 @@ 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 =