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

Commit 52c62344 authored by Dianne Hackborn's avatar Dianne Hackborn
Browse files

Fix issue #7213113: Remove old intent resolver

Also make the query package restart broadcast protected like the
documentation says it should be.

Change-Id: I445166111318a02f2f2b1ab0dff9c641a441c20b
parent 6de76d21
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -257,7 +257,7 @@ public class AppSecurityPermissions {
        try {
            pkgInfo = mPm.getPackageInfo(packageName, PackageManager.GET_PERMISSIONS);
        } catch (NameNotFoundException e) {
            Log.w(TAG, "Could'nt retrieve permissions for package:"+packageName);
            Log.w(TAG, "Couldn't retrieve permissions for package:"+packageName);
            return;
        }
        // Extract all user permissions
+1 −0
Original line number Diff line number Diff line
@@ -45,6 +45,7 @@
    <protected-broadcast android:name="android.intent.action.PACKAGE_NEEDS_VERIFICATION" />
    <protected-broadcast android:name="android.intent.action.PACKAGE_VERIFIED" />
    <protected-broadcast android:name="android.intent.action.UID_REMOVED" />
    <protected-broadcast android:name="android.intent.action.QUERY_PACKAGE_RESTART" />
    <protected-broadcast android:name="android.intent.action.CONFIGURATION_CHANGED" />
    <protected-broadcast android:name="android.intent.action.LOCALE_CHANGED" />
    <protected-broadcast android:name="android.intent.action.BATTERY_CHANGED" />
+1 −1
Original line number Diff line number Diff line
@@ -3141,7 +3141,7 @@

    <!-- Security Permissions strings-->
    <!-- Text that is placed at the front of a permission name that is being added to an app [CHAR LIMIT=NONE] -->
    <string name="perms_new_perm_prefix"><font size="12" fgcolor="#ff900000">NEW: </font></string>
    <string name="perms_new_perm_prefix"><font size="12" fgcolor="#ff33b5e5">NEW: </font></string>
    <!-- Text that is placed at the front of a permission name that is being added to an app [CHAR LIMIT=NONE] -->
    <string name="perms_description_app">Provided by <xliff:g id="app_name">%1$s</xliff:g>.</string>
    <!-- Shown for an application when it doesn't require any permission grants. -->
+17 −10
Original line number Diff line number Diff line
@@ -46,6 +46,7 @@ public abstract class IntentResolver<F extends IntentFilter, R extends Object> {
    final private static String TAG = "IntentResolver";
    final private static boolean DEBUG = false;
    final private static boolean localLOGV = DEBUG || false;
    final private static boolean VALIDATE = false;

    public void addFilter(F f) {
        if (localLOGV) {
@@ -67,17 +68,21 @@ public abstract class IntentResolver<F extends IntentFilter, R extends Object> {
                    mTypedActionToFilter, "      TypedAction: ");
        }

        if (VALIDATE) {
            mOldResolver.addFilter(f);
            verifyDataStructures(f);
        }
    }

    public void removeFilter(F f) {
        removeFilterInternal(f);
        mFilters.remove(f);

        if (VALIDATE) {
            mOldResolver.removeFilter(f);
            verifyDataStructures(f);
        }
    }

    void removeFilterInternal(F f) {
        if (localLOGV) {
@@ -314,6 +319,7 @@ public abstract class IntentResolver<F extends IntentFilter, R extends Object> {
        }
        sortResults(finalList);

        if (VALIDATE) {
            List<R> oldList = mOldResolver.queryIntent(intent, resolvedType, defaultOnly, userId);
            if (oldList.size() != finalList.size()) {
                ValidationFailure here = new ValidationFailure();
@@ -321,6 +327,7 @@ public abstract class IntentResolver<F extends IntentFilter, R extends Object> {
                Log.wtf(TAG, "Query result " + intent + " size is " + finalList.size()
                        + "; old implementation is " + oldList.size(), here);
            }
        }

        if (debug) {
            Slog.v(TAG, "Final result list:");