Permissions check for Wifi Display configuration

Wifi Display is configured using the AIDL call setMiracastMode()
and using a message over the async channel SET_WFD_INFO.
Enforce permissions on the calling uid before updating the config

Bug: 18668877
Test: Unit tests
Change-Id: I0be2d2af49070aad759f24bd31331f7df39a0422
Merged-In: I0be2d2af49070aad759f24bd31331f7df39a0422
This commit is contained in:
Sohani Rao
2016-09-29 16:20:45 -07:00
parent 264d1f12a3
commit ef401300e8
2 changed files with 6 additions and 0 deletions

View File

@@ -28,5 +28,6 @@ interface IWifiP2pManager
Messenger getMessenger();
Messenger getP2pStateMachineMessenger();
void setMiracastMode(int mode);
void checkConfigureWifiDisplayPermission();
}

View File

@@ -1324,6 +1324,11 @@ public class WifiP2pManager {
Channel c, WifiP2pWfdInfo wfdInfo,
ActionListener listener) {
checkChannel(c);
try {
mService.checkConfigureWifiDisplayPermission();
} catch (RemoteException e) {
e.rethrowFromSystemServer();
}
c.mAsyncChannel.sendMessage(SET_WFD_INFO, 0, c.putListener(listener), wfdInfo);
}