Search in sources :

Example 6 with PackageUserState

use of android.content.pm.PackageUserState in project platform_frameworks_base by android.

the class PackageSettingBase method setDomainVerificationStatusForUser.

void setDomainVerificationStatusForUser(final int status, int generation, int userId) {
    PackageUserState state = modifyUserState(userId);
    state.domainVerificationStatus = status;
    if (status == PackageManager.INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_ALWAYS) {
        state.appLinkGeneration = generation;
    }
}
Also used : PackageUserState(android.content.pm.PackageUserState)

Example 7 with PackageUserState

use of android.content.pm.PackageUserState in project platform_frameworks_base by android.

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 8 with PackageUserState

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

the class Settings method isEnabledLPr.

boolean isEnabledLPr(ComponentInfo componentInfo, int flags, int userId) {
    if ((flags & PackageManager.GET_DISABLED_COMPONENTS) != 0) {
        return true;
    }
    final String pkgName = componentInfo.packageName;
    final PackageSetting packageSettings = mPackages.get(pkgName);
    if (PackageManagerService.DEBUG_SETTINGS) {
        Log.v(PackageManagerService.TAG, "isEnabledLock - packageName = " + componentInfo.packageName + " componentName = " + componentInfo.name);
        Log.v(PackageManagerService.TAG, "enabledComponents: " + compToString(packageSettings.getEnabledComponents(userId)));
        Log.v(PackageManagerService.TAG, "disabledComponents: " + compToString(packageSettings.getDisabledComponents(userId)));
    }
    if (packageSettings == null) {
        return false;
    }
    PackageUserState ustate = packageSettings.readUserState(userId);
    if ((flags & PackageManager.GET_DISABLED_UNTIL_USED_COMPONENTS) != 0) {
        if (ustate.enabled == COMPONENT_ENABLED_STATE_DISABLED_UNTIL_USED) {
            return true;
        }
    }
    if (ustate.enabled == COMPONENT_ENABLED_STATE_DISABLED || ustate.enabled == COMPONENT_ENABLED_STATE_DISABLED_USER || ustate.enabled == COMPONENT_ENABLED_STATE_DISABLED_UNTIL_USED || (packageSettings.pkg != null && !packageSettings.pkg.applicationInfo.enabled && ustate.enabled == COMPONENT_ENABLED_STATE_DEFAULT)) {
        return false;
    }
    if (ustate.enabledComponents != null && ustate.enabledComponents.contains(componentInfo.name)) {
        return true;
    }
    if (ustate.disabledComponents != null && ustate.disabledComponents.contains(componentInfo.name)) {
        return false;
    }
    return componentInfo.enabled;
}
Also used : PackageUserState(android.content.pm.PackageUserState)

Example 9 with PackageUserState

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

the class PackageManagerService method generatePackageInfo.

PackageInfo generatePackageInfo(PackageParser.Package p, int flags, int userId) {
    if (!sUserManager.exists(userId))
        return null;
    PackageInfo pi;
    final PackageSetting ps = (PackageSetting) p.mExtras;
    if (ps == null) {
        return null;
    }
    final GrantedPermissions gp = ps.sharedUser != null ? ps.sharedUser : ps;
    final PackageUserState state = ps.readUserState(userId);
    return PackageParser.generatePackageInfo(p, gp.gids, flags, ps.firstInstallTime, ps.lastUpdateTime, gp.grantedPermissions, state, userId);
}
Also used : PackageUserState(android.content.pm.PackageUserState) PackageInfo(android.content.pm.PackageInfo)

Example 10 with PackageUserState

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

the class PackageSettingBase method modifyUserState.

private PackageUserState modifyUserState(int userId) {
    PackageUserState state = userState.get(userId);
    if (state == null) {
        state = new PackageUserState();
        userState.put(userId, state);
    }
    return state;
}
Also used : PackageUserState(android.content.pm.PackageUserState)

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