Merge "[MS69.1] Fix TrafficStats.init crashs for supplemental process" am: a6889ec04f am: 498a92aac8 am: e1bf1d894d am: c1878210d1
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1959129 Change-Id: I965b8795a738419d2f9e3759f04d29d3e64174ca
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user