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

Commit fce7edf8 authored by Heemin Seog's avatar Heemin Seog
Browse files

Remove filter for automotive calsses in SysUI Tests

Bug: 112863499
Test: atest SystemUITests on sdk_gphone_x86
Change-Id: I4c07abb0a1306c704c7fdd62ecfc4efb7259ce73
parent 3dd11b79
Loading
Loading
Loading
Loading
+0 −14
Original line number Original line Diff line number Diff line
@@ -18,7 +18,6 @@ import static org.hamcrest.Matchers.empty;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertThat;


import android.content.pm.PackageManager;
import android.testing.AndroidTestingRunner;
import android.testing.AndroidTestingRunner;
import android.text.TextUtils;
import android.text.TextUtils;
import android.util.Log;
import android.util.Log;
@@ -117,12 +116,6 @@ public class AAAPlusPlusVerifySysuiRequiredTestPropertiesTest extends SysuiTestC
        filter.add(s -> s.startsWith("com.android.systemui")
        filter.add(s -> s.startsWith("com.android.systemui")
                || s.startsWith("com.android.keyguard"));
                || s.startsWith("com.android.keyguard"));



        if (!mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_AUTOMOTIVE)) {
            // If it's not automotive target, exclude automotive classes from the test.
            excludeAutomotiveClasses(filter);
        }

        try {
        try {
            return scanner.getClassPathEntries(filter);
            return scanner.getClassPathEntries(filter);
        } catch (IOException e) {
        } catch (IOException e) {
@@ -131,13 +124,6 @@ public class AAAPlusPlusVerifySysuiRequiredTestPropertiesTest extends SysuiTestC
        return Collections.emptyList();
        return Collections.emptyList();
    }
    }


    private void excludeAutomotiveClasses(ChainedClassNameFilter filter) {
        // Modifies the passed in filter.
        filter.add(s -> !s.startsWith("com.android.systemui.statusbar.car."));
        filter.add(s -> !s.startsWith("com.android.systemui.qs.car."));
        filter.add(s -> !s.startsWith("com.android.systemui.car."));
    }

    private String getClsStr() {
    private String getClsStr() {
        return TextUtils.join(",", Arrays.asList(BASE_CLS_WHITELIST)
        return TextUtils.join(",", Arrays.asList(BASE_CLS_WHITELIST)
                .stream().map(cls -> cls.getSimpleName()).toArray());
                .stream().map(cls -> cls.getSimpleName()).toArray());