Merge "Unbreak even more APK 26 apps running on "O" preview/beta builds." into oc-dev

am: 997042ac33

Change-Id: I6da01817370fa1244499644497396a57e55df492
This commit is contained in:
Jeff Sharkey
2017-05-18 16:02:49 +00:00
committed by android-build-merger
5 changed files with 7 additions and 8 deletions

View File

@@ -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.");
}

View File

@@ -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;
}
/**

View File

@@ -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() {

View File

@@ -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()");

View File

@@ -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) {