Merge "Unbreak even more APK 26 apps running on "O" preview/beta builds." into oc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
997042ac33
@@ -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.");
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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()");
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user