OSDN Git Service

Fix companion uses-permission enforcement
authorEugene Susla <eugenesusla@google.com>
Thu, 15 Jun 2017 18:22:57 +0000 (11:22 -0700)
committerEugene Susla <eugenesusla@google.com>
Thu, 15 Jun 2017 18:30:44 +0000 (18:30 +0000)
commiteebd276715783df06f0e4720ccc709b59e551c59
treed5a227a406233a84f0b6b8c0c9453d46f8b74659
parentffd8343ba87c7cdf84287b91972b987ffc41d4fb
Fix companion uses-permission enforcement

Fixes: b/62662686
Test: Call CompanionDeviceManager#associate from app without uses-permission
declaration
Ensure exception is thrown

Call the method from app with the declaration
Ensure no exception is thrown

In debug mode catch the #isCallerSystem call from NotificationManagerService
(which runs in the system process) and ensure it passes the check
Change-Id: I26e5d2a7f5e63a346d4ab50b9ded1ec7dbc246a5
services/companion/java/com/android/server/companion/CompanionDeviceManagerService.java