summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
Diffstat (limited to 'services')
-rw-r--r--services/java/com/android/server/WindowManagerService.java20
1 files changed, 20 insertions, 0 deletions
diff --git a/services/java/com/android/server/WindowManagerService.java b/services/java/com/android/server/WindowManagerService.java
index dbc7f48..41b3da6 100644
--- a/services/java/com/android/server/WindowManagerService.java
+++ b/services/java/com/android/server/WindowManagerService.java
@@ -4842,6 +4842,26 @@ public class WindowManagerService extends IWindowManager.Stub
}
}
+ public void freezeRotation() {
+ if (!checkCallingPermission(android.Manifest.permission.SET_ORIENTATION,
+ "setRotation()")) {
+ throw new SecurityException("Requires SET_ORIENTATION permission");
+ }
+
+ mPolicy.setUserRotationMode(WindowManagerPolicy.USER_ROTATION_LOCKED, mRotation);
+ setRotationUnchecked(WindowManagerPolicy.USE_LAST_ROTATION, false, 0);
+ }
+
+ public void thawRotation() {
+ if (!checkCallingPermission(android.Manifest.permission.SET_ORIENTATION,
+ "setRotation()")) {
+ throw new SecurityException("Requires SET_ORIENTATION permission");
+ }
+
+ mPolicy.setUserRotationMode(WindowManagerPolicy.USER_ROTATION_FREE, 0);
+ setRotationUnchecked(WindowManagerPolicy.USE_LAST_ROTATION, false, 0);
+ }
+
public void setRotation(int rotation,
boolean alwaysSendConfiguration, int animFlags) {
if (!checkCallingPermission(android.Manifest.permission.SET_ORIENTATION,