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

Commit e21ab7ea authored by Joe Onorato's avatar Joe Onorato
Browse files

Add IncidentCompanionService

It is a helper in the system process that helps dumpstate and incidentd get
user confirmation to share reports

Bug: 123543706
Test: bit GooglePermissionControllerTest:*
Change-Id: Ia3fe4bd5257044ed89fe56ce683876fa03ba6c36
parent 5a15b551
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -656,6 +656,7 @@ java_defaults {
        ":vold_aidl",
        ":installd_aidl",
        ":dumpstate_aidl",
        ":incidentcompanion_aidl",

        "lowpan/java/android/net/lowpan/ILowpanEnergyScanCallback.aidl",
        "lowpan/java/android/net/lowpan/ILowpanNetScanCallback.aidl",
@@ -706,6 +707,7 @@ java_defaults {
            "system/update_engine/binder_bindings",
            "frameworks/native/aidl/binder",
            "frameworks/native/cmds/dumpstate/binder",
            "frameworks/native/libs/incidentcompanion/binder",
            "frameworks/av/camera/aidl",
            "frameworks/av/media/libaudioclient/aidl",
            "frameworks/native/aidl/gui",
+21 −0
Original line number Diff line number Diff line
@@ -1307,6 +1307,7 @@ package android.content {
    field public static final String ACTION_MANAGE_PERMISSION_APPS = "android.intent.action.MANAGE_PERMISSION_APPS";
    field @RequiresPermission(android.Manifest.permission.MANAGE_ROLE_HOLDERS) public static final String ACTION_MANAGE_SPECIAL_APP_ACCESSES = "android.intent.action.MANAGE_SPECIAL_APP_ACCESSES";
    field public static final String ACTION_MASTER_CLEAR_NOTIFICATION = "android.intent.action.MASTER_CLEAR_NOTIFICATION";
    field public static final String ACTION_PENDING_INCIDENT_REPORTS_CHANGED = "android.intent.action.PENDING_INCIDENT_REPORTS_CHANGED";
    field public static final String ACTION_PRE_BOOT_COMPLETED = "android.intent.action.PRE_BOOT_COMPLETED";
    field public static final String ACTION_QUERY_PACKAGE_RESTART = "android.intent.action.QUERY_PACKAGE_RESTART";
    field public static final String ACTION_RESOLVE_INSTANT_APP_PACKAGE = "android.intent.action.RESOLVE_INSTANT_APP_PACKAGE";
@@ -5333,7 +5334,27 @@ package android.os {
  }
  public class IncidentManager {
    method @RequiresPermission(android.Manifest.permission.APPROVE_INCIDENT_REPORTS) public void approveReport(android.net.Uri);
    method @RequiresPermission("android.permission.REQUEST_INCIDENT_REPORT_APPROVAL") public void cancelAuthorization(android.os.IncidentManager.AuthListener);
    method @RequiresPermission(android.Manifest.permission.APPROVE_INCIDENT_REPORTS) public void denyReport(android.net.Uri);
    method @RequiresPermission(android.Manifest.permission.APPROVE_INCIDENT_REPORTS) public java.util.List<android.os.IncidentManager.PendingReport> getPendingReports();
    method @RequiresPermission(allOf={android.Manifest.permission.DUMP, android.Manifest.permission.PACKAGE_USAGE_STATS}) public void reportIncident(android.os.IncidentReportArgs);
    method @RequiresPermission("android.permission.REQUEST_INCIDENT_REPORT_APPROVAL") public void requestAuthorization(int, String, int, android.os.IncidentManager.AuthListener);
    field public static final int FLAG_CONFIRMATION_DIALOG = 1; // 0x1
  }
  public static class IncidentManager.AuthListener {
    ctor public IncidentManager.AuthListener();
    method public void onReportApproved();
    method public void onReportDenied();
  }
  public static class IncidentManager.PendingReport {
    ctor public IncidentManager.PendingReport(@NonNull android.net.Uri);
    method public int getFlags();
    method @NonNull public String getRequestingPackage();
    method public long getTimestamp();
    method @NonNull public android.net.Uri getUri();
  }
  public final class IncidentReportArgs implements android.os.Parcelable {
+20 −0
Original line number Diff line number Diff line
@@ -1282,7 +1282,27 @@ package android.os {
  }

  public class IncidentManager {
    method @RequiresPermission(android.Manifest.permission.APPROVE_INCIDENT_REPORTS) public void approveReport(android.net.Uri);
    method @RequiresPermission("android.permission.REQUEST_INCIDENT_REPORT_APPROVAL") public void cancelAuthorization(android.os.IncidentManager.AuthListener);
    method @RequiresPermission(android.Manifest.permission.APPROVE_INCIDENT_REPORTS) public void denyReport(android.net.Uri);
    method @RequiresPermission(android.Manifest.permission.APPROVE_INCIDENT_REPORTS) public java.util.List<android.os.IncidentManager.PendingReport> getPendingReports();
    method @RequiresPermission(allOf={android.Manifest.permission.DUMP, android.Manifest.permission.PACKAGE_USAGE_STATS}) public void reportIncident(android.os.IncidentReportArgs);
    method @RequiresPermission("android.permission.REQUEST_INCIDENT_REPORT_APPROVAL") public void requestAuthorization(int, String, int, android.os.IncidentManager.AuthListener);
    field public static final int FLAG_CONFIRMATION_DIALOG = 1; // 0x1
  }

  public static class IncidentManager.AuthListener {
    ctor public IncidentManager.AuthListener();
    method public void onReportApproved();
    method public void onReportDenied();
  }

  public static class IncidentManager.PendingReport {
    ctor public IncidentManager.PendingReport(@NonNull android.net.Uri);
    method public int getFlags();
    method @NonNull public String getRequestingPackage();
    method public long getTimestamp();
    method @NonNull public android.net.Uri getUri();
  }

  public final class IncidentReportArgs implements android.os.Parcelable {
+8 −0
Original line number Diff line number Diff line
@@ -3180,6 +3180,7 @@ public abstract class Context {
            //@hide: CONTEXTHUB_SERVICE,
            SYSTEM_HEALTH_SERVICE,
            //@hide: INCIDENT_SERVICE,
            //@hide: INCIDENT_COMPANION_SERVICE,
            //@hide: STATS_COMPANION_SERVICE,
            COMPANION_DEVICE_SERVICE,
            CROSS_PROFILE_APPS_SERVICE,
@@ -4465,6 +4466,13 @@ public abstract class Context {
     */
    public static final String INCIDENT_SERVICE = "incident";

    /**
     * Service to assist incidentd and dumpstated in reporting status to the user
     * and in confirming authorization to take an incident report or bugreport
     * @hide
     */
    public static final String INCIDENT_COMPANION_SERVICE = "incidentcompanion";

    /**
     * Service to assist statsd in obtaining general stats.
     * @hide
+12 −0
Original line number Diff line number Diff line
@@ -1474,6 +1474,18 @@ public class Intent implements Parcelable, Cloneable {
    @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
    public static final String ACTION_APP_ERROR = "android.intent.action.APP_ERROR";

    /**
     * An incident or bug report has been taken, and a system app has requested it to be shared,
     * so trigger the confirmation screen.
     *
     * This will be sent directly to the registered receiver with the
     * android.permission.APPROVE_INCIDENT_REPORTS permission.
     * @hide
     */
    @SystemApi
    public static final String ACTION_PENDING_INCIDENT_REPORTS_CHANGED =
            "android.intent.action.PENDING_INCIDENT_REPORTS_CHANGED";

    /**
     * Activity Action: Show power usage information to the user.
     * <p>Input: Nothing.
Loading