diff options
4 files changed, 37 insertions, 0 deletions
diff --git a/packages/Shell/AndroidManifest.xml b/packages/Shell/AndroidManifest.xml index b9daf59..403f8f5 100644 --- a/packages/Shell/AndroidManifest.xml +++ b/packages/Shell/AndroidManifest.xml @@ -142,6 +142,7 @@ android:name=".BugreportReceiver" android:permission="android.permission.DUMP"> <intent-filter> + <action android:name="android.intent.action.BUGREPORT_STARTED" /> <action android:name="android.intent.action.BUGREPORT_FINISHED" /> </intent-filter> </receiver> diff --git a/packages/Shell/res/values/cm_strings.xml b/packages/Shell/res/values/cm_strings.xml new file mode 100644 index 0000000..0d81dd6 --- /dev/null +++ b/packages/Shell/res/values/cm_strings.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2014 The CyanogenMod Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<resources> + <!-- Text to let user know a bug report is currently being collected --> + <string name="notification_bug_report_active_title">Collecting bug report\u2026</string> + <string name="notification_bug_report_active_text">Please wait a few minutes</string> +</resources> diff --git a/packages/Shell/src/com/android/shell/BugreportReceiver.java b/packages/Shell/src/com/android/shell/BugreportReceiver.java index d83b516..6e39111 100644 --- a/packages/Shell/src/com/android/shell/BugreportReceiver.java +++ b/packages/Shell/src/com/android/shell/BugreportReceiver.java @@ -65,6 +65,8 @@ public class BugreportReceiver extends BroadcastReceiver { private static final String EXTRA_BUGREPORT = "android.intent.extra.BUGREPORT"; private static final String EXTRA_SCREENSHOT = "android.intent.extra.SCREENSHOT"; + public static final String ACTION_BUGREPORT_STARTED = "android.intent.action.BUGREPORT_STARTED"; + /** * Always keep the newest 8 bugreport files; 4 reports and 4 screenshots are * roughly 17MB of disk space. @@ -79,6 +81,19 @@ public class BugreportReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { final Configuration conf = context.getResources().getConfiguration(); + if (ACTION_BUGREPORT_STARTED.equals(intent.getAction())) { + Notification.Builder builder = new Notification.Builder(context) + .setSmallIcon(com.android.internal.R.drawable.stat_sys_adb) + .setOngoing(true) + .setProgress(0, 0, true) + .setContentTitle(context + .getString(R.string.notification_bug_report_active_title)) + .setContentText(context + .getString(R.string.notification_bug_report_active_text)); + NotificationManager.from(context).notify(TAG, 0, builder.build()); + return; + } + final File bugreportFile = getFileExtra(intent, EXTRA_BUGREPORT); final File screenshotFile = getFileExtra(intent, EXTRA_SCREENSHOT); diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java index a20eedc..6c450c6 100644 --- a/services/core/java/com/android/server/am/ActivityManagerService.java +++ b/services/core/java/com/android/server/am/ActivityManagerService.java @@ -10721,6 +10721,7 @@ public final class ActivityManagerService extends ActivityManagerNative public void requestBugReport() { enforceCallingPermission(android.Manifest.permission.DUMP, "requestBugReport"); + mContext.sendBroadcast(new Intent("android.intent.action.BUGREPORT_STARTED")); SystemProperties.set("ctl.start", "bugreport"); } |