当前位置: 首页>>代码示例>>Java>>正文


Java Process.FIRST_APPLICATION_UID属性代码示例

本文整理汇总了Java中android.os.Process.FIRST_APPLICATION_UID属性的典型用法代码示例。如果您正苦于以下问题:Java Process.FIRST_APPLICATION_UID属性的具体用法?Java Process.FIRST_APPLICATION_UID怎么用?Java Process.FIRST_APPLICATION_UID使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在android.os.Process的用法示例。


在下文中一共展示了Process.FIRST_APPLICATION_UID属性的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: formatUid

public static void formatUid(StringBuilder sb, int uid) {
    if (uid < Process.FIRST_APPLICATION_UID) {
        sb.append(uid);
    } else {
        sb.append('u');
        sb.append(getUserId(uid));
        final int appId = getAppId(uid);
        if (appId >= FIRST_ISOLATED_UID && appId <= LAST_ISOLATED_UID) {
            sb.append('i');
            sb.append(appId - FIRST_ISOLATED_UID);
        } else if (appId >= Process.FIRST_APPLICATION_UID) {
            sb.append('a');
            sb.append(appId - Process.FIRST_APPLICATION_UID);
        } else {
            sb.append('s');
            sb.append(appId);
        }
    }
}
 
开发者ID:7763sea,项目名称:VirtualHook,代码行数:19,代码来源:VUserHandle.java

示例2: getUID

public static Integer getUID(String name) {
	if (name != null) {
		if (name.matches("^[0-9]+$")) {
			return Integer.parseInt(name);
		}
		
		if (UIDS.containsKey(name)) {
			return UIDS.get(name);
			
		} else if (name.startsWith("u")) {
			Integer sep = name.indexOf("_");

			if (sep > 0) {
				Integer uid = Integer.parseInt( name.substring(1, sep) );
				Integer gid = Integer.parseInt( name.substring(sep+2) );
				
				return uid * 100000 + ((Process.FIRST_APPLICATION_UID + gid) % 100000);
			}
		}
	}
	
	return -10000;
}
 
开发者ID:ujjwalagrawal17,项目名称:CodeCompilerApp,代码行数:23,代码来源:Common.java

示例3: isApp

/** @hide */
public static boolean isApp(int uid) {
    if (uid > 0) {
        final int appId = getAppId(uid);
        return appId >= Process.FIRST_APPLICATION_UID && appId <= Process.LAST_APPLICATION_UID;
    } else {
        return false;
    }
}
 
开发者ID:7763sea,项目名称:VirtualHook,代码行数:9,代码来源:VUserHandle.java

示例4: getAppIdFromSharedAppGid

/**
 * Returns the app id for a given shared app gid.
 * @hide
 */
public static int getAppIdFromSharedAppGid(int gid) {
    final int noUserGid = getAppId(gid);
    if (noUserGid < FIRST_SHARED_APPLICATION_GID ||
            noUserGid > LAST_SHARED_APPLICATION_GID) {
        throw new IllegalArgumentException(Integer.toString(gid) + " is not a shared app gid");
    }
    return (noUserGid + Process.FIRST_APPLICATION_UID) - FIRST_SHARED_APPLICATION_GID;
}
 
开发者ID:7763sea,项目名称:VirtualHook,代码行数:12,代码来源:VUserHandle.java

示例5: accept

public boolean accept(PackageManager pm, PackageInfo packageInfo, boolean showAllApps) {
    BreventActivity activity = getActivity();
    ApplicationInfo appInfo = packageInfo.applicationInfo;
    String packageName = packageInfo.packageName;
    // hard limit
    if (appInfo.uid < Process.FIRST_APPLICATION_UID) {
        return false;
    }
    // filter for fragment
    if (!mFragment.accept(pm, packageInfo)) {
        return false;
    }
    if (activity != null) {
        if (activity.isLauncher(packageName)) {
            // always show launcher
            return true;
        }
        if (activity.isGms(packageName)) {
            // always show gms
            return true;
        }
        if (activity.isBrevent(packageName)) {
            // always for brevented apps
            return true;
        }
    }
    if (showAllApps || mFragment.supportAllApps()) {
        // always for all apps
        return true;
    }
    return pm.getLaunchIntentForPackage(packageName) != null;
}
 
开发者ID:brevent,项目名称:Brevent,代码行数:32,代码来源:AppsItemAdapter.java

示例6: getUIDName

public static String getUIDName(Integer id) {
	if (UNAMES.containsKey(id)) {
		return UNAMES.get(id);
		
	} else if (id >= 10000) {
		Integer uid = id / 100000;
		Integer gid = id % Process.FIRST_APPLICATION_UID;

		return "u" + uid + "_a" + gid + "";
	}
	
	return null;
}
 
开发者ID:ujjwalagrawal17,项目名称:CodeCompilerApp,代码行数:13,代码来源:Common.java

示例7: isApplication

public static boolean isApplication(int uid) {
	uid = Util.getAppId(uid);
	return (uid >= Process.FIRST_APPLICATION_UID && uid <= Process.LAST_APPLICATION_UID);
}
 
开发者ID:ukanth,项目名称:XPrivacy,代码行数:4,代码来源:PrivacyManager.java


注:本文中的android.os.Process.FIRST_APPLICATION_UID属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。