Skip to content
Commit a47b0c97 authored by Ryuki Nakamura's avatar Ryuki Nakamura Committed by Shunta Sato
Browse files

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
parent 9324d651
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment