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

Commit 25b0bbb7 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Add new permission that lets incidentd call dropbox"

parents 6adfce55 8e566f33
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -4647,6 +4647,13 @@
                android:protectionLevel="normal" />
    <uses-permission android:name="android.permission.QUERY_ALL_PACKAGES"/>

    <!-- @hide Allow the caller to collect debugging data from processes that otherwise
        would require USAGE_STATS. Before sharing this data with other apps, holders
        of this permission are REQUIRED to themselves check that the caller has
        PACKAGE_USAGE_STATS and OP_GET_USAGE_STATS. -->
    <permission android:name="android.permission.PEEK_DROPBOX_DATA"
        android:protectionLevel="signature|privileged" />

    <application android:process="system"
                 android:persistent="true"
                 android:hasCode="false"
+1 −0
Original line number Diff line number Diff line
@@ -174,6 +174,7 @@
    <assign-permission name="android.permission.PACKAGE_USAGE_STATS" uid="incidentd" />
    <assign-permission name="android.permission.INTERACT_ACROSS_USERS" uid="incidentd" />
    <assign-permission name="android.permission.REQUEST_INCIDENT_REPORT_APPROVAL" uid="incidentd" />
    <assign-permission name="android.permission.PEEK_DROPBOX_DATA" uid="incidentd" />

    <assign-permission name="android.permission.ACCESS_LOWPAN_STATE" uid="lowpan" />
    <assign-permission name="android.permission.MANAGE_LOWPAN_INTERFACES" uid="lowpan" />
+9 −0
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ import android.content.ContentResolver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.pm.PackageManager;
import android.content.res.Resources;
import android.database.ContentObserver;
import android.net.Uri;
@@ -464,6 +465,14 @@ public final class DropBoxManagerService extends SystemService {
    }

    private boolean checkPermission(int callingUid, String callingPackage) {
        // If callers have this permission, then we don't need to check
        // USAGE_STATS, because they are part of the system and have agreed to
        // check USAGE_STATS before passing the data along.
        if (getContext().checkCallingPermission(android.Manifest.permission.PEEK_DROPBOX_DATA)
                == PackageManager.PERMISSION_GRANTED) {
            return true;
        }

        // Callers always need this permission
        getContext().enforceCallingOrSelfPermission(
                android.Manifest.permission.READ_LOGS, TAG);