Code example for ApplicationInfo

0
    @Override 
    public ApplicationInfo getApplicationInfo(String packageName, int flags) throws NameNotFoundException {
 
        if (config.getPackageName().equals(packageName)) {
            if (applicationInfo == null) {
                applicationInfo = new ApplicationInfo();
                applicationInfo.flags = config.getApplicationFlags();
                applicationInfo.targetSdkVersion = config.getSdkVersion();
                applicationInfo.packageName = config.getPackageName();
                applicationInfo.processName = config.getProcessName();
            } 
            return applicationInfo;
        } 
         
        PackageInfo info;
        if ((info = packageList.get(packageName)) != null) {
        	return info.applicationInfo;
        } 
 
        throw new NameNotFoundException(); 
    }