當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。