From 2fc4775eacc3f1c733ccf43c0fd3bf809da68f03 Mon Sep 17 00:00:00 2001 From: zachh Date: Tue, 11 Jul 2017 12:56:31 -0700 Subject: Tag spam network traffic using TrafficStats. The dialer app crashes on launch right now when app data is empty, because we fetch the spam list on app start, and we don't tag the network traffic using TrafficStats, which is a strict mode violation. This CL tags spam network traffic using TrafficStats, by providing a custom transport executor for the GRPC channel. All activity on the channel is tagged as spam. This unfortunately required creating a new thread pool. I am not sure if this creates more threads than before, because it is not clear what type of transport executor grpc uses by default. Note that the new thread pool will kill unused threads after 60 seconds so won't consume resources when idle. Bug: 62388129 Test: manually verified app does not crash on launch with empty data. Can add automated tests upon request. PiperOrigin-RevId: 161568882 Change-Id: I99da6ebb649fe1a63d634871ab314d8d910658f9 --- java/com/android/dialer/constants/TrafficStatsTags.java | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'java/com/android/dialer') diff --git a/java/com/android/dialer/constants/TrafficStatsTags.java b/java/com/android/dialer/constants/TrafficStatsTags.java index 13c3e2cd9..b473402db 100644 --- a/java/com/android/dialer/constants/TrafficStatsTags.java +++ b/java/com/android/dialer/constants/TrafficStatsTags.java @@ -26,4 +26,9 @@ public class TrafficStatsTags { public static final int REVERSE_GEOCODE_TAG = 0xd001; public static final int VISUAL_VOICEMAIL_TAG = 0xd002; public static final int DIALER_VOIP_TAG = 0xd003; + + // 0xFFFFFE00 to 0xFFFFFF00 reserved for proprietary extensions to the dialer app. + + // 0xFFFFFF00 to 0xFFFFFFFF reserved by the system (see TrafficStats#getAndSetThreadStatsTag) + } -- cgit v1.2.3