Migrate CTS_SYSTEM_API_CHANGEID to @EnabledSince
The actual target sdk for this changeid is currently irrelevant; it does need to be larger than the target SDK of the CTS test app (to allow opting in), and invisible in dev UI. The latter was already the case, however made it explicit. Bug: 149103556 Bug: 149469819 Test: adb shell dumpsys platform_compat | grep CTS_SYSTEM_API_CHANGEID Change-Id: I64a10bb0964349eb212d26cf40e9f15ad2ba61da
This commit is contained in:
@@ -18,7 +18,7 @@ package com.android.server.compat;
|
||||
|
||||
import android.annotation.Nullable;
|
||||
import android.compat.annotation.ChangeId;
|
||||
import android.compat.annotation.EnabledAfter;
|
||||
import android.compat.annotation.EnabledSince;
|
||||
import android.content.pm.ApplicationInfo;
|
||||
|
||||
import com.android.internal.compat.CompatibilityChangeInfo;
|
||||
@@ -43,8 +43,8 @@ public final class CompatChange extends CompatibilityChangeInfo {
|
||||
* A change ID to be used only in the CTS test for this SystemApi
|
||||
*/
|
||||
@ChangeId
|
||||
@EnabledAfter(targetSdkVersion = 1234) // Needs to be > test APK targetSdkVersion.
|
||||
private static final long CTS_SYSTEM_API_CHANGEID = 149391281; // This is a bug id.
|
||||
@EnabledSince(targetSdkVersion = 1235) // Needs to be > test APK targetSdkVersion.
|
||||
static final long CTS_SYSTEM_API_CHANGEID = 149391281; // This is a bug id.
|
||||
|
||||
/**
|
||||
* Callback listener for when compat changes are updated for a package.
|
||||
|
||||
@@ -375,6 +375,9 @@ public class PlatformCompat extends IPlatformCompat.Stub {
|
||||
if (change.getLoggingOnly()) {
|
||||
return false;
|
||||
}
|
||||
if (change.getId() == CompatChange.CTS_SYSTEM_API_CHANGEID) {
|
||||
return false;
|
||||
}
|
||||
if (change.getEnableSinceTargetSdk() > 0) {
|
||||
if (change.getEnableSinceTargetSdk() < sMinTargetSdk
|
||||
|| change.getEnableSinceTargetSdk() > sMaxTargetSdk) {
|
||||
|
||||
Reference in New Issue
Block a user