Skip to content
Commit 057b4b8d authored by Hyundo Moon's avatar Hyundo Moon
Browse files

System MediaRouter2: Resolve API review

This CL resolves API reviews on system APIs on MediaRouter2.

1) It checks permission when registering the MediaRoute2Manager
   in system server. Therefore, app cannot bypass the permission
   checks via reflection.
   The system api calls will be no-op without permission.

2) It adds @RequiresPermission annotations to related APIs.

Also, this CL changes the required permission
from MODIFY_AUDIO_ROUTING to MEDIA_CONTENT_CONTROL,
as the media routing can be applied to video, not only to audio.

Note that MediaRouter2#getInstance(Context, String)
does not throw SecurityException anymore.

Bug: 183428114
Test: atest android.media.cts.MediaRouter2Test
      atest android.media.cts.SystemMediaRouterTest
      (MediaRouter2ManagerTest is already broken, and
       that will be handled out of this CL.)
Change-Id: I55013a5b4b954ca1c8e2adb586f49f01103563db
parent 6ffbb956
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment