Search in sources :

Example 21 with PackageUserState

use of android.content.pm.PackageUserState in project android_frameworks_base by ResurrectionRemix.

the class PackageSettingBase method getDomainVerificationStatusForUser.

// Returns a packed value as a long:
//
// high 'int'-sized word: link status: undefined/ask/never/always.
// low 'int'-sized word: relative priority among 'always' results.
long getDomainVerificationStatusForUser(int userId) {
    PackageUserState state = readUserState(userId);
    long result = (long) state.appLinkGeneration;
    result |= ((long) state.domainVerificationStatus) << 32;
    return result;
}
Also used : PackageUserState(android.content.pm.PackageUserState)

Example 22 with PackageUserState

use of android.content.pm.PackageUserState in project android_frameworks_base by ResurrectionRemix.

the class PackageSettingBase method disableComponentLPw.

boolean disableComponentLPw(String componentClassName, int userId) {
    PackageUserState state = modifyUserStateComponents(userId, true, false);
    boolean changed = state.enabledComponents != null ? state.enabledComponents.remove(componentClassName) : false;
    changed |= state.disabledComponents.add(componentClassName);
    return changed;
}
Also used : PackageUserState(android.content.pm.PackageUserState)

Example 23 with PackageUserState

use of android.content.pm.PackageUserState in project android_frameworks_base by ResurrectionRemix.

the class Settings method isEnabledAndMatchLPr.

boolean isEnabledAndMatchLPr(ComponentInfo componentInfo, int flags, int userId) {
    final PackageSetting ps = mPackages.get(componentInfo.packageName);
    if (ps == null)
        return false;
    final PackageUserState userState = ps.readUserState(userId);
    return userState.isMatch(componentInfo, flags);
}
Also used : PackageUserState(android.content.pm.PackageUserState)

Example 24 with PackageUserState

use of android.content.pm.PackageUserState in project android_frameworks_base by ResurrectionRemix.

the class PackageSettingBase method setUserState.

void setUserState(int userId, long ceDataInode, int enabled, boolean installed, boolean stopped, boolean notLaunched, boolean hidden, boolean suspended, String lastDisableAppCaller, ArraySet<String> enabledComponents, ArraySet<String> disabledComponents, boolean blockUninstall, int domainVerifState, int linkGeneration, String[] resourceDirs, ArraySet<String> protectedComponents, ArraySet<String> visibleComponents) {
    PackageUserState state = modifyUserState(userId);
    state.ceDataInode = ceDataInode;
    state.enabled = enabled;
    state.installed = installed;
    state.stopped = stopped;
    state.notLaunched = notLaunched;
    state.hidden = hidden;
    state.suspended = suspended;
    state.lastDisableAppCaller = lastDisableAppCaller;
    state.enabledComponents = enabledComponents;
    state.disabledComponents = disabledComponents;
    state.blockUninstall = blockUninstall;
    state.domainVerificationStatus = domainVerifState;
    state.appLinkGeneration = linkGeneration;
    state.protectedComponents = protectedComponents;
    state.visibleComponents = visibleComponents;
    state.resourceDirs = resourceDirs;
}
Also used : PackageUserState(android.content.pm.PackageUserState)

Example 25 with PackageUserState

use of android.content.pm.PackageUserState in project android_frameworks_base by crdroidandroid.

the class EphemeralApplicationRegistry method createEphemeralAppInfoForPackage.

private EphemeralApplicationInfo createEphemeralAppInfoForPackage(PackageParser.Package pkg, int userId) {
    PackageSetting ps = (PackageSetting) pkg.mExtras;
    if (ps == null) {
        return null;
    }
    PackageUserState userState = ps.readUserState(userId);
    if (userState == null || !userState.installed || userState.hidden) {
        return null;
    }
    String[] requestedPermissions = new String[pkg.requestedPermissions.size()];
    pkg.requestedPermissions.toArray(requestedPermissions);
    Set<String> permissions = ps.getPermissionsState().getPermissions(userId);
    String[] grantedPermissions = new String[permissions.size()];
    permissions.toArray(grantedPermissions);
    return new EphemeralApplicationInfo(pkg.applicationInfo, requestedPermissions, grantedPermissions);
}
Also used : PackageUserState(android.content.pm.PackageUserState) EphemeralApplicationInfo(android.content.pm.EphemeralApplicationInfo)

Aggregations

PackageUserState (android.content.pm.PackageUserState)60 EphemeralApplicationInfo (android.content.pm.EphemeralApplicationInfo)5 FastXmlSerializer (com.android.internal.util.FastXmlSerializer)5 JournaledFile (com.android.internal.util.JournaledFile)5 BufferedOutputStream (java.io.BufferedOutputStream)5 File (java.io.File)5 FileOutputStream (java.io.FileOutputStream)5 IOException (java.io.IOException)5 XmlSerializer (org.xmlpull.v1.XmlSerializer)5 PackageParser (android.content.pm.PackageParser)4 AtomicFile (android.util.AtomicFile)4 PackageInfo (android.content.pm.PackageInfo)1