Commit 2f134301 authored by Xing Liu's avatar Xing Liu Committed by Commit Bot

Download notification: Obsolete a notification notification metric.

This CL obsoletes the following metric:
Android.DownloadManager.ServiceStopped.DownloadNotification.

This metric seems to be used during the foreground service migration
for download notification. Now the migration is done, this is no longer
used.

Bug: 1130635
Change-Id: I96c65a960f0abad6629454c1e99abe3a36fc9fe1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2485873Reviewed-by: default avatarMark Pearson <mpearson@chromium.org>
Reviewed-by: default avatarShakti Sahu <shaktisahu@chromium.org>
Reviewed-by: default avatarMichael Lippautz <mlippautz@chromium.org>
Commit-Queue: Xing Liu <xingliu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#820420}
parent d4daf411
...@@ -132,7 +132,7 @@ public class DownloadForegroundServiceImpl extends DownloadForegroundService.Imp ...@@ -132,7 +132,7 @@ public class DownloadForegroundServiceImpl extends DownloadForegroundService.Imp
DownloadNotificationUmaHelper.recordForegroundServiceLifecycleHistogram( DownloadNotificationUmaHelper.recordForegroundServiceLifecycleHistogram(
DownloadNotificationUmaHelper.ForegroundLifecycle.STOP); DownloadNotificationUmaHelper.ForegroundLifecycle.STOP);
DownloadNotificationUmaHelper.recordServiceStoppedHistogram( DownloadNotificationUmaHelper.recordServiceStoppedHistogram(
DownloadNotificationUmaHelper.ServiceStopped.STOPPED, true /* withForeground */); DownloadNotificationUmaHelper.ServiceStopped.STOPPED);
// Handle notifications and stop foreground. // Handle notifications and stop foreground.
if (stopForegroundNotification == StopForegroundNotification.KILL) { if (stopForegroundNotification == StopForegroundNotification.KILL) {
...@@ -173,7 +173,7 @@ public class DownloadForegroundServiceImpl extends DownloadForegroundService.Imp ...@@ -173,7 +173,7 @@ public class DownloadForegroundServiceImpl extends DownloadForegroundService.Imp
// In the case the service was restarted when the intent is null. // In the case the service was restarted when the intent is null.
if (intent == null) { if (intent == null) {
DownloadNotificationUmaHelper.recordServiceStoppedHistogram( DownloadNotificationUmaHelper.recordServiceStoppedHistogram(
DownloadNotificationUmaHelper.ServiceStopped.START_STICKY, true); DownloadNotificationUmaHelper.ServiceStopped.START_STICKY);
// Allow observers to restart service on their own, if needed. // Allow observers to restart service on their own, if needed.
getService().stopSelf(); getService().stopSelf();
...@@ -186,7 +186,7 @@ public class DownloadForegroundServiceImpl extends DownloadForegroundService.Imp ...@@ -186,7 +186,7 @@ public class DownloadForegroundServiceImpl extends DownloadForegroundService.Imp
@Override @Override
public void onDestroy() { public void onDestroy() {
DownloadNotificationUmaHelper.recordServiceStoppedHistogram( DownloadNotificationUmaHelper.recordServiceStoppedHistogram(
DownloadNotificationUmaHelper.ServiceStopped.DESTROYED, true /* withForeground */); DownloadNotificationUmaHelper.ServiceStopped.DESTROYED);
DownloadForegroundServiceObservers.alertObserversServiceDestroyed(); DownloadForegroundServiceObservers.alertObserversServiceDestroyed();
super.onDestroy(); super.onDestroy();
} }
...@@ -194,7 +194,7 @@ public class DownloadForegroundServiceImpl extends DownloadForegroundService.Imp ...@@ -194,7 +194,7 @@ public class DownloadForegroundServiceImpl extends DownloadForegroundService.Imp
@Override @Override
public void onTaskRemoved(Intent rootIntent) { public void onTaskRemoved(Intent rootIntent) {
DownloadNotificationUmaHelper.recordServiceStoppedHistogram( DownloadNotificationUmaHelper.recordServiceStoppedHistogram(
DownloadNotificationUmaHelper.ServiceStopped.TASK_REMOVED, true /*withForeground*/); DownloadNotificationUmaHelper.ServiceStopped.TASK_REMOVED);
DownloadForegroundServiceObservers.alertObserversTaskRemoved(); DownloadForegroundServiceObservers.alertObserversTaskRemoved();
super.onTaskRemoved(rootIntent); super.onTaskRemoved(rootIntent);
} }
...@@ -202,7 +202,7 @@ public class DownloadForegroundServiceImpl extends DownloadForegroundService.Imp ...@@ -202,7 +202,7 @@ public class DownloadForegroundServiceImpl extends DownloadForegroundService.Imp
@Override @Override
public void onLowMemory() { public void onLowMemory() {
DownloadNotificationUmaHelper.recordServiceStoppedHistogram( DownloadNotificationUmaHelper.recordServiceStoppedHistogram(
DownloadNotificationUmaHelper.ServiceStopped.LOW_MEMORY, true /* withForeground */); DownloadNotificationUmaHelper.ServiceStopped.LOW_MEMORY);
super.onLowMemory(); super.onLowMemory();
} }
......
...@@ -108,18 +108,11 @@ public final class DownloadNotificationUmaHelper { ...@@ -108,18 +108,11 @@ public final class DownloadNotificationUmaHelper {
* understand the frequency of unexpected stops (low memory, task removed, etc). * understand the frequency of unexpected stops (low memory, task removed, etc).
* @param stopType Type of the foreground stop that is being recorded ({@link ServiceStopped}). * @param stopType Type of the foreground stop that is being recorded ({@link ServiceStopped}).
*/ */
static void recordServiceStoppedHistogram( static void recordServiceStoppedHistogram(@ServiceStopped int stopType) {
@ServiceStopped int stopType, boolean withForeground) {
if (!LibraryLoader.getInstance().isInitialized()) return; if (!LibraryLoader.getInstance().isInitialized()) return;
if (withForeground) {
RecordHistogram.recordEnumeratedHistogram( RecordHistogram.recordEnumeratedHistogram(
"Android.DownloadManager.ServiceStopped.DownloadForeground", stopType, "Android.DownloadManager.ServiceStopped.DownloadForeground", stopType,
ServiceStopped.NUM_ENTRIES); ServiceStopped.NUM_ENTRIES);
} else {
RecordHistogram.recordEnumeratedHistogram(
"Android.DownloadManager.ServiceStopped.DownloadNotification", stopType,
ServiceStopped.NUM_ENTRIES);
}
} }
/** /**
......
...@@ -744,6 +744,9 @@ reviews. Googlers can read more about this at go/gwsq-gerrit. ...@@ -744,6 +744,9 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.
<histogram name="Android.DownloadManager.ServiceStopped.DownloadNotification" <histogram name="Android.DownloadManager.ServiceStopped.DownloadNotification"
enum="DownloadNotificationServiceStopped" expires_after="M85"> enum="DownloadNotificationServiceStopped" expires_after="M85">
<obsolete>
Deprecated as of 10/2020
</obsolete>
<owner>xingliu@chromium.org</owner> <owner>xingliu@chromium.org</owner>
<owner>clank-downloads@google.com</owner> <owner>clank-downloads@google.com</owner>
<summary> <summary>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment