Merge "Add isDreaming method to DreamManager" into rvc-dev am: 95f8aba25e
Change-Id: I2c3ea6db39fc4880a63fdf0fe57e43a95e1964a2
This commit is contained in:
@@ -431,6 +431,7 @@ package android.app {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public class DreamManager {
|
public class DreamManager {
|
||||||
|
method @RequiresPermission("android.permission.READ_DREAM_STATE") public boolean isDreaming();
|
||||||
method @RequiresPermission("android.permission.WRITE_DREAM_STATE") public void setActiveDream(@NonNull android.content.ComponentName);
|
method @RequiresPermission("android.permission.WRITE_DREAM_STATE") public void setActiveDream(@NonNull android.content.ComponentName);
|
||||||
method @RequiresPermission("android.permission.WRITE_DREAM_STATE") public void startDream(@NonNull android.content.ComponentName);
|
method @RequiresPermission("android.permission.WRITE_DREAM_STATE") public void startDream(@NonNull android.content.ComponentName);
|
||||||
method @RequiresPermission("android.permission.WRITE_DREAM_STATE") public void stopDream();
|
method @RequiresPermission("android.permission.WRITE_DREAM_STATE") public void stopDream();
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ public class DreamManager {
|
|||||||
@RequiresPermission(android.Manifest.permission.WRITE_DREAM_STATE)
|
@RequiresPermission(android.Manifest.permission.WRITE_DREAM_STATE)
|
||||||
public void startDream(@NonNull ComponentName name) {
|
public void startDream(@NonNull ComponentName name) {
|
||||||
try {
|
try {
|
||||||
mService.testDream(mContext.getUserId(), name);
|
mService.dream();
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
e.rethrowFromSystemServer();
|
e.rethrowFromSystemServer();
|
||||||
}
|
}
|
||||||
@@ -99,4 +99,22 @@ public class DreamManager {
|
|||||||
e.rethrowFromSystemServer();
|
e.rethrowFromSystemServer();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns whether the device is Dreaming.
|
||||||
|
*
|
||||||
|
* <p> This is only used for testing the dream service APIs.
|
||||||
|
*
|
||||||
|
* @hide
|
||||||
|
*/
|
||||||
|
@TestApi
|
||||||
|
@RequiresPermission(android.Manifest.permission.READ_DREAM_STATE)
|
||||||
|
public boolean isDreaming() {
|
||||||
|
try {
|
||||||
|
return mService.isDreaming();
|
||||||
|
} catch (RemoteException e) {
|
||||||
|
e.rethrowFromSystemServer();
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user