Methods Summary |
---|
public int | getCurrentUserId()
return mCurrentUserId;
|
public boolean | isCurrentUserOwner()
return mCurrentUserId == UserHandle.USER_OWNER;
|
public void | onReceive(android.content.Context context, android.content.Intent intent)
if (Intent.ACTION_USER_SWITCHED.equals(intent.getAction())) {
int oldUserId = mCurrentUserId;
mCurrentUserId = intent.getIntExtra(Intent.EXTRA_USER_HANDLE, 0);
if (oldUserId != mCurrentUserId) {
onUserSwitched(mCurrentUserId);
}
}
|
public abstract void | onUserSwitched(int newUserId)
|
public void | startTracking()
mCurrentUserId = ActivityManager.getCurrentUser();
IntentFilter filter = new IntentFilter(Intent.ACTION_USER_SWITCHED);
mContext.registerReceiver(this, filter);
|
public void | stopTracking()
mContext.unregisterReceiver(this);
|