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


Java ApplicationInfo.FLAG_UPDATED_SYSTEM_APP属性代码示例

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


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

示例1: isSysApp

public static boolean isSysApp(Context context, String pkgName) {
        if (context == null || TextUtils.isEmpty(pkgName)) {
            return false;
        }

        try {
            PackageManager packageManager = context.getPackageManager();
            ApplicationInfo applicationInfo = packageManager.getPackageInfo(pkgName, 0).applicationInfo;
//            return (applicationInfo.flags & ApplicationInfo.FLAG_SYSTEM) == ApplicationInfo.FLAG_SYSTEM;
            return ((ApplicationInfo.FLAG_SYSTEM | ApplicationInfo.FLAG_UPDATED_SYSTEM_APP)
                    & applicationInfo.flags) != 0;
        } catch (Exception e) {
            e.printStackTrace();
        }

        return false;
    }
 
开发者ID:homeii,项目名称:GxIconDIY,代码行数:17,代码来源:PkgUtil.java

示例2: getNameOfAppsArray

public ArrayList<String> getNameOfAppsArray() {
    PackageManager pm = context.getPackageManager();
    listOfAppInfo = pm.getInstalledApplications(pm.GET_META_DATA);
    for(ApplicationInfo app : listOfAppInfo) {

        if(pm.getLaunchIntentForPackage(app.packageName) != null) {
            // apps with launcher intent
            if((app.flags & ApplicationInfo.FLAG_UPDATED_SYSTEM_APP) == 1) {
                // updated system apps

            } else if ((app.flags & ApplicationInfo.FLAG_SYSTEM) == 1) {
                // system apps

            } else {
                // user installed apps
                nameOfAppsArray.add((String) pm.getApplicationLabel(app));
            }
        }
    }
    return nameOfAppsArray;
}
 
开发者ID:01sadra,项目名称:Detoxiom,代码行数:21,代码来源:AppNameAndLogoProvider.java

示例3: getAppLogosArray

public ArrayList<Drawable> getAppLogosArray() {
    PackageManager pm = context.getPackageManager();
    listOfAppInfo = pm.getInstalledApplications(pm.GET_META_DATA);

    for(ApplicationInfo app : listOfAppInfo) {

        if(pm.getLaunchIntentForPackage(app.packageName) != null) {
            // apps with launcher intent
            if((app.flags & ApplicationInfo.FLAG_UPDATED_SYSTEM_APP) == 1) {
                // updated system apps

            } else if ((app.flags & ApplicationInfo.FLAG_SYSTEM) == 1) {
                // system apps

            } else {
                // user installed apps
                appLogosArray.add(app.loadIcon(pm));

            }
        }

    }
    return appLogosArray;
}
 
开发者ID:01sadra,项目名称:Detoxiom,代码行数:24,代码来源:AppNameAndLogoProvider.java

示例4: isSystem

public boolean isSystem() {
	boolean mSystem = false;
	for (ApplicationInfo appInfo : mMapAppInfo.values()) {
		mSystem = ((appInfo.flags & (ApplicationInfo.FLAG_SYSTEM | ApplicationInfo.FLAG_UPDATED_SYSTEM_APP)) != 0);
		mSystem = mSystem || appInfo.packageName.equals(this.getClass().getPackage().getName());
		mSystem = mSystem || appInfo.packageName.equals(this.getClass().getPackage().getName() + ".pro");
		mSystem = mSystem || appInfo.packageName.equals("de.robv.android.xposed.installer");
	}
	return mSystem;
}
 
开发者ID:ukanth,项目名称:XPrivacy,代码行数:10,代码来源:ApplicationInfoEx.java

示例5: isThirdPartyApp

/**
 * 判断应用是否是第三方应用
 *
 * @param appInfo
 * @return
 */
public static boolean isThirdPartyApp(ApplicationInfo appInfo) {
    boolean flag = false;
    if ((appInfo.flags & ApplicationInfo.FLAG_UPDATED_SYSTEM_APP) != 0) {
        // 可更新的系统应用
        flag = true;
    } else if ((appInfo.flags & ApplicationInfo.FLAG_SYSTEM) == 0) {
        // 非系统应用(第三方:用户自己安装)
        flag = true;
    }
    return flag;
}
 
