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

Commit 814eff1c authored by Zaiyue Xue's avatar Zaiyue Xue
Browse files

Fix the inverted logic to judge whether an app is system app.

Bug: 264626206
Fix: 264626206
Test: maunal
Change-Id: I3750e3b11e444add27243c492cf8968373cd57d0
parent c1f72222
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -1826,8 +1826,7 @@ public final class DataProcessor {
        if (appEntry == null || appEntry.info == null) {
            return false;
        }
        return !ApplicationsState.FILTER_DOWNLOADED_AND_LAUNCHER_AND_INSTANT.filterApp(
                appEntry);
        return ApplicationsState.FILTER_DOWNLOADED_AND_LAUNCHER_AND_INSTANT.filterApp(appEntry);
    }

    private static boolean shouldShowBatteryAttributionList(final Context context) {
+3 −2
Original line number Diff line number Diff line
@@ -1660,7 +1660,8 @@ public final class DataProcessorTest {
                batteryHistEntry);
        doReturn(mAppEntry).when(mApplicationsState).getEntry(anyString(), anyInt());
        mAppEntry.info = mApplicationInfo;
        mApplicationInfo.flags = ApplicationInfo.FLAG_SYSTEM;
        mApplicationInfo.flags =
                ApplicationInfo.FLAG_SYSTEM | ApplicationInfo.FLAG_UPDATED_SYSTEM_APP;

        boolean needsCombineInSystemApp = DataProcessor.needsCombineInSystemApp(
                batteryDiffEntry, List.of(), mApplicationsState);
@@ -1690,7 +1691,7 @@ public final class DataProcessorTest {
                batteryHistEntry);
        doReturn(mAppEntry).when(mApplicationsState).getEntry(anyString(), anyInt());
        mAppEntry.info = mApplicationInfo;
        mApplicationInfo.flags = 0;
        mApplicationInfo.flags = ApplicationInfo.FLAG_SYSTEM;

        boolean needsCombineInSystemApp = DataProcessor.needsCombineInSystemApp(
                batteryDiffEntry, List.of(), mApplicationsState);