Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f383c247 authored by Jeff Sharkey's avatar Jeff Sharkey
Browse files

Unbreak even more APK 26 apps running on "O" preview/beta builds.

Bug: 38391358
Test: builds
Change-Id: Ic48f9cb53da3ed8241e5d40d3096304ee4dfebd2
parent dc6da8b4
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -856,7 +856,7 @@ public class SurfaceView extends View implements ViewRootImpl.WindowStoppedCallb
     */
    @Deprecated
    public void setWindowType(int type) {
        if (getContext().getApplicationInfo().targetSdkVersion > Build.VERSION_CODES.N_MR1) {
        if (getContext().getApplicationInfo().targetSdkVersion >= Build.VERSION_CODES.O) {
            throw new UnsupportedOperationException(
                    "SurfaceView#setWindowType() has never been a public API.");
        }
+1 −1
Original line number Diff line number Diff line
@@ -334,7 +334,7 @@ public final class ViewTreeObserver {
     */
    ViewTreeObserver(Context context) {
        sIllegalOnDrawModificationIsFatal =
                context.getApplicationInfo().targetSdkVersion > Build.VERSION_CODES.N_MR1;
                context.getApplicationInfo().targetSdkVersion >= Build.VERSION_CODES.O;
    }

    /**
+1 −2
Original line number Diff line number Diff line
@@ -83,8 +83,7 @@ public class UserPackage {
     * supported by the current framework version.
     */
    public static boolean hasCorrectTargetSdkVersion(PackageInfo packageInfo) {
        // TODO(gsennton) use Build.VERSION_CODES.O when that has been updated.
        return packageInfo.applicationInfo.targetSdkVersion > Build.VERSION_CODES.N_MR1;
        return packageInfo.applicationInfo.targetSdkVersion >= Build.VERSION_CODES.O;
    }

    public UserInfo getUserInfo() {
+2 −2
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@

package android.widget;

import static android.os.Build.VERSION_CODES.N_MR1;
import static android.os.Build.VERSION_CODES.O;

import android.annotation.Nullable;
import android.content.Context;
@@ -302,7 +302,7 @@ class DayPickerView extends ViewGroup {
        getTempCalendarForTime(timeInMillis);

        final int targetSdkVersion = mContext.getApplicationInfo().targetSdkVersion;
        if (targetSdkVersion > N_MR1) {
        if (targetSdkVersion >= O) {
            if (mTempCalendar.before(mMinDate) || mTempCalendar.after(mMaxDate)) {
                throw new IllegalArgumentException("timeInMillis must be between the values of "
                        + "getMinDate() and getMaxDate()");
+2 −2
Original line number Diff line number Diff line
@@ -1521,7 +1521,7 @@ public class WindowManagerService extends IWindowManager.Stub
        // Try using the target SDK of the root window
        if (attachedWindow != null) {
            return attachedWindow.mAppToken != null
                    && attachedWindow.mAppToken.mTargetSdk > Build.VERSION_CODES.N_MR1;
                    && attachedWindow.mAppToken.mTargetSdk >= Build.VERSION_CODES.O;
        } else {
            // Otherwise, look at the package
            try {
@@ -1532,7 +1532,7 @@ public class WindowManagerService extends IWindowManager.Stub
                    throw new SecurityException("Package " + packageName + " not in UID "
                            + callingUid);
                }
                if (appInfo.targetSdkVersion > Build.VERSION_CODES.N_MR1) {
                if (appInfo.targetSdkVersion >= Build.VERSION_CODES.O) {
                    return true;
                }
            } catch (PackageManager.NameNotFoundException e) {