Merge "Migrate CTS_SYSTEM_API_CHANGEID to @EnabledSince"

This commit is contained in:
Andrei-Valentin Onea
2020-11-02 16:01:29 +00:00
committed by Gerrit Code Review
2 changed files with 6 additions and 3 deletions

View File

@@ -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.

View File

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