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

Commit 937ffc17 authored by Dianne Hackborn's avatar Dianne Hackborn Committed by Android (Google) Code Review
Browse files

Merge "Fix issue #5180553: permission RECEIVE_BOOT_COMPLETED is not checked"

parents 53bd7030 d99b293d
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -114,6 +114,11 @@ public class ResolveInfo implements Parcelable {
     */
    public String resolvePackageName;

    /**
     * @hide Target comes from system process?
     */
    public boolean system;

    /**
     * Retrieve the current textual label associated with this resolution.  This
     * will call back on the given PackageManager to load the label from
@@ -261,6 +266,7 @@ public class ResolveInfo implements Parcelable {
        TextUtils.writeToParcel(nonLocalizedLabel, dest, parcelableFlags);
        dest.writeInt(icon);
        dest.writeString(resolvePackageName);
        dest.writeInt(system ? 1 : 0);
    }

    public static final Creator<ResolveInfo> CREATOR
@@ -300,6 +306,7 @@ public class ResolveInfo implements Parcelable {
                = TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(source);
        icon = source.readInt();
        resolvePackageName = source.readString();
        system = source.readInt() != 0;
    }
    
    public static class DisplayNameComparator
+3 −2
Original line number Diff line number Diff line
@@ -12018,6 +12018,7 @@ public final class ActivityManagerService extends ActivityManagerNative
            while (mParallelBroadcasts.size() > 0) {
                r = mParallelBroadcasts.remove(0);
                r.dispatchTime = SystemClock.uptimeMillis();
                r.dispatchClockTime = System.currentTimeMillis();
                final int N = r.receivers.size();
                if (DEBUG_BROADCAST_LIGHT) Slog.v(TAG, "Processing parallel broadcast "
                        + r);
@@ -12156,7 +12157,7 @@ public final class ActivityManagerService extends ActivityManagerNative
            r.receiverTime = SystemClock.uptimeMillis();
            if (recIdx == 0) {
                r.dispatchTime = r.receiverTime;
                r.dispatchClockTime = System.currentTimeMillis();
                if (DEBUG_BROADCAST_LIGHT) Slog.v(TAG, "Processing ordered broadcast "
                        + r);
            }
@@ -12217,7 +12218,7 @@ public final class ActivityManagerService extends ActivityManagerNative
                }
                skip = true;
            }
            if (r.callingUid != Process.SYSTEM_UID &&
            if (info.activityInfo.applicationInfo.uid != Process.SYSTEM_UID &&
                r.requiredPermission != null) {
                try {
                    perm = AppGlobals.getPackageManager().
+4 −0
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@ import android.util.PrintWriterPrinter;
import android.util.TimeUtils;

import java.io.PrintWriter;
import java.util.Date;
import java.util.List;

/**
@@ -47,6 +48,7 @@ class BroadcastRecord extends Binder {
    final List receivers;   // contains BroadcastFilter and ResolveInfo
    IIntentReceiver resultTo; // who receives final result if non-null
    long dispatchTime;      // when dispatch started on this set of receivers
    long dispatchClockTime; // the clock time the dispatch started
    long receiverTime;      // when current receiver started for timeouts.
    long finishTime;        // when we finished the broadcast.
    int resultCode;         // current result code value.
@@ -91,6 +93,8 @@ class BroadcastRecord extends Binder {
        if (requiredPermission != null) {
            pw.print(prefix); pw.print("requiredPermission="); pw.println(requiredPermission);
        }
        pw.print(prefix); pw.print("dispatchClockTime=");
                pw.println(new Date(dispatchClockTime));
        pw.print(prefix); pw.print("dispatchTime=");
                TimeUtils.formatDuration(dispatchTime, now, pw);
        if (finishTime != 0) {
+9 −1
Original line number Diff line number Diff line
@@ -4340,6 +4340,7 @@ public class PackageManagerService extends IPackageManager.Stub {
            res.labelRes = info.labelRes;
            res.nonLocalizedLabel = info.nonLocalizedLabel;
            res.icon = info.icon;
            res.system = isSystemApp(res.activityInfo.applicationInfo);
            return res;
        }

@@ -4512,6 +4513,7 @@ public class PackageManagerService extends IPackageManager.Stub {
            res.labelRes = info.labelRes;
            res.nonLocalizedLabel = info.nonLocalizedLabel;
            res.icon = info.icon;
            res.system = isSystemApp(res.serviceInfo.applicationInfo);
            return res;
        }

@@ -4569,7 +4571,13 @@ public class PackageManagerService extends IPackageManager.Stub {
            v1 = r1.match;
            v2 = r2.match;
            //System.out.println("Comparing: m1=" + m1 + " m2=" + m2);
            return (v1 > v2) ? -1 : ((v1 < v2) ? 1 : 0);
            if (v1 != v2) {
                return (v1 > v2) ? -1 : 1;
            }
            if (r1.system != r2.system) {
                return r1.system ? -1 : 1;
            }
            return 0;
        }
    };