Merge "Add isDreaming method to DreamManager" into rvc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
95f8aba25e
@@ -431,6 +431,7 @@ package android.app {
|
||||
}
|
||||
|
||||
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 startDream(@NonNull android.content.ComponentName);
|
||||
method @RequiresPermission("android.permission.WRITE_DREAM_STATE") public void stopDream();
|
||||
|
||||
@@ -58,7 +58,7 @@ public class DreamManager {
|
||||
@RequiresPermission(android.Manifest.permission.WRITE_DREAM_STATE)
|
||||
public void startDream(@NonNull ComponentName name) {
|
||||
try {
|
||||
mService.testDream(mContext.getUserId(), name);
|
||||
mService.dream();
|
||||
} catch (RemoteException e) {
|
||||
e.rethrowFromSystemServer();
|
||||
}
|
||||
@@ -99,4 +99,22 @@ public class DreamManager {
|
||||
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