use of android.content.pm.PackageUserState in project android_frameworks_base by DirtyUnicorns.
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;
}
}
use of android.content.pm.PackageUserState in project android_frameworks_base by DirtyUnicorns.
the class PackageSettingBase method restoreComponentLPw.
boolean restoreComponentLPw(String componentClassName, int userId) {
PackageUserState state = modifyUserStateComponents(userId, true, true);
boolean changed = state.disabledComponents != null ? state.disabledComponents.remove(componentClassName) : false;
changed |= state.enabledComponents != null ? state.enabledComponents.remove(componentClassName) : false;
return changed;
}
use of android.content.pm.PackageUserState in project android_frameworks_base by DirtyUnicorns.
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;
}
use of android.content.pm.PackageUserState in project android_frameworks_base by DirtyUnicorns.
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;
}
use of android.content.pm.PackageUserState in project android_frameworks_base by DirtyUnicorns.
the class PackageManagerService method generatePackageInfo.
private PackageInfo generatePackageInfo(PackageSetting ps, int flags, int userId) {
if (!sUserManager.exists(userId))
return null;
if (ps == null) {
return null;
}
final PackageParser.Package p = ps.pkg;
if (p == null) {
return null;
}
final PermissionsState permissionsState = ps.getPermissionsState();
// Compute GIDs only if requested
final int[] gids = (flags & PackageManager.GET_GIDS) == 0 ? EMPTY_INT_ARRAY : permissionsState.computeGids(userId);
// Compute granted permissions only if package has requested permissions
final Set<String> permissions = ArrayUtils.isEmpty(p.requestedPermissions) ? Collections.<String>emptySet() : permissionsState.getPermissions(userId);
final PackageUserState state = ps.readUserState(userId);
return PackageParser.generatePackageInfo(p, gids, flags, ps.firstInstallTime, ps.lastUpdateTime, permissions, state, userId);
}
Aggregations