summaryrefslogtreecommitdiffstats
path: root/core/java
diff options
context:
space:
mode:
Diffstat (limited to 'core/java')
-rw-r--r--core/java/android/app/WallpaperManager.java41
-rw-r--r--core/java/android/os/PowerManager.java15
-rw-r--r--core/java/android/provider/Settings.java1
-rw-r--r--core/java/android/view/WindowManager.java15
4 files changed, 71 insertions, 1 deletions
diff --git a/core/java/android/app/WallpaperManager.java b/core/java/android/app/WallpaperManager.java
index 8bfe6d3..90d84ee 100644
--- a/core/java/android/app/WallpaperManager.java
+++ b/core/java/android/app/WallpaperManager.java
@@ -994,6 +994,47 @@ public class WallpaperManager {
}
/**
+ * Clear the wallpaper.
+ *
+ * @hide
+ */
+ @SystemApi
+ public void clearWallpaper() {
+ if (sGlobals.mService == null) {
+ Log.w(TAG, "WallpaperService not running");
+ return;
+ }
+ try {
+ sGlobals.mService.clearWallpaper();
+ } catch (RemoteException e) {
+ // Ignore
+ }
+ }
+
+ /**
+ * Set the live wallpaper.
+ *
+ * This can only be called by packages with android.permission.SET_WALLPAPER_COMPONENT
+ * permission.
+ *
+ * @hide
+ */
+ @SystemApi
+ public boolean setWallpaperComponent(ComponentName name) {
+ if (sGlobals.mService == null) {
+ Log.w(TAG, "WallpaperService not running");
+ return false;
+ }
+ try {
+ sGlobals.mService.setWallpaperComponent(name);
+ return true;
+ } catch (RemoteException e) {
+ // Ignore
+ }
+ return false;
+ }
+
+ /**
* Set the position of the current wallpaper within any larger space, when
* that wallpaper is visible behind the given window. The X and Y offsets
* are floating point numbers ranging from 0 to 1, representing where the
diff --git a/core/java/android/os/PowerManager.java b/core/java/android/os/PowerManager.java
index 8307d9b..d52dd30 100644
--- a/core/java/android/os/PowerManager.java
+++ b/core/java/android/os/PowerManager.java
@@ -835,6 +835,21 @@ public final class PowerManager {
}
/**
+ * Turn off the device.
+ *
+ * @param confirm If true, shows a shutdown confirmation dialog.
+ * @param wait If true, this call waits for the shutdown to complete and does not return.
+ *
+ * @hide
+ */
+ public void shutdown(boolean confirm, boolean wait) {
+ try {
+ mService.shutdown(confirm, wait);
+ } catch (RemoteException e) {
+ }
+ }
+
+ /**
* Intent that is broadcast when the state of {@link #isPowerSaveMode()} changes.
* This broadcast is only sent to registered receivers.
*/
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
index 838686a..92349338 100644
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -5101,6 +5101,7 @@ public final class Settings {
* Whether Theater Mode is on.
* {@hide}
*/
+ @SystemApi
public static final String THEATER_MODE_ON = "theater_mode_on";
/**
diff --git a/core/java/android/view/WindowManager.java b/core/java/android/view/WindowManager.java
index 094a8a1..84434f7 100644
--- a/core/java/android/view/WindowManager.java
+++ b/core/java/android/view/WindowManager.java
@@ -16,6 +16,7 @@
package android.view;
+import android.annotation.SystemApi;
import android.app.Presentation;
import android.content.Context;
import android.content.pm.ActivityInfo;
@@ -1590,7 +1591,19 @@ public interface WindowManager extends ViewManager {
public final CharSequence getTitle() {
return mTitle;
}
-
+
+ /** @hide */
+ @SystemApi
+ public final void setUserActivityTimeout(long timeout) {
+ userActivityTimeout = timeout;
+ }
+
+ /** @hide */
+ @SystemApi
+ public final long getUserActivityTimeout() {
+ return userActivityTimeout;
+ }
+
public int describeContents() {
return 0;
}