@@ -375,12 +375,6 @@ public void computeFrameLw(Rect parentFrame, Rect displayFrame,
375375 /** Screen turned off because of proximity sensor */
376376 public final int OFF_BECAUSE_OF_PROX_SENSOR = 4 ;
377377
378- /**
379- * Magic constant to {@link IWindowManager#setRotation} to not actually
380- * modify the rotation.
381- */
382- public final int USE_LAST_ROTATION = -1000 ;
383-
384378 /** When not otherwise specified by the activity's screenOrientation, rotation should be
385379 * determined by the system (that is, using sensors). */
386380 public final int USER_ROTATION_FREE = 0 ;
@@ -856,22 +850,30 @@ interface OnKeyguardExitResult {
856850 public boolean inKeyguardRestrictedKeyInputMode ();
857851
858852 /**
859- * Given an orientation constant
860- * ({@link android.content.pm.ActivityInfo#SCREEN_ORIENTATION_LANDSCAPE
861- * ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE} or
862- * {@link android.content.pm.ActivityInfo#SCREEN_ORIENTATION_PORTRAIT
863- * ActivityInfo.SCREEN_ORIENTATION_PORTRAIT}), return a surface
864- * rotation.
853+ * Given an orientation constant, returns the appropriate surface rotation,
854+ * taking into account sensors, docking mode, rotation lock, and other factors.
855+ *
856+ * @param orientation An orientation constant, such as
857+ * {@link android.content.pm.ActivityInfo#SCREEN_ORIENTATION_LANDSCAPE}.
858+ * @param lastRotation The most recently used rotation.
859+ * @return The surface rotation to use.
865860 */
866- public int rotationForOrientationLw (int orientation , int lastRotation ,
867- boolean displayEnabled );
868-
861+ public int rotationForOrientationLw (int orientation , int lastRotation );
862+
869863 /**
870- * Return the currently locked screen rotation, if any. Return
871- * Surface.ROTATION_0, Surface.ROTATION_90, Surface.ROTATION_180, or
872- * Surface.ROTATION_270 if locked; return -1 if not locked.
864+ * Given an orientation constant and a rotation, returns true if the rotation
865+ * has compatible metrics to the requested orientation. For example, if
866+ * the application requested landscape and got seascape, then the rotation
867+ * has compatible metrics; if the application requested portrait and got landscape,
868+ * then the rotation has incompatible metrics; if the application did not specify
869+ * a preference, then anything goes.
870+ *
871+ * @param orientation An orientation constant, such as
872+ * {@link android.content.pm.ActivityInfo#SCREEN_ORIENTATION_LANDSCAPE}.
873+ * @param rotation The rotation to check.
874+ * @return True if the rotation is compatible with the requested orientation.
873875 */
874- public int getLockedRotationLw ( );
876+ public boolean rotationHasCompatibleMetricsLw ( int orientation , int rotation );
875877
876878 /**
877879 * Called when the system is mostly done booting to determine whether
0 commit comments