3D MAx报错 The software license check out

本文介绍了三种解决3ds Max许可证问题的方法:删除许可证文件、替换adlmint.dll文件及启动FLEXnet Licensing Service服务。此外,还提到了需要删除的备份文件路径。
部署运行你感兴趣的模型镜像
第一种:删除注册文件,把max的许可证文件删掉,重新进行注册即可!软件新版本的许可证文件位置与以前不同,
XP:C:\Documents and Settings\All Users\Application Data\FLEXnet\adskflex_tsf.datawin7:C:\ProgramData\FLEXnet\adskflex_tsf.data


第二种:下载破解文件 adlmint.dll 替换安装目录下的同名文件,直接将破解 Crack 文件下的 adlmint.dll 复制替换 C:\Program Files\Autodesk\3ds Max 2016\adlmint.dll(从其他已经破解的电脑中拷贝这个文件直接使用)


第三种:这是应为你的电脑关闭了一项服务而已。在 计算机》管理》服务》找到FLEXnet licensing Service 启动它就行。




再一个删除这个文件'C:\ProgramData\FLEXnet\adskflex_00691b00_tsf.data_backup.001


还有一个证可证,在另一个文件夹里,把这个文件删掉就可以重新生成许可了。也就是只有删除后重新安装软件才有效。C:\Documents and Settings\Administrator\Application Data\FLEXnet

您可能感兴趣的与本文相关的镜像

Stable-Diffusion-3.5

Stable-Diffusion-3.5

图片生成
Stable-Diffusion

Stable Diffusion 3.5 (SD 3.5) 是由 Stability AI 推出的新一代文本到图像生成模型,相比 3.0 版本,它提升了图像质量、运行速度和硬件效率

