diff options
author | zachh <zachh@google.com> | 2017-07-11 12:56:31 -0700 |
---|---|---|
committer | Eric Erfanian <erfanian@google.com> | 2017-07-12 09:40:56 -0700 |
commit | 2fc4775eacc3f1c733ccf43c0fd3bf809da68f03 (patch) | |
tree | 2273c03c00d844d88f93f3bffeb065b81688fc99 | |
parent | aa1155809b3b43be345f7219960551918fd6f034 (diff) | |
download | android_packages_apps_Dialer-2fc4775eacc3f1c733ccf43c0fd3bf809da68f03.tar.gz android_packages_apps_Dialer-2fc4775eacc3f1c733ccf43c0fd3bf809da68f03.tar.bz2 android_packages_apps_Dialer-2fc4775eacc3f1c733ccf43c0fd3bf809da68f03.zip |
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
-rw-r--r-- | java/com/android/dialer/constants/TrafficStatsTags.java | 5 |
1 files changed, 5 insertions, 0 deletions
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) + } |