当前位置: 首页 > news >正文

张店网站推广摘抄一篇新闻

张店网站推广,摘抄一篇新闻,尚义住房和城乡规划建设局网站,店铺怎么做推广和宣传简介 用户界面:System 》Multiple Users 》 开关多用户模式。 一般是不同用户模式下,有修改Settings应用配置的权限差异,因此需要通过用户类型对功能进行判断限制。 代码 通过UserManager可以获取当前用户的信息。 frameworks/base/core/…

简介

用户界面:System =》Multiple Users =》 开关多用户模式。

一般是不同用户模式下,有修改Settings应用配置的权限差异,因此需要通过用户类型对功能进行判断限制。

代码

通过UserManager可以获取当前用户的信息。

frameworks/base/core/java/android/os/UserManager.java

提供多种判断当前用户类型的接口

UserManager功能接口
APIComment
getUserType()

获取当前用户类型

@return the user type of the context user.

getUserName()

获取当前用户名

Returns the user name of the context user. This call is only available to applications on the system image.

isSystemUser()

判断是否为系统用户

Used to check if the context user is the system user. The system user is the initial user that is implicitly created on first boot and hosts most of the system services.

isGuestUser()

基于上下文,判断是否为访客用户

Used to check if the context user is a guest user. A guest user may be transient.

@return whether the context user is a guest user.

isGuestUser(@UserIdInt int userId)

判断指定ID是否为访客用户

Checks if a user is a guest user.

@return whether user is a guest user.

isUserAdmin(@UserIdInt int userId)

判断指定指定id的用户是否为admin(admin可以不唯一)

返回user.isAdmin()

@hide Returns whether the provided user is an admin user. There can be more than one admin user.

源码

/*** Manages users and user details on a multi-user system. There are two major categories of* users: fully customizable users with their own login, and profiles that share a workspace* with a related user.* <p>* Users are different from accounts, which are managed by* {@link AccountManager}. Each user can have their own set of accounts.* <p>* See {@link DevicePolicyManager#ACTION_PROVISION_MANAGED_PROFILE} for more on managed profiles.*/
@SystemService(Context.USER_SERVICE)
@android.ravenwood.annotation.RavenwoodKeepPartialClass
public class UserManager {/*** @return the user type of the context user.* @hide*/@TestApi@RequiresPermission(anyOf = {android.Manifest.permission.MANAGE_USERS,android.Manifest.permission.CREATE_USERS,android.Manifest.permission.QUERY_USERS})@UserHandleAwarepublic @NonNull String getUserType() {UserInfo userInfo = getUserInfo(mUserId);return userInfo == null ? "" : userInfo.userType;}

获取用户信息的方法

代码案例:

通过系统服务获取UserManager对象,然后根据需求get信息。

   //判断是否为Owner机主  private static boolean isAdminUser(Context context) {if (context == null) return false;final UserManager userManager = context.getSystemService(UserManager.class);if (userManager == null) return false;//获取当前用户类型 Log.d(TAG, "isAdminUser: Now user is " + userManager.getUserType());return userManager.isAdminUser();}

常见用户类型

常见类型是Owner,User和Guest。

多用户模式用户类型映射关系
StringUSER_TYPE用户场景说明
USER_TYPE_FULL_SYSTEMandroid.os.usertype.full.SYSTEM

Owner,即机主,adminUser。

