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
|
@Deprecated
|
||||||
public void setWindowType(int type) {
|
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(
|
throw new UnsupportedOperationException(
|
||||||
"SurfaceView#setWindowType() has never been a public API.");
|
"SurfaceView#setWindowType() has never been a public API.");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -334,7 +334,7 @@ public final class ViewTreeObserver {
|
|||||||
*/
|
*/
|
||||||
ViewTreeObserver(Context context) {
|
ViewTreeObserver(Context context) {
|
||||||
sIllegalOnDrawModificationIsFatal =
|
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.
|
* supported by the current framework version.
|
||||||
*/
|
*/
|
||||||
public static boolean hasCorrectTargetSdkVersion(PackageInfo packageInfo) {
|
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.O;
|
||||||
return packageInfo.applicationInfo.targetSdkVersion > Build.VERSION_CODES.N_MR1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public UserInfo getUserInfo() {
|
public UserInfo getUserInfo() {
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
package android.widget;
|
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.annotation.Nullable;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
@@ -302,7 +302,7 @@ class DayPickerView extends ViewGroup {
|
|||||||
getTempCalendarForTime(timeInMillis);
|
getTempCalendarForTime(timeInMillis);
|
||||||
|
|
||||||
final int targetSdkVersion = mContext.getApplicationInfo().targetSdkVersion;
|
final int targetSdkVersion = mContext.getApplicationInfo().targetSdkVersion;
|
||||||
if (targetSdkVersion > N_MR1) {
|
if (targetSdkVersion >= O) {
|
||||||
if (mTempCalendar.before(mMinDate) || mTempCalendar.after(mMaxDate)) {
|
if (mTempCalendar.before(mMinDate) || mTempCalendar.after(mMaxDate)) {
|
||||||
throw new IllegalArgumentException("timeInMillis must be between the values of "
|
throw new IllegalArgumentException("timeInMillis must be between the values of "
|
||||||
+ "getMinDate() and getMaxDate()");
|
+ "getMinDate() and getMaxDate()");
|
||||||
|
|||||||
@@ -1521,7 +1521,7 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
// Try using the target SDK of the root window
|
// Try using the target SDK of the root window
|
||||||
if (attachedWindow != null) {
|
if (attachedWindow != null) {
|
||||||
return attachedWindow.mAppToken != null
|
return attachedWindow.mAppToken != null
|
||||||
&& attachedWindow.mAppToken.mTargetSdk > Build.VERSION_CODES.N_MR1;
|
&& attachedWindow.mAppToken.mTargetSdk >= Build.VERSION_CODES.O;
|
||||||
} else {
|
} else {
|
||||||
// Otherwise, look at the package
|
// Otherwise, look at the package
|
||||||
try {
|
try {
|
||||||
@@ -1532,7 +1532,7 @@ public class WindowManagerService extends IWindowManager.Stub
|
|||||||
throw new SecurityException("Package " + packageName + " not in UID "
|
throw new SecurityException("Package " + packageName + " not in UID "
|
||||||
+ callingUid);
|
+ callingUid);
|
||||||
}
|
}
|
||||||
if (appInfo.targetSdkVersion > Build.VERSION_CODES.N_MR1) {
|
if (appInfo.targetSdkVersion >= Build.VERSION_CODES.O) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
} catch (PackageManager.NameNotFoundException e) {
|
} catch (PackageManager.NameNotFoundException e) {
|
||||||
|
|||||||
Reference in New Issue
Block a user