开发者ID:stytooldex,项目名称:stynico,代码行数:17,代码来源:apitils.java

示例6: getNativeLibraryDirectory

/**
 * @return the path to native libraries.
 */
@SuppressWarnings("unused")
@CalledByNative
private static String getNativeLibraryDirectory(Context appContext) {
    ApplicationInfo ai = appContext.getApplicationInfo();
    if ((ai.flags & ApplicationInfo.FLAG_UPDATED_SYSTEM_APP) != 0
            || (ai.flags & ApplicationInfo.FLAG_SYSTEM) == 0) {
        return ai.nativeLibraryDir;
    }

    return "/system/lib/";
}
 
开发者ID:lizhangqu,项目名称:chromium-net-for-android,代码行数:14,代码来源:PathUtils.java

示例7: isSystemApp

private boolean isSystemApp(ApplicationInfo info) {
    if ((info.flags & ApplicationInfo.FLAG_UPDATED_SYSTEM_APP) != 0) {
        return false;
    } else if ((info.flags & ApplicationInfo.FLAG_SYSTEM) == 0) {
        return false;
    }
    return true;
}
 
开发者ID:WeiMei-Tian,项目名称:editor-sql,代码行数:8,代码来源:AppDataModel.java

示例8: onCreate

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    // Create the list view to show all the installed apps
    RecyclerView mRecyclerView = findViewById(R.id.main_view);
    mRecyclerView.setHasFixedSize(true);
    mRecyclerView.setLayoutManager(new LinearLayoutManager(this));

    // Collect all the apps' info
    ArrayList<OASPVerify> appList = new ArrayList<>();
    PackageManager pm = getPackageManager();
    List<ApplicationInfo> packages = pm.getInstalledApplications(0);
    int isSysApp = ApplicationInfo.FLAG_SYSTEM | ApplicationInfo.FLAG_UPDATED_SYSTEM_APP;
    for (ApplicationInfo app : packages) {
        // Ignore system applications
        if ((app.flags & isSysApp) == 0) {
            // Skip the demo app itself
            if (app.packageName.equals(getApplicationContext().getPackageName()))
                continue;
            OASPVerify oaspInfo = new OASPVerify(pm, app);
            dump(oaspInfo);
            appList.add(oaspInfo);
        }
    }

    // Sort app list based on the package name
    Collections.sort(appList, new Comparator<OASPVerify>() {
        @Override
        public int compare(OASPVerify app1, OASPVerify app2) {
            return app1.pkg.compareTo(app2.pkg);
        }
    });

    // Show it
    RecyclerView.Adapter mAdapter = new ListAdapter(appList);
    mRecyclerView.setAdapter(mAdapter);
}
 
开发者ID:baidu,项目名称:OASP,代码行数:39,代码来源:MainActivity.java

示例9: IsSystemApp

public Boolean IsSystemApp(ApplicationInfo info) {
	// 有些系统应用是可以更新的,如果用户自己下载了一个系统的应用来更新了原来的,
	// 它就不是系统应用啦,这个就是判断这种情况的
	if ((info.flags & ApplicationInfo.FLAG_UPDATED_SYSTEM_APP) != 0) {
		return true;
	}
	else if ((info.flags & ApplicationInfo.FLAG_SYSTEM) == 0) {
		return true;
	}
	return false;
}
 
开发者ID:Evan-Galvin,项目名称:FreeStreams-TVLauncher,代码行数:11,代码来源:TaskInfoProvider.java

示例10: isSystemApp

private static boolean isSystemApp(ApplicationInfo appInfo){
	return appInfo.flags != 0 && (appInfo.flags
			& (ApplicationInfo.FLAG_UPDATED_SYSTEM_APP | ApplicationInfo.FLAG_SYSTEM)) > 0;
}
 
