OSDN Git Service

Update references to O MR1 to proper codename.
authorBryce Lee <brycelee@google.com>
Thu, 10 Aug 2017 21:59:00 +0000 (14:59 -0700)
committerBryce Lee <brycelee@google.com>
Thu, 10 Aug 2017 22:01:53 +0000 (15:01 -0700)
Bug: 38225467
Test: manual
Change-Id: I5ae29e5763967f6a752f720e043ccb1ceb57e311

core/java/android/app/Activity.java
services/core/java/com/android/server/am/ActivityRecord.java
services/core/java/com/android/server/wm/AppWindowToken.java

index adb3152..b2fd169 100644 (file)
@@ -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;
 
@@ -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();
index 7a19cc3..76ed800 100644 (file)
@@ -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;
@@ -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");
         }
 
index 2e4de8c..46049f5 100644 (file)
@@ -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;
@@ -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;
         }