summaryrefslogtreecommitdiffstats
path: root/core/java/android/hardware/display/DisplayManagerGlobal.java
diff options
context:
space:
mode:
authorJeff Brown <jeffbrown@google.com>2012-09-07 20:36:36 -0700
committerJeff Brown <jeffbrown@google.com>2012-09-08 14:53:34 -0700
commite08ae388d63c4db8f9d9a7ecd634f9a51f6e91b9 (patch)
treeca429e688d16f11dc82410cee03c9d53da96626a /core/java/android/hardware/display/DisplayManagerGlobal.java
parent0cfebf28b15e85a42981a8f9e6a09556bef36ea3 (diff)
downloadframeworks_base-e08ae388d63c4db8f9d9a7ecd634f9a51f6e91b9.zip
frameworks_base-e08ae388d63c4db8f9d9a7ecd634f9a51f6e91b9.tar.gz
frameworks_base-e08ae388d63c4db8f9d9a7ecd634f9a51f6e91b9.tar.bz2
Add new wifi display discovery API.
The API is quite simple. There are a few extra functions on DisplayManager to scan, connect and disconnect from wifi displays and get status, and a single protected broadcast sent when the status changes. Change-Id: Ic91dbab5ee818e790b27fa32e1a1e93788793be0
Diffstat (limited to 'core/java/android/hardware/display/DisplayManagerGlobal.java')
-rw-r--r--core/java/android/hardware/display/DisplayManagerGlobal.java37
1 files changed, 37 insertions, 0 deletions
diff --git a/core/java/android/hardware/display/DisplayManagerGlobal.java b/core/java/android/hardware/display/DisplayManagerGlobal.java
index 4077964..14b5440 100644
--- a/core/java/android/hardware/display/DisplayManagerGlobal.java
+++ b/core/java/android/hardware/display/DisplayManagerGlobal.java
@@ -253,6 +253,43 @@ public final class DisplayManagerGlobal {
}
}
+ public void scanWifiDisplays() {
+ try {
+ mDm.scanWifiDisplays();
+ } catch (RemoteException ex) {
+ Log.e(TAG, "Failed to scan for Wifi displays.", ex);
+ }
+ }
+
+ public void connectWifiDisplay(String deviceAddress) {
+ if (deviceAddress == null) {
+ throw new IllegalArgumentException("deviceAddress must not be null");
+ }
+
+ try {
+ mDm.connectWifiDisplay(deviceAddress);
+ } catch (RemoteException ex) {
+ Log.e(TAG, "Failed to connect to Wifi display " + deviceAddress + ".", ex);
+ }
+ }
+
+ public void disconnectWifiDisplay() {
+ try {
+ mDm.disconnectWifiDisplay();
+ } catch (RemoteException ex) {
+ Log.e(TAG, "Failed to disconnect from Wifi display.", ex);
+ }
+ }
+
+ public WifiDisplayStatus getWifiDisplayStatus() {
+ try {
+ return mDm.getWifiDisplayStatus();
+ } catch (RemoteException ex) {
+ Log.e(TAG, "Failed to get Wifi display status.", ex);
+ return new WifiDisplayStatus();
+ }
+ }
+
private final class DisplayManagerCallback extends IDisplayManagerCallback.Stub {
@Override
public void onDisplayEvent(int displayId, int event) {