/* * Copyright (C) 2021 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package android.car.builtin.os; import android.annotation.NonNull; import android.annotation.SystemApi; import android.annotation.UserIdInt; import android.content.Context; import android.content.pm.UserInfo; import android.os.SystemProperties; import android.os.UserHandle; import android.os.UserManager; import java.util.ArrayList; import java.util.List; /** * Helper for User related operations. * * @hide */ @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES) public final class UserManagerHelper { private UserManagerHelper() { throw new UnsupportedOperationException(); } /** user id for invalid user */ public static final @UserIdInt int USER_NULL = UserHandle.USER_NULL; /** A user id constant to indicate the "system" user of the device */ public static final @UserIdInt int USER_SYSTEM = UserHandle.USER_SYSTEM; /** A user id constant to indicate "all" users of the device */ public static final @UserIdInt int USER_ALL = UserHandle.USER_ALL; // Flags copied from UserInfo. public static final int FLAG_PRIMARY = UserInfo.FLAG_PRIMARY; public static final int FLAG_ADMIN = UserInfo.FLAG_ADMIN; public static final int FLAG_GUEST = UserInfo.FLAG_GUEST; public static final int FLAG_RESTRICTED = UserInfo.FLAG_RESTRICTED; public static final int FLAG_INITIALIZED = UserInfo.FLAG_INITIALIZED; public static final int FLAG_MANAGED_PROFILE = UserInfo.FLAG_MANAGED_PROFILE; public static final int FLAG_DISABLED = UserInfo.FLAG_DISABLED; public static final int FLAG_QUIET_MODE = UserInfo.FLAG_QUIET_MODE; public static final int FLAG_EPHEMERAL = UserInfo.FLAG_EPHEMERAL; public static final int FLAG_DEMO = UserInfo.FLAG_DEMO; public static final int FLAG_FULL = UserInfo.FLAG_FULL; public static final int FLAG_SYSTEM = UserInfo.FLAG_SYSTEM; public static final int FLAG_PROFILE = UserInfo.FLAG_PROFILE; /** * Returns all user handles. */ @NonNull public static List<UserHandle> getUserHandles(@NonNull UserManager userManager, boolean excludeDying) { return userManager.getUserHandles(excludeDying); } /** * Returns all users based on the boolean flags. * * @deprecated Use {@link #getUserHandles(UserManager, boolean)} instead. */ @Deprecated @NonNull public static List<UserHandle> getUserHandles(@NonNull UserManager userManager, boolean excludePartial, boolean excludeDying, boolean excludePreCreated) { List<UserInfo> users = userManager.getUsers(excludePartial, excludeDying, excludePreCreated); List<UserHandle> result = new ArrayList<>(users.size()); for (UserInfo user : users) { result.add(user.getUserHandle()); } return result; } /** * Checks if a user is ephemeral. */ public static boolean isEphemeralUser(@NonNull UserManager userManager, @NonNull UserHandle user) { return userManager.isUserEphemeral(user.getIdentifier()); } /** Checks if the user is guest. */ public static boolean isGuestUser(@NonNull UserManager userManager, @NonNull UserHandle user) { return userManager.isGuestUser(user.getIdentifier()); } /** Checks if the user is a full user. */ public static boolean isFullUser(@NonNull UserManager userManager, @NonNull UserHandle user) { UserInfo info = userManager.getUserInfo(user.getIdentifier()); return info != null && info.isFull(); } /** * Checks if a user is enabled. */ public static boolean isEnabledUser(@NonNull UserManager userManager, @NonNull UserHandle user) { return userManager.getUserInfo(user.getIdentifier()).isEnabled(); } /** * Checks if a user is initialized. */ public static boolean isInitializedUser(@NonNull UserManager userManager, @NonNull UserHandle user) { return userManager.getUserInfo(user.getIdentifier()).isInitialized(); } /** * Gets DefaultUserType given userInfo flags. */ public static String getDefaultUserTypeForUserInfoFlags(int userInfoFlag) { return UserInfo.getDefaultUserType(userInfoFlag); } /** * Gets the default name for a user. */ @NonNull public static String getDefaultUserName(@NonNull Context context) { return context.getResources().getString(com.android.internal.R.string.owner_name); } /** * Gets the maximum number of users that can be running at any given time. */ public static int getMaxRunningUsers(@NonNull Context context) { return context.getResources() .getInteger(com.android.internal.R.integer.config_multiuserMaxRunningUsers); } /** * Marks guest for deletion */ public static boolean markGuestForDeletion(@NonNull UserManager userManager, @NonNull UserHandle user) { return userManager.markGuestForDeletion(user.getIdentifier()); } /** * Returns the user id for a given uid. */ public static @UserIdInt int getUserId(int uid) { return UserHandle.getUserId(uid); } /** Check {@link UserManager#isVisibleBackgroundUsersSupported()}. */ public static boolean isVisibleBackgroundUsersSupported(@NonNull UserManager userManager) { return userManager.isVisibleBackgroundUsersSupported(); } /** Check {@link UserManager#isVisibleBackgroundUsersOnDefaultDisplaySupported()}. */ public static boolean isVisibleBackgroundUsersOnDefaultDisplaySupported( @NonNull UserManager userManager) { return userManager.isVisibleBackgroundUsersOnDefaultDisplaySupported(); } /** Check {@link UserManager#getMaxSupportedUsers()}. */ public static int getMaxSupportedUsers(@NonNull Context context) { return Math.max(1, SystemProperties.getInt("fw.max_users", context.getResources().getSystem().getInteger( com.android.internal.R.integer.config_multiuserMaximumUsers))); } /** Check {@link UserManager#getMainDisplayIdAssignedToUser()}. */ public static int getMainDisplayIdAssignedToUser(@NonNull UserManager userManager) { return userManager.getMainDisplayIdAssignedToUser(); } } /* * Copyright (C) 2021 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package android.car.builtin.os; import android.annotation.NonNull; import android.annotation.SystemApi; import android.annotation.UserIdInt; import android.content.Context; import android.content.pm.UserInfo; import android.os.SystemProperties; import android.os.UserHandle; import android.os.UserManager; import java.util.ArrayList; import java.util.List; /** * Helper for User related operations. * * @hide */ @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES) public final class UserManagerHelper { private UserManagerHelper() { throw new UnsupportedOperationException(); } /** user id for invalid user */ public static final @UserIdInt int USER_NULL = UserHandle.USER_NULL; /** A user id constant to indicate the "system" user of the device */ public static final @UserIdInt int USER_SYSTEM = UserHandle.USER_SYSTEM; /** A user id constant to indicate "all" users of the device */ public static final @UserIdInt int USER_ALL = UserHandle.USER_ALL; // Flags copied from UserInfo. public static final int FLAG_PRIMARY = UserInfo.FLAG_PRIMARY; public static final int FLAG_ADMIN = UserInfo.FLAG_ADMIN; public static final int FLAG_GUEST = UserInfo.FLAG_GUEST; public static final int FLAG_RESTRICTED = UserInfo.FLAG_RESTRICTED; public static final int FLAG_INITIALIZED = UserInfo.FLAG_INITIALIZED; public static final int FLAG_MANAGED_PROFILE = UserInfo.FLAG_MANAGED_PROFILE; public static final int FLAG_DISABLED = UserInfo.FLAG_DISABLED; public static final int FLAG_QUIET_MODE = UserInfo.FLAG_QUIET_MODE; public static final int FLAG_EPHEMERAL = UserInfo.FLAG_EPHEMERAL; public static final int FLAG_DEMO = UserInfo.FLAG_DEMO; public static final int FLAG_FULL = UserInfo.FLAG_FULL; public static final int FLAG_SYSTEM = UserInfo.FLAG_SYSTEM; public static final int FLAG_PROFILE = UserInfo.FLAG_PROFILE; /** * Returns all user handles. */ @NonNull public static List<UserHandle> getUserHandles(@NonNull UserManager userManager, boolean excludeDying) { return userManager.getUserHandles(excludeDying); } /** * Returns all users based on the boolean flags. * * @deprecated Use {@link #getUserHandles(UserManager, boolean)} instead. */ @Deprecated @NonNull public static List<UserHandle> getUserHandles(@NonNull UserManager userManager, boolean excludePartial, boolean excludeDying, boolean excludePreCreated) { List<UserInfo> users = userManager.getUsers(excludePartial, excludeDying, excludePreCreated); List<UserHandle> result = new ArrayList<>(users.size()); for (UserInfo user : users) { result.add(user.getUserHandle()); } return result; } /** * Checks if a user is ephemeral. */ public static boolean isEphemeralUser(@NonNull UserManager userManager, @NonNull UserHandle user) { return userManager.isUserEphemeral(user.getIdentifier()); } /** Checks if the user is guest. */ public static boolean isGuestUser(@NonNull UserManager userManager, @NonNull UserHandle user) { return userManager.isGuestUser(user.getIdentifier()); } /** Checks if the user is a full user. */ public static boolean isFullUser(@NonNull UserManager userManager, @NonNull UserHandle user) { UserInfo info = userManager.getUserInfo(user.getIdentifier()); return info != null && info.isFull(); } /** * Checks if a user is enabled. */ public static boolean isEnabledUser(@NonNull UserManager userManager, @NonNull UserHandle user) { return userManager.getUserInfo(user.getIdentifier()).isEnabled(); } /** * Checks if a user is initialized. */ public static boolean isInitializedUser(@NonNull UserManager userManager, @NonNull UserHandle user) { return userManager.getUserInfo(user.getIdentifier()).isInitialized(); } /** * Gets DefaultUserType given userInfo flags. */ public static String getDefaultUserTypeForUserInfoFlags(int userInfoFlag) { return UserInfo.getDefaultUserType(userInfoFlag); } /** * Gets the default name for a user. */ @NonNull public static String getDefaultUserName(@NonNull Context context) { return context.getResources().getString(com.android.internal.R.string.owner_name); } /** * Gets the maximum number of users that can be running at any given time. */ public static int getMaxRunningUsers(@NonNull Context context) { return context.getResources() .getInteger(com.android.internal.R.integer.config_multiuserMaxRunningUsers); } /** * Marks guest for deletion */ public static boolean markGuestForDeletion(@NonNull UserManager userManager, @NonNull UserHandle user) { return userManager.markGuestForDeletion(user.getIdentifier()); } /** * Returns the user id for a given uid. */ public static @UserIdInt int getUserId(int uid) { return UserHandle.getUserId(uid); } /** Check {@link UserManager#isVisibleBackgroundUsersSupported()}. */ public static boolean isVisibleBackgroundUsersSupported(@NonNull UserManager userManager) { return userManager.isVisibleBackgroundUsersSupported(); } /** Check {@link UserManager#isVisibleBackgroundUsersOnDefaultDisplaySupported()}. */ public static boolean isVisibleBackgroundUsersOnDefaultDisplaySupported( @NonNull UserManager userManager) { return userManager.isVisibleBackgroundUsersOnDefaultDisplaySupported(); } /** Check {@link UserManager#getMaxSupportedUsers()}. */ public static int getMaxSupportedUsers(@NonNull Context context) { return Math.max(1, SystemProperties.getInt("fw.max_users", context.getResources().getSystem().getInteger( com.android.internal.R.integer.config_multiuserMaximumUsers))); } /** Check {@link UserManager#getMainDisplayIdAssignedToUser()}. */ public static int getMainDisplayIdAssignedToUser(@NonNull UserManager userManager) { return userManager.getMainDisplayIdAssignedToUser(); } } /* * Copyright (C) 2021 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package android.car.builtin.os; import android.annotation.NonNull; import android.annotation.SystemApi; import android.annotation.UserIdInt; import android.content.Context; import android.content.pm.UserInfo; import android.os.SystemProperties; import android.os.UserHandle; import android.os.UserManager; import java.util.ArrayList; import java.util.List; /** * Helper for User related operations. * * @hide */ @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES) public final class UserManagerHelper { private UserManagerHelper() { throw new UnsupportedOperationException(); } /** user id for invalid user */ public static final @UserIdInt int USER_NULL = UserHandle.USER_NULL; /** A user id constant to indicate the "system" user of the device */ public static final @UserIdInt int USER_SYSTEM = UserHandle.USER_SYSTEM; /** A user id constant to indicate "all" users of the device */ public static final @UserIdInt int USER_ALL = UserHandle.USER_ALL; // Flags copied from UserInfo. public static final int FLAG_PRIMARY = UserInfo.FLAG_PRIMARY; public static final int FLAG_ADMIN = UserInfo.FLAG_ADMIN; public static final int FLAG_GUEST = UserInfo.FLAG_GUEST; public static final int FLAG_RESTRICTED = UserInfo.FLAG_RESTRICTED; public static final int FLAG_INITIALIZED = UserInfo.FLAG_INITIALIZED; public static final int FLAG_MANAGED_PROFILE = UserInfo.FLAG_MANAGED_PROFILE; public static final int FLAG_DISABLED = UserInfo.FLAG_DISABLED; public static final int FLAG_QUIET_MODE = UserInfo.FLAG_QUIET_MODE; public static final int FLAG_EPHEMERAL = UserInfo.FLAG_EPHEMERAL; public static final int FLAG_DEMO = UserInfo.FLAG_DEMO; public static final int FLAG_FULL = UserInfo.FLAG_FULL; public static final int FLAG_SYSTEM = UserInfo.FLAG_SYSTEM; public static final int FLAG_PROFILE = UserInfo.FLAG_PROFILE; /** * Returns all user handles. */ @NonNull public static List<UserHandle> getUserHandles(@NonNull UserManager userManager, boolean excludeDying) { return userManager.getUserHandles(excludeDying); } /** * Returns all users based on the boolean flags. * * @deprecated Use {@link #getUserHandles(UserManager, boolean)} instead. */ @Deprecated @NonNull public static List<UserHandle> getUserHandles(@NonNull UserManager userManager, boolean excludePartial, boolean excludeDying, boolean excludePreCreated) { List<UserInfo> users = userManager.getUsers(excludePartial, excludeDying, excludePreCreated); List<UserHandle> result = new ArrayList<>(users.size()); for (UserInfo user : users) { result.add(user.getUserHandle()); } return result; } /** * Checks if a user is ephemeral. */ public static boolean isEphemeralUser(@NonNull UserManager userManager, @NonNull UserHandle user) { return userManager.isUserEphemeral(user.getIdentifier()); } /** Checks if the user is guest. */ public static boolean isGuestUser(@NonNull UserManager userManager, @NonNull UserHandle user) { return userManager.isGuestUser(user.getIdentifier()); } /** Checks if the user is a full user. */ public static boolean isFullUser(@NonNull UserManager userManager, @NonNull UserHandle user) { UserInfo info = userManager.getUserInfo(user.getIdentifier()); return info != null && info.isFull(); } /** * Checks if a user is enabled. */ public static boolean isEnabledUser(@NonNull UserManager userManager, @NonNull UserHandle user) { return userManager.getUserInfo(user.getIdentifier()).isEnabled(); } /** * Checks if a user is initialized. */ public static boolean isInitializedUser(@NonNull UserManager userManager, @NonNull UserHandle user) { return userManager.getUserInfo(user.getIdentifier()).isInitialized(); } /** * Gets DefaultUserType given userInfo flags. */ public static String getDefaultUserTypeForUserInfoFlags(int userInfoFlag) { return UserInfo.getDefaultUserType(userInfoFlag); } /** * Gets the default name for a user. */ @NonNull public static String getDefaultUserName(@NonNull Context context) { return context.getResources().getString(com.android.internal.R.string.owner_name); } /** * Gets the maximum number of users that can be running at any given time. */ public static int getMaxRunningUsers(@NonNull Context context) { return context.getResources() .getInteger(com.android.internal.R.integer.config_multiuserMaxRunningUsers); } /** * Marks guest for deletion */ public static boolean markGuestForDeletion(@NonNull UserManager userManager, @NonNull UserHandle user) { return userManager.markGuestForDeletion(user.getIdentifier()); } /** * Returns the user id for a given uid. */ public static @UserIdInt int getUserId(int uid) { return UserHandle.getUserId(uid); } /** Check {@link UserManager#isVisibleBackgroundUsersSupported()}. */ public static boolean isVisibleBackgroundUsersSupported(@NonNull UserManager userManager) { return userManager.isVisibleBackgroundUsersSupported(); } /** Check {@link UserManager#isVisibleBackgroundUsersOnDefaultDisplaySupported()}. */ public static boolean isVisibleBackgroundUsersOnDefaultDisplaySupported( @NonNull UserManager userManager) { return userManager.isVisibleBackgroundUsersOnDefaultDisplaySupported(); } /** Check {@link UserManager#getMaxSupportedUsers()}. */ public static int getMaxSupportedUsers(@NonNull Context context) { return Math.max(1, SystemProperties.getInt("fw.max_users", context.getResources().getSystem().getInteger( com.android.internal.R.integer.config_multiuserMaximumUsers))); } /** Check {@link UserManager#getMainDisplayIdAssignedToUser()}. */ public static int getMainDisplayIdAssignedToUser(@NonNull UserManager userManager) { return userManager.getMainDisplayIdAssignedToUser(); } } /* * Copyright (C) 2021 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package android.car.builtin.os; import android.annotation.NonNull; import android.annotation.SystemApi; import android.annotation.UserIdInt; import android.content.Context; import android.content.pm.UserInfo; import android.os.SystemProperties; import android.os.UserHandle; import android.os.UserManager; import java.util.ArrayList; import java.util.List; /** * Helper for User related operations. * * @hide */ @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES) public final class UserManagerHelper { private UserManagerHelper() { throw new UnsupportedOperationException(); } /** user id for invalid user */ public static final @UserIdInt int USER_NULL = UserHandle.USER_NULL; /** A user id constant to indicate the "system" user of the device */ public static final @UserIdInt int USER_SYSTEM = UserHandle.USER_SYSTEM; /** A user id constant to indicate "all" users of the device */ public static final @UserIdInt int USER_ALL = UserHandle.USER_ALL; // Flags copied from UserInfo. public static final int FLAG_PRIMARY = UserInfo.FLAG_PRIMARY; public static final int FLAG_ADMIN = UserInfo.FLAG_ADMIN; public static final int FLAG_GUEST = UserInfo.FLAG_GUEST; public static final int FLAG_RESTRICTED = UserInfo.FLAG_RESTRICTED; public static final int FLAG_INITIALIZED = UserInfo.FLAG_INITIALIZED; public static final int FLAG_MANAGED_PROFILE = UserInfo.FLAG_MANAGED_PROFILE; public static final int FLAG_DISABLED = UserInfo.FLAG_DISABLED; public static final int FLAG_QUIET_MODE = UserInfo.FLAG_QUIET_MODE; public static final int FLAG_EPHEMERAL = UserInfo.FLAG_EPHEMERAL; public static final int FLAG_DEMO = UserInfo.FLAG_DEMO; public static final int FLAG_FULL = UserInfo.FLAG_FULL; public static final int FLAG_SYSTEM = UserInfo.FLAG_SYSTEM; public static final int FLAG_PROFILE = UserInfo.FLAG_PROFILE; /** * Returns all user handles. */ @NonNull public static List<UserHandle> getUserHandles(@NonNull UserManager userManager, boolean excludeDying) { return userManager.getUserHandles(excludeDying); } /** * Returns all users based on the boolean flags. * * @deprecated Use {@link #getUserHandles(UserManager, boolean)} instead. */ @Deprecated @NonNull public static List<UserHandle> getUserHandles(@NonNull UserManager userManager, boolean excludePartial, boolean excludeDying, boolean excludePreCreated) { List<UserInfo> users = userManager.getUsers(excludePartial, excludeDying, excludePreCreated); List<UserHandle> result = new ArrayList<>(users.size()); for (UserInfo user : users) { result.add(user.getUserHandle()); } return result; } /** * Checks if a user is ephemeral. */ public static boolean isEphemeralUser(@NonNull UserManager userManager, @NonNull UserHandle user) { return userManager.isUserEphemeral(user.getIdentifier()); } /** Checks if the user is guest. */ public static boolean isGuestUser(@NonNull UserManager userManager, @NonNull UserHandle user) { return userManager.isGuestUser(user.getIdentifier()); } /** Checks if the user is a full user. */ public static boolean isFullUser(@NonNull UserManager userManager, @NonNull UserHandle user) { UserInfo info = userManager.getUserInfo(user.getIdentifier()); return info != null && info.isFull(); } /** * Checks if a user is enabled. */ public static boolean isEnabledUser(@NonNull UserManager userManager, @NonNull UserHandle user) { return userManager.getUserInfo(user.getIdentifier()).isEnabled(); } /** * Checks if a user is initialized. */ public static boolean isInitializedUser(@NonNull UserManager userManager, @NonNull UserHandle user) { return userManager.getUserInfo(user.getIdentifier()).isInitialized(); } /** * Gets DefaultUserType given userInfo flags. */ public static String getDefaultUserTypeForUserInfoFlags(int userInfoFlag) { return UserInfo.getDefaultUserType(userInfoFlag); } /** * Gets the default name for a user. */ @NonNull public static String getDefaultUserName(@NonNull Context context) { return context.getResources().getString(com.android.internal.R.string.owner_name); } /** * Gets the maximum number of users that can be running at any given time. */ public static int getMaxRunningUsers(@NonNull Context context) { return context.getResources() .getInteger(com.android.internal.R.integer.config_multiuserMaxRunningUsers); } /** * Marks guest for deletion */ public static boolean markGuestForDeletion(@NonNull UserManager userManager, @NonNull UserHandle user) { return userManager.markGuestForDeletion(user.getIdentifier()); } /** * Returns the user id for a given uid. */ public static @UserIdInt int getUserId(int uid) { return UserHandle.getUserId(uid); } /** Check {@link UserManager#isVisibleBackgroundUsersSupported()}. */ public static boolean isVisibleBackgroundUsersSupported(@NonNull UserManager userManager) { return userManager.isVisibleBackgroundUsersSupported(); } /** Check {@link UserManager#isVisibleBackgroundUsersOnDefaultDisplaySupported()}. */ public static boolean isVisibleBackgroundUsersOnDefaultDisplaySupported( @NonNull UserManager userManager) { return userManager.isVisibleBackgroundUsersOnDefaultDisplaySupported(); } /** Check {@link UserManager#getMaxSupportedUsers()}. */ public static int getMaxSupportedUsers(@NonNull Context context) { return Math.max(1, SystemProperties.getInt("fw.max_users", context.getResources().getSystem().getInteger( com.android.internal.R.integer.config_multiuserMaximumUsers))); } /** Check {@link UserManager#getMainDisplayIdAssignedToUser()}. */ public static int getMainDisplayIdAssignedToUser(@NonNull UserManager userManager) { return userManager.getMainDisplayIdAssignedToUser(); } } CarUserManager/* * Copyright (C) 2021 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package android.car.builtin.os; import android.annotation.NonNull; import android.annotation.SystemApi; import android.annotation.UserIdInt; import android.content.Context; import android.content.pm.UserInfo; import android.os.SystemProperties; import android.os.UserHandle; import android.os.UserManager; import java.util.ArrayList; import java.util.List; /** * Helper for User related operations. * * @hide */ @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES) public final class UserManagerHelper { private UserManagerHelper() { throw new UnsupportedOperationException(); } /** user id for invalid user */ public static final @UserIdInt int USER_NULL = UserHandle.USER_NULL; /** A user id constant to indicate the "system" user of the device */ public static final @UserIdInt int USER_SYSTEM = UserHandle.USER_SYSTEM; /** A user id constant to indicate "all" users of the device */ public static final @UserIdInt int USER_ALL = UserHandle.USER_ALL; // Flags copied from UserInfo. public static final int FLAG_PRIMARY = UserInfo.FLAG_PRIMARY; public static final int FLAG_ADMIN = UserInfo.FLAG_ADMIN; public static final int FLAG_GUEST = UserInfo.FLAG_GUEST; public static final int FLAG_RESTRICTED = UserInfo.FLAG_RESTRICTED; public static final int FLAG_INITIALIZED = UserInfo.FLAG_INITIALIZED; public static final int FLAG_MANAGED_PROFILE = UserInfo.FLAG_MANAGED_PROFILE; public static final int FLAG_DISABLED = UserInfo.FLAG_DISABLED; public static final int FLAG_QUIET_MODE = UserInfo.FLAG_QUIET_MODE; public static final int FLAG_EPHEMERAL = UserInfo.FLAG_EPHEMERAL; public static final int FLAG_DEMO = UserInfo.FLAG_DEMO; public static final int FLAG_FULL = UserInfo.FLAG_FULL; public static final int FLAG_SYSTEM = UserInfo.FLAG_SYSTEM; public static final int FLAG_PROFILE = UserInfo.FLAG_PROFILE; /** * Returns all user handles. */ @NonNull public static List<UserHandle> getUserHandles(@NonNull UserManager userManager, boolean excludeDying) { return userManager.getUserHandles(excludeDying); } /** * Returns all users based on the boolean flags. * * @deprecated Use {@link #getUserHandles(UserManager, boolean)} instead. */ @Deprecated @NonNull public static List<UserHandle> getUserHandles(@NonNull UserManager userManager, boolean excludePartial, boolean excludeDying, boolean excludePreCreated) { List<UserInfo> users = userManager.getUsers(excludePartial, excludeDying, excludePreCreated); List<UserHandle> result = new ArrayList<>(users.size()); for (UserInfo user : users) { result.add(user.getUserHandle()); } return result; } /** * Checks if a user is ephemeral. */ public static boolean isEphemeralUser(@NonNull UserManager userManager, @NonNull UserHandle user) { return userManager.isUserEphemeral(user.getIdentifier()); } /** Checks if the user is guest. */ public static boolean isGuestUser(@NonNull UserManager userManager, @NonNull UserHandle user) { return userManager.isGuestUser(user.getIdentifier()); } /** Checks if the user is a full user. */ public static boolean isFullUser(@NonNull UserManager userManager, @NonNull UserHandle user) { UserInfo info = userManager.getUserInfo(user.getIdentifier()); return info != null && info.isFull(); } /** * Checks if a user is enabled. */ public static boolean isEnabledUser(@NonNull UserManager userManager, @NonNull UserHandle user) { return userManager.getUserInfo(user.getIdentifier()).isEnabled(); } /** * Checks if a user is initialized. */ public static boolean isInitializedUser(@NonNull UserManager userManager, @NonNull UserHandle user) { return userManager.getUserInfo(user.getIdentifier()).isInitialized(); } /** * Gets DefaultUserType given userInfo flags. */ public static String getDefaultUserTypeForUserInfoFlags(int userInfoFlag) { return UserInfo.getDefaultUserType(userInfoFlag); } /** * Gets the default name for a user. */ @NonNull public static String getDefaultUserName(@NonNull Context context) { return context.getResources().getString(com.android.internal.R.string.owner_name); } /** * Gets the maximum number of users that can be running at any given time. */ public static int getMaxRunningUsers(@NonNull Context context) { return context.getResources() .getInteger(com.android.internal.R.integer.config_multiuserMaxRunningUsers); } /** * Marks guest for deletion */ public static boolean markGuestForDeletion(@NonNull UserManager userManager, @NonNull UserHandle user) { return userManager.markGuestForDeletion(user.getIdentifier()); } /** * Returns the user id for a given uid. */ public static @UserIdInt int getUserId(int uid) { return UserHandle.getUserId(uid); } /** Check {@link UserManager#isVisibleBackgroundUsersSupported()}. */ public static boolean isVisibleBackgroundUsersSupported(@NonNull UserManager userManager) { return userManager.isVisibleBackgroundUsersSupported(); } /** Check {@link UserManager#isVisibleBackgroundUsersOnDefaultDisplaySupported()}. */ public static boolean isVisibleBackgroundUsersOnDefaultDisplaySupported( @NonNull UserManager userManager) { return userManager.isVisibleBackgroundUsersOnDefaultDisplaySupported(); } /** Check {@link UserManager#getMaxSupportedUsers()}. */ public static int getMaxSupportedUsers(@NonNull Context context) { return Math.max(1, SystemProperties.getInt("fw.max_users", context.getResources().getSystem().getInteger( com.android.internal.R.integer.config_multiuserMaximumUsers))); } /** Check {@link UserManager#getMainDisplayIdAssignedToUser()}. */ public static int getMainDisplayIdAssignedToUser(@NonNull UserManager userManager) { return userManager.getMainDisplayIdAssignedToUser(); } } where CarUserManager
最新发布
07-02
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值