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

Commit 256c3147 authored by Suprabh Shukla's avatar Suprabh Shukla
Browse files

Cleaning up pm SuspendPackagesTest

Removing all tests that are duplicated in CtsSuspendAppsTestCases. The
only remaining tests are testing launcher apps or app-ops. Currently,
these cannot be tested in CTS.

Fixed some bugs in package filtering implementation that broke the
callbacks

Test: atest FrameworksServicesTests:SuspendPackagesTest

Bug: 206578343
Change-Id: I636c1be44bdb175213efa8608fa336c83859f7c9
parent 1dea627d
Loading
Loading
Loading
Loading
+5 −7
Original line number Diff line number Diff line
@@ -1648,14 +1648,12 @@ public class LauncherAppsService extends SystemService {
                            continue;
                        }
                        final String[] filteredPackagesWithoutExtras =
                                getFilteredPackageNames(packages, cookie);
                        // If all packages are filtered, skip notifying listener.
                        if (ArrayUtils.isEmpty(filteredPackagesWithoutExtras)) {
                            continue;
                        }
                                getFilteredPackageNames(packagesNullExtras, cookie);
                        try {
                            if (!ArrayUtils.isEmpty(filteredPackagesWithoutExtras)) {
                                listener.onPackagesSuspended(user, filteredPackagesWithoutExtras,
                                        /* launcherExtras= */ null);
                            }
                            for (int idx = 0; idx < packagesWithExtras.size(); idx++) {
                                Pair<String, Bundle> packageExtraPair = packagesWithExtras.get(idx);
                                if (!isPackageVisibleToListener(packageExtraPair.first, cookie)) {
+4 −0
Original line number Diff line number Diff line
@@ -97,6 +97,10 @@
    <uses-permission
        android:name="android.permission.OVERRIDE_COMPAT_CHANGE_CONFIG_ON_RELEASE_BUILD"/>

    <queries>
        <package android:name="com.android.servicestests.apps.suspendtestapp" />
    </queries>

    <!-- Uses API introduced in O (26) -->
    <uses-sdk android:minSdkVersion="1"
         android:targetSdkVersion="26"/>
+10 −316

File changed.

Preview size limit exceeded, changes collapsed.