Merge "Removed redundant notification title." into nyc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
0dc92ca5a7
@@ -20,8 +20,6 @@
|
|||||||
<string name="bugreport_in_progress_title">Bug report <xliff:g id="id">#%d</xliff:g> is being generated</string>
|
<string name="bugreport_in_progress_title">Bug report <xliff:g id="id">#%d</xliff:g> is being generated</string>
|
||||||
<!-- Title of notification indicating a bugreport has been successfully captured. [CHAR LIMIT=50] -->
|
<!-- Title of notification indicating a bugreport has been successfully captured. [CHAR LIMIT=50] -->
|
||||||
<string name="bugreport_finished_title">Bug report <xliff:g id="id">#%d</xliff:g> captured</string>
|
<string name="bugreport_finished_title">Bug report <xliff:g id="id">#%d</xliff:g> captured</string>
|
||||||
<!-- Title of notification indicating a bugreport has been successfully captured, but screenshot is not finished yet. [CHAR LIMIT=50] -->
|
|
||||||
<string name="bugreport_finished_pending_screenshot_title">Bug report <xliff:g id="id">#%d</xliff:g> captured but screenshot pending</string>
|
|
||||||
<!-- Title of notification indicating a bugreport is being updated before it can be shared. [CHAR LIMIT=50] -->
|
<!-- Title of notification indicating a bugreport is being updated before it can be shared. [CHAR LIMIT=50] -->
|
||||||
<string name="bugreport_updating_title">Adding details to the bug report</string>
|
<string name="bugreport_updating_title">Adding details to the bug report</string>
|
||||||
<!-- Content notification indicating a bugreport is being updated before it can be shared, asking the user to wait [CHAR LIMIT=50] -->
|
<!-- Content notification indicating a bugreport is being updated before it can be shared, asking the user to wait [CHAR LIMIT=50] -->
|
||||||
|
|||||||
@@ -956,15 +956,10 @@ public class BugreportProgressService extends Service {
|
|||||||
shareIntent.putExtra(EXTRA_ID, info.id);
|
shareIntent.putExtra(EXTRA_ID, info.id);
|
||||||
shareIntent.putExtra(EXTRA_INFO, info);
|
shareIntent.putExtra(EXTRA_INFO, info);
|
||||||
|
|
||||||
final String title, content;
|
final String title = context.getString(R.string.bugreport_finished_title, info.id);
|
||||||
if (takingScreenshot) {
|
final String content = takingScreenshot ?
|
||||||
title = context.getString(R.string.bugreport_finished_pending_screenshot_title,
|
context.getString(R.string.bugreport_finished_pending_screenshot_text)
|
||||||
info.id);
|
: context.getString(R.string.bugreport_finished_text);
|
||||||
content = context.getString(R.string.bugreport_finished_pending_screenshot_text);
|
|
||||||
} else {
|
|
||||||
title = context.getString(R.string.bugreport_finished_title, info.id);
|
|
||||||
content = context.getString(R.string.bugreport_finished_text);
|
|
||||||
}
|
|
||||||
final Notification.Builder builder = newBaseNotification(context)
|
final Notification.Builder builder = newBaseNotification(context)
|
||||||
.setContentTitle(title)
|
.setContentTitle(title)
|
||||||
.setTicker(title)
|
.setTicker(title)
|
||||||
|
|||||||
@@ -131,9 +131,6 @@ public class BugreportReceiverTest extends InstrumentationTestCase {
|
|||||||
private static final boolean RENAMED_SCREENSHOTS = true;
|
private static final boolean RENAMED_SCREENSHOTS = true;
|
||||||
private static final boolean DIDNT_RENAME_SCREENSHOTS = false;
|
private static final boolean DIDNT_RENAME_SCREENSHOTS = false;
|
||||||
|
|
||||||
private static final boolean PENDING_SCREENSHOT = true;
|
|
||||||
private static final boolean NOT_PENDING_SCREENSHOT = false;
|
|
||||||
|
|
||||||
private String mDescription;
|
private String mDescription;
|
||||||
|
|
||||||
private String mPlainTextPath;
|
private String mPlainTextPath;
|
||||||
@@ -432,7 +429,7 @@ public class BugreportReceiverTest extends InstrumentationTestCase {
|
|||||||
sendBugreportStarted(ID2, PID2, NAME2, 1000);
|
sendBugreportStarted(ID2, PID2, NAME2, 1000);
|
||||||
|
|
||||||
sendBugreportFinished(ID, mZipPath, mScreenshotPath);
|
sendBugreportFinished(ID, mZipPath, mScreenshotPath);
|
||||||
Bundle extras = acceptBugreportAndGetSharedIntent(ID, PENDING_SCREENSHOT);
|
Bundle extras = acceptBugreportAndGetSharedIntent(ID);
|
||||||
|
|
||||||
detailsUi = new DetailsUi(mUiBot, ID2);
|
detailsUi = new DetailsUi(mUiBot, ID2);
|
||||||
detailsUi.assertName(NAME2);
|
detailsUi.assertName(NAME2);
|
||||||
@@ -623,7 +620,7 @@ public class BugreportReceiverTest extends InstrumentationTestCase {
|
|||||||
private Bundle sendBugreportFinishedAndGetSharedIntent(int id, String bugreportPath,
|
private Bundle sendBugreportFinishedAndGetSharedIntent(int id, String bugreportPath,
|
||||||
String screenshotPath) {
|
String screenshotPath) {
|
||||||
sendBugreportFinished(id, bugreportPath, screenshotPath);
|
sendBugreportFinished(id, bugreportPath, screenshotPath);
|
||||||
return acceptBugreportAndGetSharedIntent(id, NOT_PENDING_SCREENSHOT);
|
return acceptBugreportAndGetSharedIntent(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -632,11 +629,7 @@ public class BugreportReceiverTest extends InstrumentationTestCase {
|
|||||||
* @return extras sent in the shared intent.
|
* @return extras sent in the shared intent.
|
||||||
*/
|
*/
|
||||||
private Bundle acceptBugreportAndGetSharedIntent(int id) {
|
private Bundle acceptBugreportAndGetSharedIntent(int id) {
|
||||||
return acceptBugreportAndGetSharedIntent(id, NOT_PENDING_SCREENSHOT);
|
acceptBugreport(id);
|
||||||
}
|
|
||||||
|
|
||||||
private Bundle acceptBugreportAndGetSharedIntent(int id, boolean pendingScreenshot) {
|
|
||||||
acceptBugreport(id, pendingScreenshot);
|
|
||||||
mUiBot.chooseActivity(UI_NAME);
|
mUiBot.chooseActivity(UI_NAME);
|
||||||
return mListener.getExtras();
|
return mListener.getExtras();
|
||||||
}
|
}
|
||||||
@@ -652,13 +645,7 @@ public class BugreportReceiverTest extends InstrumentationTestCase {
|
|||||||
* Accepts the notification to share the finished bugreport.
|
* Accepts the notification to share the finished bugreport.
|
||||||
*/
|
*/
|
||||||
private void acceptBugreport(int id) {
|
private void acceptBugreport(int id) {
|
||||||
acceptBugreport(id, NOT_PENDING_SCREENSHOT);
|
mUiBot.clickOnNotification(mContext.getString(R.string.bugreport_finished_title, id));
|
||||||
}
|
|
||||||
|
|
||||||
private void acceptBugreport(int id, boolean pendingScreenshot) {
|
|
||||||
final int res = pendingScreenshot ? R.string.bugreport_finished_pending_screenshot_title
|
|
||||||
: R.string.bugreport_finished_title;
|
|
||||||
mUiBot.clickOnNotification(mContext.getString(res, id));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user