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

Commit 8d8f8e91 authored by Thiébaud Weksteen's avatar Thiébaud Weksteen
Browse files

Disable DynamicCodeLoggerIntegrationTests if not supported

Bug: 403391929
Bug: 439550313
Test: atest DynamicCodeLoggerIntegrationTests on build with flag enabled
Flag: com.android.server.flags.dynamic_code_logging_service_removal
Change-Id: If2f3f680662565a81e6b32b1db7f935c3f81a15a
parent 2b995c7a
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -48,6 +48,9 @@ android_test {
    static_libs: [
    static_libs: [
        "androidx.test.rules",
        "androidx.test.rules",
        "truth",
        "truth",
        "flag-junit",
        "platform-test-annotations",
        "com.android.server.flags.services-aconfig-java",
    ],
    ],


    compile_multilib: "both",
    compile_multilib: "both",
+11 −0
Original line number Original line Diff line number Diff line
@@ -27,16 +27,22 @@ import android.content.pm.PackageManager;
import android.os.Build;
import android.os.Build;
import android.os.ParcelFileDescriptor;
import android.os.ParcelFileDescriptor;
import android.os.SystemClock;
import android.os.SystemClock;
import android.platform.test.annotations.RequiresFlagsDisabled;
import android.platform.test.flag.junit.CheckFlagsRule;
import android.platform.test.flag.junit.DeviceFlagsValueProvider;
import android.util.EventLog;
import android.util.EventLog;
import android.util.EventLog.Event;
import android.util.EventLog.Event;


import androidx.test.filters.LargeTest;
import androidx.test.filters.LargeTest;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.platform.app.InstrumentationRegistry;


import com.android.server.flags.Flags;

import dalvik.system.DexClassLoader;
import dalvik.system.DexClassLoader;


import org.junit.Before;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.BeforeClass;
import org.junit.Rule;
import org.junit.Test;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import org.junit.runners.JUnit4;
@@ -67,6 +73,7 @@ import java.util.concurrent.TimeUnit;
 */
 */
@LargeTest
@LargeTest
@RunWith(JUnit4.class)
@RunWith(JUnit4.class)
@RequiresFlagsDisabled(Flags.FLAG_DYNAMIC_CODE_LOGGING_SERVICE_REMOVAL)
public final class DynamicCodeLoggerIntegrationTests {
public final class DynamicCodeLoggerIntegrationTests {


    private static final String SHA_256 = "SHA-256";
    private static final String SHA_256 = "SHA-256";
@@ -89,6 +96,10 @@ public final class DynamicCodeLoggerIntegrationTests {
    private static final int AUDIT_LOG_RETRIES = 10;
    private static final int AUDIT_LOG_RETRIES = 10;
    private static final int RETRY_DELAY_MS = 500;
    private static final int RETRY_DELAY_MS = 500;


    @Rule
    public final CheckFlagsRule mCheckFlagsRule =
            DeviceFlagsValueProvider.createCheckFlagsRule();

    private static Context sContext;
    private static Context sContext;
    private static int sMyUid;
    private static int sMyUid;