 User type representing a {@link UserHandle#USER_SYSTEM system} user that is a human user.
 This type of user cannot be created; it can only pre-exist on first boot.
USER_TYPE_FULL_SECONDARYandroid.os.usertype.full.SECONDARYUser,非Owner(机主)用户。User type representing a regular non-profile non-{@link UserHandle#USER_SYSTEM system} human
user.
This is sometimes called an ordinary 'secondary user'.
USER_TYPE_FULL_GUESTandroid.os.usertype.full.GUESTGuset,访客模式User type representing a guest user that may be transient.
USER_TYPE_FULL_DEMOandroid.os.usertype.full.DEMO怎么变成demo?User type representing a user for demo purposes only, which can be removed at any time.
USER_TYPE_FULL_RESTRICTEDandroid.os.usertype.full.RESTRICTED受限用户,profile是什么?User type representing a "restricted profile" user, which is a full user that is subject to
certain restrictions from a parent user. Note, however, that it is NOT technically a profile.
USER_TYPE_PROFILE_MANAGEDandroid.os.usertype.profile.MANAGEDDPC是啥?APN里面有查询

User type representing a managed profile, which is a profile that is to be managed by a
device policy controller (DPC).
The intended purpose is for work profiles, which are managed by a corporate entity.

 @FlaggedApi(android.os.Flags.FLAG_ALLOW_PRIVATE_PROFILE)

USER_TYPE_PROFILE_CLONEandroid.os.usertype.profile.CLONE克隆某用户

User type representing a clone profile. Clone profile is a user profile type used to run
second instance of an otherwise single user App (eg, messengers). Currently only the
{@link android.content.pm.UserInfo#isMain()} user can have a clone profile.

@FlaggedApi(android.os.Flags.FLAG_ALLOW_PRIVATE_PROFILE)

USER_TYPE_PROFILE_PRIVATEandroid.os.usertype.profile.PRIVATE

User type representing a private profile. Private profile is a user profile that can be used
as an alternative user-space to install and use sensitive apps.
UI surfaces can adopt an alternative strategy to show apps belonging to this profile, in line
with their sensitive nature.
 

@FlaggedApi(android.os.Flags.FLAG_ALLOW_PRIVATE_PROFILE)

USER_TYPE_PROFILE_TESTandroid.os.usertype.profile.TEST测试User type representing a generic profile for testing purposes. Only on debuggable builds.
USER_TYPE_PROFILE_COMMUNALandroid.os.usertype.profile.COMMUNAL多个用户共享一些资源而不共享敏感信息。User type representing a communal profile, which is shared by all users of the device.
public static final String USER_TYPE_FULL_SYSTEM = "android.os.usertype.full.SYSTEM";
public static final String USER_TYPE_FULL_SECONDARY = "android.os.usertype.full.SECONDARY";
public static final String USER_TYPE_FULL_GUEST = "android.os.usertype.full.GUEST";
public static final String USER_TYPE_FULL_DEMO = "android.os.usertype.full.DEMO";
public static final String USER_TYPE_FULL_RESTRICTED = "android.os.usertype.full.RESTRICTED";
public static final String USER_TYPE_PROFILE_MANAGED = "android.os.usertype.profile.MANAGED";
public static final String USER_TYPE_PROFILE_CLONE = "android.os.usertype.profile.CLONE";
public static final String USER_TYPE_PROFILE_PRIVATE = "android.os.usertype.profile.PRIVATE";
public static final String USER_TYPE_PROFILE_TEST = "android.os.usertype.profile.TEST";
public static final String USER_TYPE_PROFILE_COMMUNAL = "android.os.usertype.profile.COMMUNAL";
public static final String USER_TYPE_FULL_SYSTEM = "android.os.usertype.full.SYSTEM";
public static final String USER_TYPE_FULL_SECONDARY = "android.os.usertype.full.SECONDARY";
public static final String USER_TYPE_FULL_GUEST = "android.os.usertype.full.GUEST";
public static final String USER_TYPE_FULL_DEMO = "android.os.usertype.full.DEMO";
public static final String USER_TYPE_FULL_RESTRICTED = "android.os.usertype.full.RESTRICTED";
public static final String USER_TYPE_PROFILE_MANAGED = "android.os.usertype.profile.MANAGED";
public static final String USER_TYPE_PROFILE_CLONE = "android.os.usertype.profile.CLONE";
public static final String USER_TYPE_PROFILE_PRIVATE = "android.os.usertype.profile.PRIVATE";
public static final String USER_TYPE_PROFILE_TEST = "android.os.usertype.profile.TEST";
public static final String USER_TYPE_PROFILE_COMMUNAL = "android.os.usertype.profile.COMMUNAL";
public static final String USER_TYPE_SYSTEM_HEADLESS = "android.os.usertype.system.HEADLESS";

http://www.dinnco.com/news/82010.html

相关文章:

  • 电子政务网站建设法律法规网络营销推广与策划
  • PC网站开发的意义百度推广怎么做效果好
  • 珠海企业网站建设报价网站seo优化分析
  • 潍坊市坊子区建设局网站哪里的网络推广培训好
  • 如何做网站的线下推广营销推广48个方法
  • 店招搜索栏在那个网站上可以做东莞网站制作十年乐云seo
  • WordPress未声明图片大小湖北短视频搜索seo
  • 做网站做什么赚钱搜索引擎营销的作用
  • wordpress4.4.1下载seo工程师是什么职业
  • 做旅游网站有前途吗廊坊网站建设优化
  • 阳西县网络问政平台公众号学seo的培训学校
  • 科学家做实验的网站产品推广的目的和意义
  • 郑州模板建站平台站长推荐
  • 站长交易网网络广告设计
  • 武汉建设规划全国最好网络优化公司
  • 做网站需要准备的素材网络搜索工具
  • 冷水滩互联网建设西安seo网站优化
  • 新会网站建设网络营销推广的手段
  • 小程序怎么做微网站链接软文代写新闻稿
  • 电子商务网站开发课程设计seo每日工作
  • 做网站设计素材关键词研究工具
  • 专门做日本旅游的网站抖音seo是什么
  • 吴忠门户网站建设站长统计app下载大全
  • 河间做网站培训学校管理系统
  • ubc网站谁做的平台推广是什么意思
  • wordpress 函数长沙seo网络推广
  • 动态网站开发工程师证黑帽seo联系方式
  • 佛山网站制作哪里好seo网站关键词优化软件
  • 网站接广告平台产品网络推广
  • 企业手机网站建设机构web前端培训费用大概多少