diff options
| author | 2022-01-25 16:26:34 +0000 | |
|---|---|---|
| committer | 2022-01-25 16:26:34 +0000 | |
| commit | 0cc43d72c6494528060f6aeb0f234e7e1a83cda7 (patch) | |
| tree | cec01f6b01a895e648cae6613a563c8165111c29 | |
| parent | 63c3c1f3d480f7e481b8667e6549be1a6170e88a (diff) | |
| parent | 154cdf1b7735d7cf39068ccd6d9008a12d37695e (diff) | |
Merge "[MS69.1] Fix TrafficStats.init crashs for supplemental process"
| -rw-r--r-- | packages/ConnectivityT/framework-t/src/android/net/TrafficStats.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/packages/ConnectivityT/framework-t/src/android/net/TrafficStats.java b/packages/ConnectivityT/framework-t/src/android/net/TrafficStats.java index 77b7f16671a0..c2f0cdfb048c 100644 --- a/packages/ConnectivityT/framework-t/src/android/net/TrafficStats.java +++ b/packages/ConnectivityT/framework-t/src/android/net/TrafficStats.java @@ -31,6 +31,7 @@ import android.media.MediaPlayer; import android.os.Binder; import android.os.Build; import android.os.RemoteException; +import android.util.Log; import com.android.server.NetworkManagementSocketTagger; @@ -212,6 +213,13 @@ public class TrafficStats { } final NetworkStatsManager statsManager = context.getSystemService(NetworkStatsManager.class); + if (statsManager == null) { + // TODO: Currently Process.isSupplemental is not working yet, because it depends on + // process to run in a certain UID range, which is not true for now. Change this + // to Log.wtf once Process.isSupplemental is ready. + Log.e(TAG, "TrafficStats not initialized, uid=" + Binder.getCallingUid()); + return; + } sStatsService = statsManager.getBinder(); } |