FileDocCategorySizeDatePackage
ApplicationInfo.javaAPI DocAndroid 1.5 API10924Wed May 06 22:41:54 BST 2009android.content.pm

ApplicationInfo

public class ApplicationInfo extends PackageItemInfo implements android.os.Parcelable
Information you can retrieve about a particular application. This corresponds to information collected from the AndroidManifest.xml's <application> tag.

Fields Summary
public String
taskAffinity
Default task affinity of all activities in this application. See {@link ActivityInfo#taskAffinity} for more information. This comes from the "taskAffinity" attribute.
public String
permission
Optional name of a permission required to be able to access this application's components. From the "permission" attribute.
public String
processName
The name of the process this application should run in. From the "process" attribute or, if not set, the same as packageName.
public String
className
Class implementing the Application object. From the "class" attribute.
public int
descriptionRes
A style resource identifier (in the package's resources) of the description of an application. From the "description" attribute or, if not set, 0.
public int
theme
A style resource identifier (in the package's resources) of the default visual theme of the application. From the "theme" attribute or, if not set, 0.
public String
manageSpaceActivityName
Class implementing the Application's manage space functionality. From the "manageSpaceActivity" attribute. This is an optional attribute and will be null if application's dont specify it in their manifest
public static final int
FLAG_SYSTEM
Value for {@link #flags}: if set, this application is installed in the device's system image.
public static final int
FLAG_DEBUGGABLE
Value for {@link #flags}: set to true if this application would like to allow debugging of its code, even when installed on a non-development system. Comes from {@link android.R.styleable#AndroidManifestApplication_debuggable android:debuggable} of the <application> tag.
public static final int
FLAG_HAS_CODE
Value for {@link #flags}: set to true if this application has code associated with it. Comes from {@link android.R.styleable#AndroidManifestApplication_hasCode android:hasCode} of the <application> tag.
public static final int
FLAG_PERSISTENT
Value for {@link #flags}: set to true if this application is persistent. Comes from {@link android.R.styleable#AndroidManifestApplication_persistent android:persistent} of the <application> tag.
public static final int
FLAG_FACTORY_TEST
Value for {@link #flags}: set to true iif this application holds the {@link android.Manifest.permission#FACTORY_TEST} permission and the device is running in factory test mode.
public static final int
FLAG_ALLOW_TASK_REPARENTING
Value for {@link #flags}: default value for the corresponding ActivityInfo flag. Comes from {@link android.R.styleable#AndroidManifestApplication_allowTaskReparenting android:allowTaskReparenting} of the <application> tag.
public static final int
FLAG_ALLOW_CLEAR_USER_DATA
Value for {@link #flags}: default value for the corresponding ActivityInfo flag. Comes from {@link android.R.styleable#AndroidManifestApplication_allowClearUserData android:allowClearUserData} of the <application> tag.
public static final int
FLAG_UPDATED_SYSTEM_APP
Value for {@link #flags}: default value for the corresponding ActivityInfo flag. {@hide}
public int
flags
Flags associated with the application. Any combination of {@link #FLAG_SYSTEM}, {@link #FLAG_DEBUGGABLE}, {@link #FLAG_HAS_CODE}, {@link #FLAG_PERSISTENT}, {@link #FLAG_FACTORY_TEST}, and {@link #FLAG_ALLOW_TASK_REPARENTING} {@link #FLAG_ALLOW_CLEAR_USER_DATA}.
public String
sourceDir
Full path to the location of this package.
public String
publicSourceDir
Full path to the location of the publicly available parts of this package (i.e. the resources and manifest). For non-forward-locked apps this will be the same as {@link #sourceDir).
public String[]
sharedLibraryFiles
Paths to all shared libraries this application is linked against. This field is only set if the {@link PackageManager#GET_SHARED_LIBRARY_FILES PackageManager.GET_SHARED_LIBRARY_FILES} flag was used when retrieving the structure.
public String
dataDir
Full path to a directory assigned to the package for its persistent data.
public int
uid
The kernel user-ID that has been assigned to this application; currently this is not a unique ID (multiple applications can have the same uid).
public boolean
enabled
When false, indicates that all components within this application are considered disabled, regardless of their individually set enabled status.
public static final Parcelable.Creator
CREATOR
Constructors Summary
public ApplicationInfo()

    

      
    
public ApplicationInfo(ApplicationInfo orig)

        super(orig);
        taskAffinity = orig.taskAffinity;
        permission = orig.permission;
        processName = orig.processName;
        className = orig.className;
        theme = orig.theme;
        flags = orig.flags;
        sourceDir = orig.sourceDir;
        publicSourceDir = orig.publicSourceDir;
        sharedLibraryFiles = orig.sharedLibraryFiles;
        dataDir = orig.dataDir;
        uid = orig.uid;
        enabled = orig.enabled;
        manageSpaceActivityName = orig.manageSpaceActivityName;
        descriptionRes = orig.descriptionRes;
    
private ApplicationInfo(android.os.Parcel source)


       
        super(source);
        taskAffinity = source.readString();
        permission = source.readString();
        processName = source.readString();
        className = source.readString();
        theme = source.readInt();
        flags = source.readInt();
        sourceDir = source.readString();
        publicSourceDir = source.readString();
        sharedLibraryFiles = source.readStringArray();
        dataDir = source.readString();
        uid = source.readInt();
        enabled = source.readInt() != 0;
        manageSpaceActivityName = source.readString();
        descriptionRes = source.readInt();
    
Methods Summary
public intdescribeContents()

        return 0;
    
public voiddump(android.util.Printer pw, java.lang.String prefix)


          
        super.dumpFront(pw, prefix);
        pw.println(prefix + "className=" + className);
        pw.println(prefix + "permission=" + permission
                + " uid=" + uid);
        pw.println(prefix + "taskAffinity=" + taskAffinity);
        pw.println(prefix + "theme=0x" + Integer.toHexString(theme));
        pw.println(prefix + "flags=0x" + Integer.toHexString(flags)
                + " processName=" + processName);
        pw.println(prefix + "sourceDir=" + sourceDir);
        pw.println(prefix + "publicSourceDir=" + publicSourceDir);
        pw.println(prefix + "sharedLibraryFiles=" + sharedLibraryFiles);
        pw.println(prefix + "dataDir=" + dataDir);
        pw.println(prefix + "enabled=" + enabled);
        pw.println(prefix+"manageSpaceActivityName="+manageSpaceActivityName);
        pw.println(prefix+"description=0x"+Integer.toHexString(descriptionRes));
        super.dumpBack(pw, prefix);
    
public java.lang.CharSequenceloadDescription(PackageManager pm)
Retrieve the textual description of the application. This will call back on the given PackageManager to load the description from the application.

param
pm A PackageManager from which the label can be loaded; usually the PackageManager from which you originally retrieved this item.
return
Returns a CharSequence containing the application's description. If there is no description, null is returned.

        if (descriptionRes != 0) {
            CharSequence label = pm.getText(packageName, descriptionRes, null);
            if (label != null) {
                return label;
            }
        }
        return null;
    
public java.lang.StringtoString()

        return "ApplicationInfo{"
            + Integer.toHexString(System.identityHashCode(this))
            + " " + packageName + "}";
    
public voidwriteToParcel(android.os.Parcel dest, int parcelableFlags)

        super.writeToParcel(dest, parcelableFlags);
        dest.writeString(taskAffinity);
        dest.writeString(permission);
        dest.writeString(processName);
        dest.writeString(className);
        dest.writeInt(theme);
        dest.writeInt(flags);
        dest.writeString(sourceDir);
        dest.writeString(publicSourceDir);
        dest.writeStringArray(sharedLibraryFiles);
        dest.writeString(dataDir);
        dest.writeInt(uid);
        dest.writeInt(enabled ? 1 : 0);
        dest.writeString(manageSpaceActivityName);
        dest.writeInt(descriptionRes);