From 2552f8aec44d03aa001759a0376c25411ec62c28 Mon Sep 17 00:00:00 2001 From: Michal Karpinski Date: Fri, 4 Mar 2016 13:16:28 +0000 Subject: [PATCH] Do not re-define remote bugreport constants defined in DevicePolicyManager Bug: 26226230 Change-Id: Ib26d8ba872b1ebdf24b43312daa1d04b90a7f393 --- .../com/android/shell/BugreportProgressService.java | 2 -- .../com/android/shell/RemoteBugreportReceiver.java | 11 +++++------ 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/packages/Shell/src/com/android/shell/BugreportProgressService.java b/packages/Shell/src/com/android/shell/BugreportProgressService.java index 0b52588957759..0fad11357bd9b 100644 --- a/packages/Shell/src/com/android/shell/BugreportProgressService.java +++ b/packages/Shell/src/com/android/shell/BugreportProgressService.java @@ -121,8 +121,6 @@ public class BugreportProgressService extends Service { static final String INTENT_BUGREPORT_FINISHED = "android.intent.action.BUGREPORT_FINISHED"; static final String INTENT_REMOTE_BUGREPORT_FINISHED = "android.intent.action.REMOTE_BUGREPORT_FINISHED"; - static final String INTENT_REMOTE_BUGREPORT_DISPATCH = - "android.intent.action.REMOTE_BUGREPORT_DISPATCH"; // Internal intents used on notification actions. static final String INTENT_BUGREPORT_CANCEL = "android.intent.action.BUGREPORT_CANCEL"; diff --git a/packages/Shell/src/com/android/shell/RemoteBugreportReceiver.java b/packages/Shell/src/com/android/shell/RemoteBugreportReceiver.java index be54b43e0524d..634c3b47c7876 100644 --- a/packages/Shell/src/com/android/shell/RemoteBugreportReceiver.java +++ b/packages/Shell/src/com/android/shell/RemoteBugreportReceiver.java @@ -18,13 +18,13 @@ package com.android.shell; import static com.android.shell.BugreportProgressService.EXTRA_BUGREPORT; import static com.android.shell.BugreportProgressService.INTENT_REMOTE_BUGREPORT_FINISHED; -import static com.android.shell.BugreportProgressService.INTENT_REMOTE_BUGREPORT_DISPATCH; import static com.android.shell.BugreportProgressService.getFileExtra; import static com.android.shell.BugreportProgressService.getUri; import static com.android.shell.BugreportReceiver.cleanupOldFiles; import java.io.File; +import android.app.admin.DevicePolicyManager; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; @@ -41,8 +41,6 @@ import android.text.format.DateUtils; public class RemoteBugreportReceiver extends BroadcastReceiver { private static final String BUGREPORT_MIMETYPE = "application/vnd.android.bugreport"; - private static final String EXTRA_REMOTE_BUGREPORT_HASH = - "android.intent.extra.REMOTE_BUGREPORT_HASH"; /** Always keep just the last remote bugreport's files around. */ private static final int REMOTE_BUGREPORT_FILES_AMOUNT = 3; @@ -57,11 +55,12 @@ public class RemoteBugreportReceiver extends BroadcastReceiver { final File bugreportFile = getFileExtra(intent, EXTRA_BUGREPORT); final Uri bugreportUri = getUri(context, bugreportFile); - final String bugreportHash = intent.getStringExtra(EXTRA_REMOTE_BUGREPORT_HASH); + final String bugreportHash = intent.getStringExtra( + DevicePolicyManager.EXTRA_REMOTE_BUGREPORT_HASH); - final Intent newIntent = new Intent(INTENT_REMOTE_BUGREPORT_DISPATCH); + final Intent newIntent = new Intent(DevicePolicyManager.ACTION_REMOTE_BUGREPORT_DISPATCH); newIntent.setDataAndType(bugreportUri, BUGREPORT_MIMETYPE); - newIntent.putExtra(EXTRA_REMOTE_BUGREPORT_HASH, bugreportHash); + newIntent.putExtra(DevicePolicyManager.EXTRA_REMOTE_BUGREPORT_HASH, bugreportHash); context.sendBroadcastAsUser(newIntent, UserHandle.SYSTEM, android.Manifest.permission.DUMP); }