Loading core/java/android/app/Activity.java +2 −2 Original line number Diff line number Diff line Loading @@ -16,7 +16,7 @@ package android.app; import static android.os.Build.VERSION_CODES.O; import static android.os.Build.VERSION_CODES.O_MR1; import static java.lang.Character.MIN_VALUE; Loading Loading @@ -973,7 +973,7 @@ public class Activity extends ContextThemeWrapper protected void onCreate(@Nullable Bundle savedInstanceState) { if (DEBUG_LIFECYCLE) Slog.v(TAG, "onCreate " + this + ": " + savedInstanceState); if (getApplicationInfo().targetSdkVersion > O && mActivityInfo.isFixedOrientation()) { if (getApplicationInfo().targetSdkVersion >= O_MR1 && mActivityInfo.isFixedOrientation()) { final TypedArray ta = obtainStyledAttributes(com.android.internal.R.styleable.Window); final boolean isTranslucentOrFloating = ActivityInfo.isTranslucentOrFloating(ta); ta.recycle(); Loading services/core/java/com/android/server/am/ActivityRecord.java +2 −1 Original line number Diff line number Diff line Loading @@ -74,6 +74,7 @@ import static android.content.res.Configuration.UI_MODE_TYPE_MASK; import static android.content.res.Configuration.UI_MODE_TYPE_VR_HEADSET; import static android.os.Build.VERSION_CODES.HONEYCOMB; import static android.os.Build.VERSION_CODES.O; import static android.os.Build.VERSION_CODES.O_MR1; import static android.os.Process.SYSTEM_UID; import static android.os.Trace.TRACE_TAG_ACTIVITY_MANAGER; import static android.view.WindowManagerPolicy.NAV_BAR_LEFT; Loading Loading @@ -2171,7 +2172,7 @@ final class ActivityRecord extends ConfigurationContainer implements AppWindowCo void setRequestedOrientation(int requestedOrientation) { if (ActivityInfo.isFixedOrientation(requestedOrientation) && !fullscreen && appInfo.targetSdkVersion > O) { && appInfo.targetSdkVersion >= O_MR1) { throw new IllegalStateException("Only fullscreen activities can request orientation"); } Loading services/core/java/com/android/server/wm/AppWindowToken.java +4 −3 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ import static android.content.pm.ActivityInfo.CONFIG_ORIENTATION; import static android.content.pm.ActivityInfo.CONFIG_SCREEN_SIZE; import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_BEHIND; import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_UNSET; import static android.os.Build.VERSION_CODES.O_MR1; import static android.view.Display.DEFAULT_DISPLAY; import static android.view.WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD; import static android.view.WindowManager.LayoutParams.FLAG_SECURE; Loading Loading @@ -1293,11 +1294,11 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree */ @Override int getOrientation(int candidate) { // We do not allow non-fullscreen apps to influence orientation beyond O. While we do // throw an exception in {@link Activity#onCreate} and // We do not allow non-fullscreen apps to influence orientation starting in O-MR1. While we // do throw an exception in {@link Activity#onCreate} and // {@link Activity#setRequestedOrientation}, we also ignore the orientation here so that // other calculations aren't affected. if (!fillsParent() && mTargetSdk > O) { if (!fillsParent() && mTargetSdk >= O_MR1) { // Can't specify orientation if app doesn't fill parent. return SCREEN_ORIENTATION_UNSET; } Loading Loading
core/java/android/app/Activity.java +2 −2 Original line number Diff line number Diff line Loading @@ -16,7 +16,7 @@ package android.app; import static android.os.Build.VERSION_CODES.O; import static android.os.Build.VERSION_CODES.O_MR1; import static java.lang.Character.MIN_VALUE; Loading Loading @@ -973,7 +973,7 @@ public class Activity extends ContextThemeWrapper protected void onCreate(@Nullable Bundle savedInstanceState) { if (DEBUG_LIFECYCLE) Slog.v(TAG, "onCreate " + this + ": " + savedInstanceState); if (getApplicationInfo().targetSdkVersion > O && mActivityInfo.isFixedOrientation()) { if (getApplicationInfo().targetSdkVersion >= O_MR1 && mActivityInfo.isFixedOrientation()) { final TypedArray ta = obtainStyledAttributes(com.android.internal.R.styleable.Window); final boolean isTranslucentOrFloating = ActivityInfo.isTranslucentOrFloating(ta); ta.recycle(); Loading
services/core/java/com/android/server/am/ActivityRecord.java +2 −1 Original line number Diff line number Diff line Loading @@ -74,6 +74,7 @@ import static android.content.res.Configuration.UI_MODE_TYPE_MASK; import static android.content.res.Configuration.UI_MODE_TYPE_VR_HEADSET; import static android.os.Build.VERSION_CODES.HONEYCOMB; import static android.os.Build.VERSION_CODES.O; import static android.os.Build.VERSION_CODES.O_MR1; import static android.os.Process.SYSTEM_UID; import static android.os.Trace.TRACE_TAG_ACTIVITY_MANAGER; import static android.view.WindowManagerPolicy.NAV_BAR_LEFT; Loading Loading @@ -2171,7 +2172,7 @@ final class ActivityRecord extends ConfigurationContainer implements AppWindowCo void setRequestedOrientation(int requestedOrientation) { if (ActivityInfo.isFixedOrientation(requestedOrientation) && !fullscreen && appInfo.targetSdkVersion > O) { && appInfo.targetSdkVersion >= O_MR1) { throw new IllegalStateException("Only fullscreen activities can request orientation"); } Loading
services/core/java/com/android/server/wm/AppWindowToken.java +4 −3 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ import static android.content.pm.ActivityInfo.CONFIG_ORIENTATION; import static android.content.pm.ActivityInfo.CONFIG_SCREEN_SIZE; import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_BEHIND; import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_UNSET; import static android.os.Build.VERSION_CODES.O_MR1; import static android.view.Display.DEFAULT_DISPLAY; import static android.view.WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD; import static android.view.WindowManager.LayoutParams.FLAG_SECURE; Loading Loading @@ -1293,11 +1294,11 @@ class AppWindowToken extends WindowToken implements WindowManagerService.AppFree */ @Override int getOrientation(int candidate) { // We do not allow non-fullscreen apps to influence orientation beyond O. While we do // throw an exception in {@link Activity#onCreate} and // We do not allow non-fullscreen apps to influence orientation starting in O-MR1. While we // do throw an exception in {@link Activity#onCreate} and // {@link Activity#setRequestedOrientation}, we also ignore the orientation here so that // other calculations aren't affected. if (!fillsParent() && mTargetSdk > O) { if (!fillsParent() && mTargetSdk >= O_MR1) { // Can't specify orientation if app doesn't fill parent. return SCREEN_ORIENTATION_UNSET; } Loading