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

Commit b3e91736 authored by John Wu's avatar John Wu Committed by Android (Google) Code Review
Browse files

Merge "Update Intent#resolveTypeIfNeeded() for intent filter matching"

parents 13b0aa2a 19da953e
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@ import android.annotation.SdkConstant.SdkConstantType;
import android.annotation.SuppressLint;
import android.annotation.SystemApi;
import android.annotation.TestApi;
import android.app.ActivityThread;
import android.app.AppGlobals;
import android.bluetooth.BluetoothDevice;
import android.compat.annotation.UnsupportedAppUsage;
@@ -8281,7 +8282,10 @@ public class Intent implements Parcelable, Cloneable {
     *         needed.
     */
    public @Nullable String resolveTypeIfNeeded(@NonNull ContentResolver resolver) {
        if (mComponent != null) {
        // Match logic in PackageManagerService#applyEnforceIntentFilterMatching(...)
        if (mComponent != null && (Process.myUid() == Process.ROOT_UID
                || Process.myUid() == Process.SYSTEM_UID
                || mComponent.getPackageName().equals(ActivityThread.currentPackageName()))) {
            return mType;
        }
        return resolveType(resolver);