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

Commit 1a253baa authored by Calvin Pan's avatar Calvin Pan
Browse files

Avoid getting app locale config for each app

Getting app locale config will spend a lot of time. Removing the log
to prevent getting locale-config for each system app.

Bug: 232557302
Test: Saving about 80% under java stack tracing mode
Change-Id: I2e755286a4e493be7fd73028ade8d190f6571e46
parent 98fa9deb
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -49,17 +49,17 @@ public class AppLocaleUtil {
        boolean isDisallowedPackage = isDisallowedPackage(context, packageName);
        boolean hasLauncherEntry = hasLauncherEntry(packageName, infos);
        boolean isSignedWithPlatformKey = isSignedWithPlatformKey(context, packageName);
        boolean isAppLocaleSupported = isAppLocaleSupported(context, packageName);
        boolean canDisplay = !isDisallowedPackage
                && !isSignedWithPlatformKey
                && hasLauncherEntry
                && isAppLocaleSupported(context, packageName);

        Log.i(TAG, "Can display preference - [" + packageName + "] :"
                + " isDisallowedPackage : " + isDisallowedPackage
                + " / isSignedWithPlatformKey : " + isSignedWithPlatformKey
                + " / hasLauncherEntry : " + hasLauncherEntry
                + " / isAppLocaleSupported : " + isAppLocaleSupported);

        return !isDisallowedPackage
                && !isSignedWithPlatformKey
                && hasLauncherEntry
                && isAppLocaleSupported;
                + " / canDisplay : " + canDisplay);
        return canDisplay;
    }

    private static boolean isDisallowedPackage(Context context, String packageName) {