本文整理汇总了Java中com.lody.virtual.os.VUserManager类的典型用法代码示例。如果您正苦于以下问题:Java VUserManager类的具体用法?Java VUserManager怎么用?Java VUserManager使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
VUserManager类属于com.lody.virtual.os包,在下文中一共展示了VUserManager类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getTaskDescription
import com.lody.virtual.os.VUserManager; //导入依赖的package包/类
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
@Override
public ActivityManager.TaskDescription getTaskDescription(ActivityManager.TaskDescription oldTaskDescription) {
if (oldTaskDescription == null) {
return null;
}
String labelPrefix = "[" + VUserManager.get().getUserName() + "] ";
String oldLabel = oldTaskDescription.getLabel() != null ? oldTaskDescription.getLabel() : "";
if (!oldLabel.startsWith(labelPrefix)) {
// Is it really necessary?
return new ActivityManager.TaskDescription(labelPrefix + oldTaskDescription.getLabel(), oldTaskDescription.getIcon(), oldTaskDescription.getPrimaryColor());
} else {
return oldTaskDescription;
}
}
示例2: getTaskDescription
import com.lody.virtual.os.VUserManager; //导入依赖的package包/类
@Override
public ActivityManager.TaskDescription getTaskDescription(ActivityManager.TaskDescription oldTaskDescription) {
String labelPrefix = "[" + VUserManager.get().getUserName() + "] ";
if (!oldTaskDescription.getLabel().startsWith(labelPrefix)) {
// Is it really necessary?
return new ActivityManager.TaskDescription(labelPrefix + oldTaskDescription.getLabel(), oldTaskDescription.getIcon(), oldTaskDescription.getPrimaryColor());
} else {
return oldTaskDescription;
}
}
示例3: getInstalledUsers
import com.lody.virtual.os.VUserManager; //导入依赖的package包/类
public List<Integer> getInstalledUsers() {
List<Integer> installedUsers = new LinkedList<>();
List<VUserInfo> users = VUserManager.get().getUsers();
for (VUserInfo info : users) {
if (VEnvironment.getDataUserPackageDirectory(info.id, packageName).exists()) {
installedUsers.add(info.id);
}
}
return installedUsers;
}
示例4: isUserLimitReachedLocked
import com.lody.virtual.os.VUserManager; //导入依赖的package包/类
/**
* Check if we've hit the limit of how many users can be created.
*/
private boolean isUserLimitReachedLocked() {
int nUsers = mUsers.size();
return nUsers >= VUserManager.getMaxSupportedUsers();
}