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

Commit b019250d authored by Jeff Brown's avatar Jeff Brown
Browse files

Add a permission for controlling wifi display.

Change-Id: I321b6c1a0223e0c3d5df04fde7a13ab91c08c7bc
parent 5e54e089
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -283,10 +283,19 @@ sp<ICrypto> MediaPlayerService::makeCrypto() {

sp<IRemoteDisplay> MediaPlayerService::listenForRemoteDisplay(
        const sp<IRemoteDisplayClient>& client, const String8& iface) {
    if (!checkPermission("android.permission.CONTROL_WIFI_DISPLAY")) {
        return NULL;
    }

    return new RemoteDisplay(client, iface.string());
}

// TODO: delete this method
status_t MediaPlayerService::enableRemoteDisplay(const char *iface) {
    if (!checkPermission("android.permission.CONTROL_WIFI_DISPLAY")) {
        return PERMISSION_DENIED;
    }

    Mutex::Autolock autoLock(mLock);

    if (iface != NULL) {