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

The following examples show how to use android.content.pm.ActivityInfo#ScreenOrientation . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: WindowManagerPolicy.java    From android_9.0.0_r45 with 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
Source File: WindowManagerPolicy.java    From android_9.0.0_r45 with 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
Source File: WindowManagerPolicy.java    From android_9.0.0_r45 with Apache License 2.0 votes vote down vote up
public void setCurrentOrientationLw(@ActivityInfo.ScreenOrientation int newOrientation);