Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2978f191 authored by Andrei Onea's avatar Andrei Onea
Browse files

Add @ChangeId for CTS test

Because CTS tests must run on user builds, the compat change for testing
android.app.compat.CompatChanges must be a legitimate one, gated on
targetSdk.

Bug: 149340016
Test: atest CtsAppCompatHostTestCases # on user build

Change-Id: I49985681f2022308419f7f7a1e4e4d4c0fe48315
parent a77fbc25
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package com.android.server.compat;

import android.annotation.Nullable;
import android.compat.annotation.ChangeId;
import android.compat.annotation.EnabledAfter;
import android.content.pm.ApplicationInfo;

@@ -38,6 +39,13 @@ import java.util.Map;
 */
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.

    /**
     * Callback listener for when compat changes are updated for a package.
     * See {@link #registerListener(ChangeListener)} for more details.