Java Code Examples for android.content.pm.ActivityInfo#ScreenOrientation

The following examples show how to use android.content.pm.ActivityInfo#ScreenOrientation .
Example 1
Project: android_9.0.0_r45   File: WindowManagerPolicy.java    License: Apache License 2.0 2 votes vote down vote up
/**
 * Given an orientation constant, returns the appropriate surface rotation,
 * taking into account sensors, docking mode, rotation lock, and other factors.
 *
 * @param orientation An orientation constant, such as
 * {@link android.content.pm.ActivityInfo#SCREEN_ORIENTATION_LANDSCAPE}.
 * @param lastRotation The most recently used rotation.
 * @param defaultDisplay Flag indicating whether the rotation is computed for the default
 *                       display. Currently for all non-default displays sensors, docking mode,
 *                       rotation lock and other factors are ignored.
 * @return The surface rotation to use.
 */
public int rotationForOrientationLw(@ActivityInfo.ScreenOrientation int orientation,
        int lastRotation, boolean defaultDisplay);
 
Example 2
Project: android_9.0.0_r45   File: WindowManagerPolicy.java    License: Apache License 2.0 2 votes vote down vote up
/**
 * Given an orientation constant and a rotation, returns true if the rotation
 * has compatible metrics to the requested orientation.  For example, if
 * the application requested landscape and got seascape, then the rotation
 * has compatible metrics; if the application requested portrait and got landscape,
 * then the rotation has incompatible metrics; if the application did not specify
 * a preference, then anything goes.
 *
 * @param orientation An orientation constant, such as
 * {@link android.content.pm.ActivityInfo#SCREEN_ORIENTATION_LANDSCAPE}.
 * @param rotation The rotation to check.
 * @return True if the rotation is compatible with the requested orientation.
 */
public boolean rotationHasCompatibleMetricsLw(@ActivityInfo.ScreenOrientation int orientation,
        int rotation);
 
Example 3
Project: android_9.0.0_r45   File: WindowManagerPolicy.java    License: Apache License 2.0 votes vote down vote up
public void setCurrentOrientationLw(@ActivityInfo.ScreenOrientation int newOrientation);