Merge \"SysUI: Mantain non-weak reference to listener\" into nyc-mr1-dev
am: d4ec5df707
Change-Id: If20be5074d299830e5bd7373fadb1445dd7e5673
This commit is contained in:
@@ -431,23 +431,27 @@ public class UserSwitcherController {
|
||||
}
|
||||
|
||||
private void listenForCallState() {
|
||||
TelephonyManager.from(mContext).listen(new PhoneStateListener() {
|
||||
private int mCallState;
|
||||
@Override
|
||||
public void onCallStateChanged(int state, String incomingNumber) {
|
||||
if (mCallState == state) return;
|
||||
if (DEBUG) Log.v(TAG, "Call state changed: " + state);
|
||||
mCallState = state;
|
||||
int currentUserId = ActivityManager.getCurrentUser();
|
||||
UserInfo userInfo = mUserManager.getUserInfo(currentUserId);
|
||||
if (userInfo != null && userInfo.isGuest()) {
|
||||
showGuestNotification(currentUserId);
|
||||
}
|
||||
refreshUsers(UserHandle.USER_NULL);
|
||||
}
|
||||
}, PhoneStateListener.LISTEN_CALL_STATE);
|
||||
TelephonyManager.from(mContext).listen(mPhoneStateListener,
|
||||
PhoneStateListener.LISTEN_CALL_STATE);
|
||||
}
|
||||
|
||||
private final PhoneStateListener mPhoneStateListener = new PhoneStateListener() {
|
||||
private int mCallState;
|
||||
|
||||
@Override
|
||||
public void onCallStateChanged(int state, String incomingNumber) {
|
||||
if (mCallState == state) return;
|
||||
if (DEBUG) Log.v(TAG, "Call state changed: " + state);
|
||||
mCallState = state;
|
||||
int currentUserId = ActivityManager.getCurrentUser();
|
||||
UserInfo userInfo = mUserManager.getUserInfo(currentUserId);
|
||||
if (userInfo != null && userInfo.isGuest()) {
|
||||
showGuestNotification(currentUserId);
|
||||
}
|
||||
refreshUsers(UserHandle.USER_NULL);
|
||||
}
|
||||
};
|
||||
|
||||
private BroadcastReceiver mReceiver = new BroadcastReceiver() {
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
|
||||
Reference in New Issue
Block a user