开发者ID:medalionk,项目名称:simple-share-android,代码行数:4,代码来源:AppsProvider.java

示例11: isSystemApp

public static boolean isSystemApp(ApplicationInfo info) {
    int mask = ApplicationInfo.FLAG_SYSTEM | ApplicationInfo.FLAG_UPDATED_SYSTEM_APP;
    return (info.flags & mask) != 0;
}
 
开发者ID:mthli,项目名称:Mount,代码行数:4,代码来源:PolicyUtils.java

示例12: isAppUseful

private static boolean isAppUseful(ApplicationInfo appInfo) {
    return appInfo.flags != 0
            && ((appInfo.flags & ApplicationInfo.FLAG_UPDATED_SYSTEM_APP) != 0
            || (appInfo.flags & ApplicationInfo.FLAG_SYSTEM) == 0);
}
 
开发者ID:medalionk,项目名称:simple-share-android,代码行数:5,代码来源:AppsProvider.java

示例13: isSystemPackage

static boolean isSystemPackage(int flags) {
    return (flags & (ApplicationInfo.FLAG_SYSTEM | ApplicationInfo.FLAG_UPDATED_SYSTEM_APP)) != 0;
}
 
开发者ID:brevent,项目名称:Brevent,代码行数:3,代码来源:BreventActivity.java

示例14: getView

@Override
public View getView(int position, View convertView, ViewGroup parent) {
    View view = convertView;
    if (view == null) {
        view = inflater.inflate(R.layout.item, parent, false);
        ViewHolder viewHolder = new ViewHolder();
        viewHolder.checkView = (CheckBox) view.findViewById(R.id.check);
        viewHolder.iconView = (ImageView) view.findViewById(R.id.icon);
        viewHolder.nameView = (TextView) view.findViewById(R.id.name);
        viewHolder.summaryView = (TextView) view.findViewById(R.id.summary);
        viewHolder.loadingView = (TextView) view.findViewById(R.id.loading);
        viewHolder.preventView = (ImageView) view.findViewById(R.id.prevent);
        viewHolder.checkView.setOnCheckedChangeListener(mListener);
        viewHolder.checkView.setTag(viewHolder);
        view.setTag(viewHolder);
    }

    ViewHolder holder = (ViewHolder) view.getTag();
    AppInfo appInfo = getItem(position);
    if (appInfo == null) {
        return view;
    }
    holder.nameView.setText(appInfo.name);
    if (!PackageUtils.equals(holder.packageName, appInfo.packageName)) {
        holder.summaryView.setVisibility(View.GONE);
        holder.iconView.setImageDrawable(mPm.getDefaultActivityIcon());
        holder.loadingView.setVisibility(View.VISIBLE);
    }
    holder.packageName = appInfo.packageName;
    holder.checkView.setEnabled(mCanPreventNames.contains(holder.packageName));
    holder.checkView.setChecked(mActivity.getSelection().contains(holder.packageName));
    if (appInfo.isSystem()) {
        view.setBackgroundColor(mActivity.getDangerousColor());
    } else {
        view.setBackgroundColor(mActivity.getTransparentColor());
    }
    holder.canUninstall = ((appInfo.flags & ApplicationInfo.FLAG_SYSTEM) == 0) || ((appInfo.flags & ApplicationInfo.FLAG_UPDATED_SYSTEM_APP) != 0);
    holder.updatePreventView(mActivity);
    if (holder.task != null) {
        holder.task.cancel(true);
    }
    holder.task = new RetrieveIconTask(mActivity);
    holder.task.execute(holder, appInfo);
    return view;
}
 
开发者ID:brevent,项目名称:prevent,代码行数:45,代码来源:PreventFragment.java

示例15: isSystemPackage

public static boolean isSystemPackage(int flags) {
    return (flags & (ApplicationInfo.FLAG_SYSTEM | ApplicationInfo.FLAG_UPDATED_SYSTEM_APP)) != 0;
}
 
开发者ID:brevent,项目名称:prevent,代码行数:3,代码来源:PackageUtils.java


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