mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-20 03:08:19 +00:00
Removing multiple system RPCs to packageMAnager and userManager from UI thread
Bug: 158427348 Change-Id: Ibb1837fe932000b69cf5683bb01727fc32abca91
This commit is contained in:
@@ -18,7 +18,6 @@ package com.android.launcher3.pm;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Process;
|
||||
import android.os.UserHandle;
|
||||
import android.os.UserManager;
|
||||
import android.util.ArrayMap;
|
||||
@@ -106,22 +105,6 @@ public class UserCache {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if any user profile has quiet mode enabled.
|
||||
*/
|
||||
public boolean isAnyProfileQuietModeEnabled() {
|
||||
List<UserHandle> userProfiles = getUserProfiles();
|
||||
for (UserHandle userProfile : userProfiles) {
|
||||
if (Process.myUserHandle().equals(userProfile)) {
|
||||
continue;
|
||||
}
|
||||
if (mUserManager.isQuietModeEnabled(userProfile)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see UserManager#getSerialNumberForUser(UserHandle)
|
||||
*/
|
||||
@@ -160,16 +143,4 @@ public class UserCache {
|
||||
List<UserHandle> users = mUserManager.getUserProfiles();
|
||||
return users == null ? Collections.emptyList() : users;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true is there is at least one user profile enabled
|
||||
*/
|
||||
public boolean hasWorkProfile() {
|
||||
synchronized (this) {
|
||||
if (mUsers != null) {
|
||||
return mUsers.size() > 1;
|
||||
}
|
||||
}
|
||||
return getUserProfiles().size() > 1;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user