Fix NPE while performing NetworkStatsService.removeUidsLocked()
Symptom: NPE occurred while performing NetworkStatsService.removeUidsLocked(). Root cause: NetworkStatsService refers to mUidRecorder at NetworkStatsService.removeUidsLocked() when mUserReceiver received Intent.ACTION_USER_REMOVED. However NetworkStatsService sets mUidRecorder to null without unregistering mUserReceiver when mShutdownReceiver received Intent.ACTION_SHUTDOWN. Therefore NPE occurred when mUserReceiver received Intent.ACTION_USER_REMOVED after mShutdownReceiver received Intent.ACTION_SHUTDOWN. Solution: Unregister mUserReceiver before setting mUidRecorder to null when mShutdownReceiver received Intent.ACTION_SHUTDOWN. Bug: 36015339 Change-Id: I9279e4c6ae07d94e7ec519c40b2d973c84d8fef1
Loading
Please register or sign in to comment