From 0b304c36f625b51c14b4bf6194c7059b81b05088 Mon Sep 17 00:00:00 2001 From: Abhijeet Kaur Date: Wed, 25 Mar 2020 11:34:12 +0000 Subject: Show predefined title and description in finished notification shareTitle and shareDescription is passed by the caller of the bugreport. Show these in the finished bugreport notification. Pre-set shareTitle takes precedence over user modified title. shareDescription and description are not related/dependant on each other in any way. Bug: 150333444 Test: Manual (by passing EXTRA_TITLE and EXTRA_DESCRIPTION from ActivityManagerService when trigerring a bugreport) Change-Id: I2bfd080aeee677cdc8d0af339d7ad4a29451c3e0 --- .../Shell/src/com/android/shell/BugreportProgressService.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'packages/Shell/src') diff --git a/packages/Shell/src/com/android/shell/BugreportProgressService.java b/packages/Shell/src/com/android/shell/BugreportProgressService.java index 64e52376effd..0ae00e1ac8b5 100644 --- a/packages/Shell/src/com/android/shell/BugreportProgressService.java +++ b/packages/Shell/src/com/android/shell/BugreportProgressService.java @@ -1019,8 +1019,11 @@ public class BugreportProgressService extends Service { * Wraps up bugreport generation and triggers a notification to share the bugreport. */ private void onBugreportFinished(BugreportInfo info) { + if (!TextUtils.isEmpty(info.shareTitle)) { + info.setTitle(info.shareTitle); + } Log.d(TAG, "Bugreport finished with title: " + info.getTitle() - + " and shareDescription: " + info.shareDescription); + + " and shareDescription: " + info.shareDescription); info.finished = new AtomicBoolean(true); synchronized (mLock) { @@ -1795,7 +1798,9 @@ public class BugreportProgressService extends Service { /** * User-provided, detailed description of the bugreport; when set, will be added to the body - * of the {@link Intent#ACTION_SEND_MULTIPLE} intent. + * of the {@link Intent#ACTION_SEND_MULTIPLE} intent. This is shown in the app where the + * bugreport is being shared as an attachment. This is not related/dependant on + * {@code shareDescription}. */ private String description; @@ -2130,7 +2135,6 @@ public class BugreportProgressService extends Service { return new BugreportInfo[size]; } }; - } @GuardedBy("mLock") -- cgit v1.2.3