diff --git a/api/system-current.txt b/api/system-current.txt index d9e2cb6be9b6c..a6b70fd94373a 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -3769,7 +3769,6 @@ package android.os { public class IncidentManager { method public void reportIncident(android.os.IncidentReportArgs); - method public void reportIncident(java.lang.String, byte[]); } public final class IncidentReportArgs implements android.os.Parcelable { @@ -3780,7 +3779,6 @@ package android.os { method public boolean containsSection(int); method public int describeContents(); method public boolean isAll(); - method public static android.os.IncidentReportArgs parseSetting(java.lang.String) throws java.lang.IllegalArgumentException; method public void readFromParcel(android.os.Parcel); method public int sectionCount(); method public void setAll(boolean); diff --git a/api/test-current.txt b/api/test-current.txt index 3ddbdba07f3e8..e4caf9e0093b8 100644 --- a/api/test-current.txt +++ b/api/test-current.txt @@ -473,7 +473,6 @@ package android.os { public class IncidentManager { method public void reportIncident(android.os.IncidentReportArgs); - method public void reportIncident(java.lang.String, byte[]); } public final class IncidentReportArgs implements android.os.Parcelable { @@ -484,7 +483,6 @@ package android.os { method public boolean containsSection(int); method public int describeContents(); method public boolean isAll(); - method public static android.os.IncidentReportArgs parseSetting(java.lang.String) throws java.lang.IllegalArgumentException; method public void readFromParcel(android.os.Parcel); method public int sectionCount(); method public void setAll(boolean); diff --git a/core/java/android/os/IncidentManager.java b/core/java/android/os/IncidentManager.java index 9b6d6e56407ab..0e6652d471a54 100644 --- a/core/java/android/os/IncidentManager.java +++ b/core/java/android/os/IncidentManager.java @@ -21,7 +21,6 @@ import android.annotation.SystemApi; import android.annotation.SystemService; import android.annotation.TestApi; import android.content.Context; -import android.provider.Settings; import android.util.Slog; /** @@ -57,47 +56,6 @@ public class IncidentManager { reportIncidentInternal(args); } - /** - * Convenience method to trigger an incident report and put it in dropbox. - *
- * The fields that are reported will be looked up in the system setting named by - * the settingName parameter. The setting must match one of these patterns: - * The string "disabled": The report will not be taken. - * The string "all": The report will taken with all sections. - * The string "none": The report will taken with no sections, but with the header. - * A comma separated list of field numbers: The report will have these fields. - *
- * The header parameter will be added as a header for the incident report. Fill in a
- * {@link android.util.proto.ProtoOutputStream ProtoOutputStream}, and then call the
- * {@link android.util.proto.ProtoOutputStream#bytes bytes()} method to retrieve
- * the encoded data for the header.
- */
- @RequiresPermission(allOf = {
- android.Manifest.permission.DUMP,
- android.Manifest.permission.PACKAGE_USAGE_STATS
- })
- public void reportIncident(String settingName, byte[] headerProto) {
- // Sections
- String setting = Settings.Global.getString(mContext.getContentResolver(), settingName);
- IncidentReportArgs args;
- try {
- args = IncidentReportArgs.parseSetting(setting);
- } catch (IllegalArgumentException ex) {
- Slog.w(TAG, "Bad value for incident report setting '" + settingName + "'", ex);
- return;
- }
- if (args == null) {
- Slog.i(TAG, String.format("Incident report requested but disabled with "
- + "settings [name: %s, value: %s]", settingName, setting));
- return;
- }
-
- args.addHeader(headerProto);
-
- Slog.i(TAG, "Taking incident report: " + settingName);
- reportIncidentInternal(args);
- }
-
private class IncidentdDeathRecipient implements IBinder.DeathRecipient {
@Override
public void binderDied() {
diff --git a/core/java/android/os/IncidentReportArgs.java b/core/java/android/os/IncidentReportArgs.java
index 9fa129cb98b49..1aeac5f53be01 100644
--- a/core/java/android/os/IncidentReportArgs.java
+++ b/core/java/android/os/IncidentReportArgs.java
@@ -188,53 +188,5 @@ public final class IncidentReportArgs implements Parcelable {
public void addHeader(byte[] header) {
mHeaders.add(header);
}
-
- /**
- * Parses an incident report config as described in the system setting.
- *
- * @see IncidentManager#reportIncident
- */
- public static IncidentReportArgs parseSetting(String setting)
- throws IllegalArgumentException {
- if (setting == null || setting.length() == 0) {
- return null;
- }
- setting = setting.trim();
- if (setting.length() == 0 || "disabled".equals(setting)) {
- return null;
- }
-
- final IncidentReportArgs args = new IncidentReportArgs();
-
- if ("all".equals(setting)) {
- args.setAll(true);
- return args;
- } else if ("none".equals(setting)) {
- return args;
- }
-
- final String[] splits = setting.split(",");
- final int N = splits.length;
- for (int i=0; i