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

Commit 9b0f9a2c authored by Tony Mantler's avatar Tony Mantler Committed by Android (Google) Code Review
Browse files

Merge "Tweak ApplicationsState for use by TvSettings" into mnc-dev

parents a46ccc16 bdbb5a8d
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -386,7 +386,7 @@ public class ApplicationsState {
        }
    }

    void removePackage(String pkgName, int userId) {
    public void removePackage(String pkgName, int userId) {
        synchronized (mEntriesMap) {
            if (DEBUG_LOCKING) Log.v(TAG, "removePackage acquired lock");
            int idx = indexOfApplicationInfoLocked(pkgName, userId);
@@ -1107,7 +1107,7 @@ public class ApplicationsState {
            ensureLabel(context);
        }

        void ensureLabel(Context context) {
        public void ensureLabel(Context context) {
            if (this.label == null || !this.mounted) {
                if (!this.apkFile.exists()) {
                    this.mounted = false;
@@ -1153,6 +1153,14 @@ public class ApplicationsState {
            return REMOVE_DIACRITICALS_PATTERN.matcher(tmp)
                    .replaceAll("").toLowerCase();
        }

        public String getVersion(Context context) {
            try {
                return context.getPackageManager().getPackageInfo(info.packageName, 0).versionName;
            } catch (PackageManager.NameNotFoundException e) {
                return "";
            }
        }
    }

    public static final Comparator<AppEntry> ALPHA_COMPARATOR = new Comparator<AppEntry>() {