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

Commit 858d67d2 authored by Koushik Dutta's avatar Koushik Dutta
Browse files

Remote display framework support.

Any app can use the remote display APIs to mirror to another device...
This can be used to implement AirPlay, Chromecast, or even screen recording.

Change-Id: I6f45b393afb2f9d438d4aa548e8149946741c928
parent ae44434c
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -122,8 +122,10 @@ LOCAL_SRC_FILES += \
	core/java/android/content/pm/IPackageStatsObserver.aidl \
	core/java/android/database/IContentObserver.aidl \
	core/java/android/hardware/ISerialManager.aidl \
	core/java/android/hardware/display/IDisplayDevice.aidl \
	core/java/android/hardware/display/IDisplayManager.aidl \
	core/java/android/hardware/display/IDisplayManagerCallback.aidl \
	core/java/android/hardware/display/IRemoteDisplayAdapter.aidl \
	core/java/android/hardware/input/IInputManager.aidl \
	core/java/android/hardware/input/IInputDevicesChangedListener.aidl \
	core/java/android/hardware/location/IGeofenceHardware.aidl \
+15 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2012 The Android Open Source Project
 * Copyright (C) 2012 The CyanogenMod Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
@@ -18,6 +19,7 @@ package android.hardware.display;

import android.content.Context;
import android.os.Handler;
import android.os.RemoteException;
import android.util.SparseArray;
import android.view.Display;

@@ -64,6 +66,12 @@ public final class DisplayManager {
    public static final String EXTRA_WIFI_DISPLAY_STATUS =
            "android.hardware.display.extra.WIFI_DISPLAY_STATUS";

    public static final String ACTION_REMOTE_DISPLAY_STATUS_CHANGED =
            "android.hardware.display.action.REMOTE_DISPLAY_STATUS_CHANGED";

    public static final String EXTRA_REMOTE_DISPLAY_STATUS =
            "android.hardware.display.extra.REMOTE_DISPLAY_STATUS";

    /**
     * Display category: Presentation displays.
     * <p>
@@ -274,6 +282,13 @@ public final class DisplayManager {
        return mGlobal.getWifiDisplayStatus();
    }

    /**
     * @hide
     */
    public IRemoteDisplayAdapter getRemoteDisplayAdapter() {
        return mGlobal.getRemoteDisplayAdapter();
    }

    /**
     * Listens for changes in available display devices.
     */
+10 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2012 The Android Open Source Project
 * Copyright (C) 2013 The CyanogenMod Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
@@ -315,6 +316,15 @@ public final class DisplayManagerGlobal {
        }
    }

    public IRemoteDisplayAdapter getRemoteDisplayAdapter() {
        try {
            return mDm.getRemoteDisplayAdapter();
        }
        catch (RemoteException e) {
            return null;
        }
    }

    private final class DisplayManagerCallback extends IDisplayManagerCallback.Stub {
        @Override
        public void onDisplayEvent(int displayId, int event) {
+24 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2013 The CyanogenMod Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package android.hardware.display;

import android.view.Surface;

interface IDisplayDevice {
    Surface createDisplaySurface();
    oneway void stop();
}
+4 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2012 The Android Open Source Project
 * Copyright (C) 2013 The CyanogenMod Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
@@ -20,6 +21,7 @@ import android.hardware.display.IDisplayManagerCallback;
import android.hardware.display.WifiDisplay;
import android.hardware.display.WifiDisplayStatus;
import android.view.DisplayInfo;
import android.hardware.display.IRemoteDisplayAdapter;

/** @hide */
interface IDisplayManager {
@@ -46,4 +48,6 @@ interface IDisplayManager {

    // No permissions required.
    WifiDisplayStatus getWifiDisplayStatus();

    IRemoteDisplayAdapter getRemoteDisplayAdapter();
}
Loading