summaryrefslogtreecommitdiffstats
path: root/packages/SystemUI
diff options
context:
space:
mode:
authorWinson Chung <winsonc@google.com>2012-07-18 16:47:51 -0700
committerWinson Chung <winsonc@google.com>2012-07-18 16:48:51 -0700
commit224848f9ba6e8d9134ce907c34c0b9f850078794 (patch)
tree0375419504f05f464a492ddfe3b2026fd6538451 /packages/SystemUI
parentaccf721ebdf4d3da53e8ae09572650775bfe10f8 (diff)
downloadframeworks_base-224848f9ba6e8d9134ce907c34c0b9f850078794.zip
frameworks_base-224848f9ba6e8d9134ce907c34c0b9f850078794.tar.gz
frameworks_base-224848f9ba6e8d9134ce907c34c0b9f850078794.tar.bz2
Fixing issue where screenshot error message is clipped and share action is missing subject. (Bug 6800151, Bug 6721459)
Change-Id: Ie0ef654d660706607276069ae9b93b61ad94b2be
Diffstat (limited to 'packages/SystemUI')
-rw-r--r--packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java14
1 files changed, 11 insertions, 3 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java b/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java
index f25ac0d..2723f82 100644
--- a/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java
+++ b/packages/SystemUI/src/com/android/systemui/screenshot/GlobalScreenshot.java
@@ -82,6 +82,7 @@ class SaveImageInBackgroundTask extends AsyncTask<SaveImageInBackgroundData, Voi
private static final String SCREENSHOTS_DIR_NAME = "Screenshots";
private static final String SCREENSHOT_FILE_NAME_TEMPLATE = "Screenshot_%s.png";
private static final String SCREENSHOT_FILE_PATH_TEMPLATE = "%s/%s/%s";
+ private static final String SCREENSHOT_SHARE_SUBJECT_TEMPLATE = "Screenshot (%s)";
private int mNotificationId;
private NotificationManager mNotificationManager;
@@ -184,9 +185,13 @@ class SaveImageInBackgroundTask extends AsyncTask<SaveImageInBackgroundData, Voi
values.put(MediaStore.Images.ImageColumns.MIME_TYPE, "image/png");
Uri uri = resolver.insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, values);
+ String subjectDate = new SimpleDateFormat("hh:mma, MMM dd, yyyy")
+ .format(new Date(mImageTime));
+ String subject = String.format(SCREENSHOT_SHARE_SUBJECT_TEMPLATE, subjectDate);
Intent sharingIntent = new Intent(Intent.ACTION_SEND);
sharingIntent.setType("image/png");
sharingIntent.putExtra(Intent.EXTRA_STREAM, uri);
+ sharingIntent.putExtra(Intent.EXTRA_SUBJECT, subject);
Intent chooserIntent = Intent.createChooser(sharingIntent, null);
chooserIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK
@@ -600,14 +605,17 @@ class GlobalScreenshot {
Resources r = context.getResources();
// Clear all existing notification, compose the new notification and show it
- Notification n = new Notification.Builder(context)
+ Notification.Builder b = new Notification.Builder(context)
.setTicker(r.getString(R.string.screenshot_failed_title))
.setContentTitle(r.getString(R.string.screenshot_failed_title))
.setContentText(r.getString(R.string.screenshot_failed_text))
.setSmallIcon(R.drawable.stat_notify_image_error)
.setWhen(System.currentTimeMillis())
- .setAutoCancel(true)
- .getNotification();
+ .setAutoCancel(true);
+ Notification n =
+ new Notification.BigTextStyle(b)
+ .bigText(r.getString(R.string.screenshot_failed_text))
+ .build();
nManager.notify(SCREENSHOT_NOTIFICATION_ID, n);
}
}