[Notif] Limit shown events to manager.show

We have a slight over-fire of show events due to bindNotification being
called multiple times on density or user config changes. To be extra
careful, limit the show events to only get called with
perhapsShowBlockingHelper.

Bug:74609669
Test: Through adb logcat -b events + thru config changes
Change-Id: I0719052869e53ff1cba5030579daf512f324e99c
This commit is contained in:
Rohan Shah
2018-05-09 19:55:30 -07:00
parent 8ca46fc4ac
commit eab86045e8
2 changed files with 5 additions and 2 deletions

View File

@@ -23,8 +23,10 @@ import android.service.notification.StatusBarNotification;
import android.support.annotation.VisibleForTesting;
import android.util.Log;
import com.android.internal.logging.MetricsLogger;
import com.android.systemui.Dependency;
import com.android.systemui.plugins.statusbar.NotificationMenuRowPlugin;
import com.android.systemui.statusbar.notification.NotificationCounters;
import com.android.systemui.statusbar.phone.StatusBar;
import java.util.Collections;
@@ -97,6 +99,9 @@ public class NotificationBlockingHelperManager {
// We don't care about the touch origin (x, y) since we're opening guts without any
// explicit user interaction.
manager.openGuts(mBlockingHelperRow, 0, 0, menuRow.getLongpressMenuItem(mContext));
Dependency.get(MetricsLogger.class)
.count(NotificationCounters.BLOCKING_HELPER_SHOWN, 1);
return true;
}
return false;

View File

@@ -197,8 +197,6 @@ public class NotificationInfo extends LinearLayout implements NotificationGuts.G
bindHeader();
bindPrompt();
bindButtons();
logBlockingHelperCounter(NotificationCounters.BLOCKING_HELPER_SHOWN);
}
private void bindHeader() throws RemoteException {