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/hardware/Sensor.java23
-rw-r--r--core/java/android/hardware/SensorManager.java3
-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
-rw-r--r--core/java/android/view/WindowManagerPolicy.java8
7 files changed, 104 insertions, 2 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/hardware/Sensor.java b/core/java/android/hardware/Sensor.java
index cf6a779..fa5e9d2 100644
--- a/core/java/android/hardware/Sensor.java
+++ b/core/java/android/hardware/Sensor.java
@@ -18,6 +18,7 @@
package android.hardware;
import android.os.Build;
+import android.annotation.SystemApi;
/**
* Class representing a sensor. Use {@link SensorManager#getSensorList} to get
@@ -511,6 +512,27 @@ public final class Sensor {
*/
public static final String STRING_TYPE_PICK_UP_GESTURE = "android.sensor.pick_up_gesture";
+ /**
+ * A constant describing a wrist tilt gesture sensor.
+ *
+ * A sensor of this type triggers when the device face is tilted towards the user.
+ * The only allowed return value is 1.0.
+ * This sensor remains active until disabled.
+ *
+ * @hide This sensor is expected to only be used by the system ui
+ */
+ @SystemApi
+ public static final int TYPE_WRIST_TILT_GESTURE = 26;
+
+ /**
+ * A constant string describing a wrist tilt gesture sensor.
+ *
+ * @hide This sensor is expected to only be used by the system ui
+ * @see #TYPE_WRIST_TILT_GESTURE
+ */
+ @SystemApi
+ public static final String STRING_TYPE_WRIST_TILT_GESTURE = "android.sensor.wrist_tilt_gesture";
+
/**
* A constant describing all sensor types.
*/
@@ -591,6 +613,7 @@ public final class Sensor {
1, // SENSOR_TYPE_WAKE_GESTURE
1, // SENSOR_TYPE_GLANCE_GESTURE
1, // SENSOR_TYPE_PICK_UP_GESTURE
+ 1, // SENSOR_TYPE_WRIST_TILT_GESTURE
};
/**
diff --git a/core/java/android/hardware/SensorManager.java b/core/java/android/hardware/SensorManager.java
index e4e5a8c..34b895b 100644
--- a/core/java/android/hardware/SensorManager.java
+++ b/core/java/android/hardware/SensorManager.java
@@ -451,7 +451,8 @@ public abstract class SensorManager {
// non_wake-up version.
if (type == Sensor.TYPE_PROXIMITY || type == Sensor.TYPE_SIGNIFICANT_MOTION ||
type == Sensor.TYPE_TILT_DETECTOR || type == Sensor.TYPE_WAKE_GESTURE ||
- type == Sensor.TYPE_GLANCE_GESTURE || type == Sensor.TYPE_PICK_UP_GESTURE) {
+ type == Sensor.TYPE_GLANCE_GESTURE || type == Sensor.TYPE_PICK_UP_GESTURE ||
+ type == Sensor.TYPE_WRIST_TILT_GESTURE) {
wakeUpSensor = true;
}
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;
}
diff --git a/core/java/android/view/WindowManagerPolicy.java b/core/java/android/view/WindowManagerPolicy.java
index b8e94ee..780ca99 100644
--- a/core/java/android/view/WindowManagerPolicy.java
+++ b/core/java/android/view/WindowManagerPolicy.java
@@ -17,6 +17,7 @@
package android.view;
import android.annotation.IntDef;
+import android.annotation.SystemApi;
import android.content.Context;
import android.content.pm.ActivityInfo;
import android.content.res.CompatibilityInfo;
@@ -105,6 +106,13 @@ public interface WindowManagerPolicy {
public final static String EXTRA_HDMI_PLUGGED_STATE = "state";
/**
+ * Set to {@code true} when intent was invoked from pressing the home key.
+ * @hide
+ */
+ @SystemApi
+ public static final String EXTRA_FROM_HOME_KEY = "android.intent.extra.FROM_HOME_KEY";
+
+ /**
* Pass this event to the user / app. To be returned from
* {@link #interceptKeyBeforeQueueing}.
*/