Java Code Examples for android.util.ArraySet#add()

The following examples show how to use android.util.ArraySet#add() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CalendarTracker.java    From android_9.0.0_r45 with Apache License 2.0 6 votes vote down vote up
private ArraySet<Long> getPrimaryCalendars() {
    final long start = System.currentTimeMillis();
    final ArraySet<Long> rt = new ArraySet<>();
    final String primary = "\"primary\"";
    final String[] projection = { Calendars._ID,
            "(" + Calendars.ACCOUNT_NAME + "=" + Calendars.OWNER_ACCOUNT + ") AS " + primary };
    final String selection = primary + " = 1";
    Cursor cursor = null;
    try {
        cursor = mUserContext.getContentResolver().query(Calendars.CONTENT_URI, projection,
                selection, null, null);
        while (cursor != null && cursor.moveToNext()) {
            rt.add(cursor.getLong(0));
        }
    } finally {
        if (cursor != null) {
            cursor.close();
        }
    }
    if (DEBUG) Log.d(TAG, "getPrimaryCalendars took " + (System.currentTimeMillis() - start));
    return rt;
}
 
Example 2
Source File: EnabledComponentsObserver.java    From android_9.0.0_r45 with Apache License 2.0 6 votes vote down vote up
private ArraySet<ComponentName> loadComponentNamesFromSetting(String settingName,
        int userId) {
    final ContentResolver cr = mContext.getContentResolver();
    String settingValue = Settings.Secure.getStringForUser(
            cr,
            settingName,
            userId);
    if (TextUtils.isEmpty(settingValue))
        return new ArraySet<>();
    String[] restored = settingValue.split(ENABLED_SERVICES_SEPARATOR);
    ArraySet<ComponentName> result = new ArraySet<>(restored.length);
    for (int i = 0; i < restored.length; i++) {
        ComponentName value = ComponentName.unflattenFromString(restored[i]);
        if (null != value) {
            result.add(value);
        }
    }
    return result;
}
 
Example 3
Source File: AppOpsService.java    From android_9.0.0_r45 with Apache License 2.0 6 votes vote down vote up
private void scheduleOpActiveChangedIfNeededLocked(int code, int uid, String packageName,
        boolean active) {
    ArraySet<ActiveCallback> dispatchedCallbacks = null;
    final int callbackListCount = mActiveWatchers.size();
    for (int i = 0; i < callbackListCount; i++) {
        final SparseArray<ActiveCallback> callbacks = mActiveWatchers.valueAt(i);
        ActiveCallback callback = callbacks.get(code);
        if (callback != null) {
            if (callback.mWatchingUid >= 0 && callback.mWatchingUid != uid) {
                continue;
            }
            if (dispatchedCallbacks == null) {
                dispatchedCallbacks = new ArraySet<>();
            }
            dispatchedCallbacks.add(callback);
        }
    }
    if (dispatchedCallbacks == null) {
        return;
    }
    mHandler.sendMessage(PooledLambda.obtainMessage(
            AppOpsService::notifyOpActiveChanged,
            this, dispatchedCallbacks, code, uid, packageName, active));
}
 
Example 4
Source File: RecentTasks.java    From android_9.0.0_r45 with Apache License 2.0 6 votes vote down vote up
/**
 * @return the list of persistable task ids.
 */
void getPersistableTaskIds(ArraySet<Integer> persistentTaskIds) {
    final int size = mTasks.size();
    for (int i = 0; i < size; i++) {
        final TaskRecord task = mTasks.get(i);
        if (TaskPersister.DEBUG) Slog.d(TAG, "LazyTaskWriter: task=" + task
                + " persistable=" + task.isPersistable);
        final ActivityStack stack = task.getStack();
        if ((task.isPersistable || task.inRecents)
                && (stack == null || !stack.isHomeOrRecentsStack())) {
            if (TaskPersister.DEBUG) Slog.d(TAG, "adding to persistentTaskIds task=" + task);
            persistentTaskIds.add(task.taskId);
        } else {
            if (TaskPersister.DEBUG) Slog.d(TAG, "omitting from persistentTaskIds task="
                    + task);
        }
    }
}
 
Example 5
Source File: ActiveServices.java    From android_9.0.0_r45 with Apache License 2.0 6 votes vote down vote up
public void updateServiceConnectionActivitiesLocked(ProcessRecord clientProc) {
    ArraySet<ProcessRecord> updatedProcesses = null;
    for (int i = 0; i < clientProc.connections.size(); i++) {
        final ConnectionRecord conn = clientProc.connections.valueAt(i);
        final ProcessRecord proc = conn.binding.service.app;
        if (proc == null || proc == clientProc) {
            continue;
        } else if (updatedProcesses == null) {
            updatedProcesses = new ArraySet<>();
        } else if (updatedProcesses.contains(proc)) {
            continue;
        }
        updatedProcesses.add(proc);
        updateServiceClientActivitiesLocked(proc, null, false);
    }
}
 
Example 6
Source File: VrManagerService.java    From android_9.0.0_r45 with Apache License 2.0 5 votes vote down vote up
/**
 * Called when a user, package, or setting changes that could affect whether or not the
 * currently bound VrListenerService is changed.
 */
@Override
public void onEnabledComponentChanged() {
    synchronized (mLock) {
        int currentUser = ActivityManager.getCurrentUser();
        // Update listeners
        ArraySet<ComponentName> enabledListeners = mComponentObserver.getEnabled(currentUser);

        ArraySet<String> enabledPackages = new ArraySet<>();
        for (ComponentName n : enabledListeners) {
            String pkg = n.getPackageName();
            if (isDefaultAllowed(pkg)) {
                enabledPackages.add(n.getPackageName());
            }
        }
        mNotifAccessManager.update(enabledPackages);

        if (!mVrModeAllowed) {
            return; // Don't do anything, we shouldn't be in VR mode.
        }

        // If there is a pending state change, we'd better deal with that first
        consumeAndApplyPendingStateLocked(false);

        if (mCurrentVrService == null) {
            return; // No active services
        }

        // There is an active service, update it if needed
        updateCurrentVrServiceLocked(mVrModeEnabled, mRunning2dInVr,
                mCurrentVrService.getComponent(), mCurrentVrService.getUserId(),
                mVrAppProcessId, mCurrentVrModeComponent);
    }
}
 
Example 7
Source File: PackageManagerServiceUtils.java    From android_9.0.0_r45 with Apache License 2.0 5 votes vote down vote up
private static ArraySet<String> getPackageNamesForIntent(Intent intent, int userId) {
    List<ResolveInfo> ris = null;
    try {
        ris = AppGlobals.getPackageManager().queryIntentReceivers(intent, null, 0, userId)
                .getList();
    } catch (RemoteException e) {
    }
    ArraySet<String> pkgNames = new ArraySet<String>();
    if (ris != null) {
        for (ResolveInfo ri : ris) {
            pkgNames.add(ri.activityInfo.packageName);
        }
    }
    return pkgNames;
}
 
Example 8
Source File: PinnerService.java    From android_9.0.0_r45 with Apache License 2.0 5 votes vote down vote up
@Override
public void onReceive(Context context, Intent intent) {
  // If an app has updated, update pinned files accordingly.
  if (Intent.ACTION_PACKAGE_REPLACED.equals(intent.getAction())) {
        Uri packageUri = intent.getData();
        String packageName = packageUri.getSchemeSpecificPart();
        ArraySet<String> updatedPackages = new ArraySet<>();
        updatedPackages.add(packageName);
        update(updatedPackages, true /* force */);
    }
}
 
Example 9
Source File: NetworkCapabilities.java    From android_9.0.0_r45 with Apache License 2.0 5 votes vote down vote up
/**
 * Convenience method to set the UIDs this network applies to to a single UID.
 * @hide
 */
public NetworkCapabilities setSingleUid(int uid) {
    final ArraySet<UidRange> identity = new ArraySet<>(1);
    identity.add(new UidRange(uid, uid));
    setUids(identity);
    return this;
}
 
Example 10
Source File: SlicePermissionManager.java    From android_9.0.0_r45 with Apache License 2.0 5 votes vote down vote up
public String[] getAllPackagesGranted(String pkg) {
    ArraySet<String> ret = new ArraySet<>();
    for (SliceAuthority authority : getProvider(new PkgUser(pkg, 0)).getAuthorities()) {
        for (PkgUser pkgUser : authority.getPkgs()) {
            ret.add(pkgUser.mPkg);
        }
    }
    return ret.toArray(new String[ret.size()]);
}
 
Example 11
Source File: SliceFullAccessList.java    From android_9.0.0_r45 with Apache License 2.0 5 votes vote down vote up
public void readXml(XmlPullParser parser) throws XmlPullParserException, IOException {
    // upgrade xml
    int xmlVersion = XmlUtils.readIntAttribute(parser, ATT_VERSION, 0);
    final List<UserInfo> activeUsers = UserManager.get(mContext).getUsers(true);
    for (UserInfo userInfo : activeUsers) {
        upgradeXml(xmlVersion, userInfo.getUserHandle().getIdentifier());
    }

    mFullAccessPkgs.clear();
    // read grants
    int type;
    while ((type = parser.next()) != XmlPullParser.END_DOCUMENT) {
        String tag = parser.getName();
        if (type == XmlPullParser.END_TAG
                && TAG_LIST.equals(tag)) {
            break;
        }
        if (type == XmlPullParser.START_TAG) {
            if (TAG_USER.equals(tag)) {
                final int userId = XmlUtils.readIntAttribute(parser, ATT_USER_ID, 0);
                ArraySet<String> pkgs = new ArraySet<>();
                while ((type = parser.next()) != XmlPullParser.END_DOCUMENT) {
                    String userTag = parser.getName();
                    if (type == XmlPullParser.END_TAG
                            && TAG_USER.equals(userTag)) {
                        break;
                    }
                    if (type == XmlPullParser.START_TAG) {
                        if (TAG_PKG.equals(userTag)) {
                            final String pkg = parser.nextText();
                            pkgs.add(pkg);
                        }
                    }
                }
                mFullAccessPkgs.put(userId, pkgs);
            }
        }
    }
}
 
Example 12
Source File: ShortcutInfo.java    From android_9.0.0_r45 with Apache License 2.0 5 votes vote down vote up
private static ArraySet<String> cloneCategories(Set<String> source) {
    if (source == null) {
        return null;
    }
    final ArraySet<String> ret = new ArraySet<>(source.size());
    for (CharSequence s : source) {
        if (!TextUtils.isEmpty(s)) {
            ret.add(s.toString().intern());
        }
    }
    return ret;
}
 
Example 13
Source File: InstructionSets.java    From android_9.0.0_r45 with Apache License 2.0 5 votes vote down vote up
public static String[] getDexCodeInstructionSets(String[] instructionSets) {
    ArraySet<String> dexCodeInstructionSets = new ArraySet<String>(instructionSets.length);
    for (String instructionSet : instructionSets) {
        dexCodeInstructionSets.add(getDexCodeInstructionSet(instructionSet));
    }
    return dexCodeInstructionSets.toArray(new String[dexCodeInstructionSets.size()]);
}
 
Example 14
Source File: AutofillManager.java    From android_9.0.0_r45 with Apache License 2.0 5 votes vote down vote up
/**
 * Add a value to a set. If set is null, create a new set.
 *
 * @param set        The set or null (== empty set)
 * @param valueToAdd The value to add
 *
 * @return The set including the new value. If set was {@code null}, a set containing only
 *         the new value.
 */
// TODO: move to Helper as static method
@NonNull
private <T> ArraySet<T> addToSet(@Nullable ArraySet<T> set, T valueToAdd) {
    if (set == null) {
        set = new ArraySet<>(1);
    }

    set.add(valueToAdd);

    return set;
}
 
Example 15
Source File: KeySetManagerService.java    From android_9.0.0_r45 with Apache License 2.0 5 votes vote down vote up
private void addRefCountsFromSavedPackagesLPw(ArrayMap<Long, Integer> keySetRefCounts) {
    final int numRefCounts = keySetRefCounts.size();
    for (int i = 0; i < numRefCounts; i++) {
        KeySetHandle ks = mKeySets.get(keySetRefCounts.keyAt(i));
        if (ks == null) {
            /* something went terribly wrong and we have references to a non-existent key-set */
            Slog.wtf(TAG, "Encountered non-existent key-set reference when reading settings");
            continue;
        }
        ks.setRefCountLPw(keySetRefCounts.valueAt(i));
    }

    /*
     * In case something went terribly wrong and we have keysets with no associated packges
     * that refer to them, record the orphaned keyset ids, and remove them using
     * decrementKeySetLPw() after all keyset references have been set so that the associtaed
     * public keys have the appropriate references from all keysets.
     */
    ArraySet<Long> orphanedKeySets = new ArraySet<Long>();
    final int numKeySets = mKeySets.size();
    for (int i = 0; i < numKeySets; i++) {
        if (mKeySets.valueAt(i).getRefCountLPr() == 0) {
            Slog.wtf(TAG, "Encountered key-set w/out package references when reading settings");
            orphanedKeySets.add(mKeySets.keyAt(i));
        }
        ArraySet<Long> pubKeys = mKeySetMapping.valueAt(i);
        final int pkSize = pubKeys.size();
        for (int j = 0; j < pkSize; j++) {
            mPublicKeys.get(pubKeys.valueAt(j)).incrRefCountLPw();
        }
    }
    final int numOrphans = orphanedKeySets.size();
    for (int i = 0; i < numOrphans; i++) {
        decrementKeySetLPw(orphanedKeySets.valueAt(i));
    }
}
 
Example 16
Source File: EnabledComponentsObserver.java    From android_9.0.0_r45 with Apache License 2.0 5 votes vote down vote up
public static ArraySet<ComponentName> loadComponentNames(PackageManager pm, int userId,
        String serviceName, String permissionName) {

    ArraySet<ComponentName> installed = new ArraySet<>();
    Intent queryIntent = new Intent(serviceName);
    List<ResolveInfo> installedServices = pm.queryIntentServicesAsUser(
            queryIntent,
            PackageManager.GET_SERVICES | PackageManager.GET_META_DATA |
                                PackageManager.MATCH_DIRECT_BOOT_AWARE |
                                PackageManager.MATCH_DIRECT_BOOT_UNAWARE,
            userId);
    if (installedServices != null) {
        for (int i = 0, count = installedServices.size(); i < count; i++) {
            ResolveInfo resolveInfo = installedServices.get(i);
            ServiceInfo info = resolveInfo.serviceInfo;

            ComponentName component = new ComponentName(info.packageName, info.name);
            if (!permissionName.equals(info.permission)) {
                Slog.w(TAG, "Skipping service " + info.packageName + "/" + info.name
                        + ": it does not require the permission "
                        + permissionName);
                continue;
            }
            installed.add(component);
        }
    }
    return installed;
}
 
Example 17
Source File: TrustManagerService.java    From android_9.0.0_r45 with Apache License 2.0 4 votes vote down vote up
private void dumpUser(PrintWriter fout, UserInfo user, boolean isCurrent) {
    fout.printf(" User \"%s\" (id=%d, flags=%#x)",
            user.name, user.id, user.flags);
    if (!user.supportsSwitchToByUser()) {
        fout.println("(managed profile)");
        fout.println("   disabled because switching to this user is not possible.");
        return;
    }
    if (isCurrent) {
        fout.print(" (current)");
    }
    fout.print(": trusted=" + dumpBool(aggregateIsTrusted(user.id)));
    fout.print(", trustManaged=" + dumpBool(aggregateIsTrustManaged(user.id)));
    fout.print(", deviceLocked=" + dumpBool(isDeviceLockedInner(user.id)));
    fout.print(", strongAuthRequired=" + dumpHex(
            mStrongAuthTracker.getStrongAuthForUser(user.id)));
    fout.println();
    fout.println("   Enabled agents:");
    boolean duplicateSimpleNames = false;
    ArraySet<String> simpleNames = new ArraySet<String>();
    for (AgentInfo info : mActiveAgents) {
        if (info.userId != user.id) { continue; }
        boolean trusted = info.agent.isTrusted();
        fout.print("    "); fout.println(info.component.flattenToShortString());
        fout.print("     bound=" + dumpBool(info.agent.isBound()));
        fout.print(", connected=" + dumpBool(info.agent.isConnected()));
        fout.print(", managingTrust=" + dumpBool(info.agent.isManagingTrust()));
        fout.print(", trusted=" + dumpBool(trusted));
        fout.println();
        if (trusted) {
            fout.println("      message=\"" + info.agent.getMessage() + "\"");
        }
        if (!info.agent.isConnected()) {
            String restartTime = TrustArchive.formatDuration(
                    info.agent.getScheduledRestartUptimeMillis()
                            - SystemClock.uptimeMillis());
            fout.println("      restartScheduledAt=" + restartTime);
        }
        if (!simpleNames.add(TrustArchive.getSimpleName(info.component))) {
            duplicateSimpleNames = true;
        }
    }
    fout.println("   Events:");
    mArchive.dump(fout, 50, user.id, "    " /* linePrefix */, duplicateSimpleNames);
    fout.println();
}
 
Example 18
Source File: ZenModeConditions.java    From android_9.0.0_r45 with Apache License 2.0 4 votes vote down vote up
private void evaluateRule(ZenRule rule, ArraySet<Uri> current, ComponentName trigger,
        boolean processSubscriptions) {
    if (rule == null || rule.conditionId == null) return;
    final Uri id = rule.conditionId;
    boolean isSystemCondition = false;
    for (SystemConditionProviderService sp : mConditionProviders.getSystemProviders()) {
        if (sp.isValidConditionId(id)) {
            mConditionProviders.ensureRecordExists(sp.getComponent(), id, sp.asInterface());
            rule.component = sp.getComponent();
            isSystemCondition = true;
        }
    }
    if (!isSystemCondition) {
        final IConditionProvider cp = mConditionProviders.findConditionProvider(rule.component);
        if (DEBUG) Log.d(TAG, "Ensure external rule exists: " + (cp != null) + " for " + id);
        if (cp != null) {
            mConditionProviders.ensureRecordExists(rule.component, id, cp);
        }
    }
    if (rule.component == null) {
        Log.w(TAG, "No component found for automatic rule: " + rule.conditionId);
        rule.enabled = false;
        return;
    }
    if (current != null) {
        current.add(id);
    }
    if (processSubscriptions && ((trigger != null && trigger.equals(rule.component))
            || isSystemCondition)) {
        if (DEBUG) Log.d(TAG, "Subscribing to " + rule.component);
        if (mConditionProviders.subscribeIfNecessary(rule.component, rule.conditionId)) {
            synchronized (mSubscriptions) {
                mSubscriptions.put(rule.conditionId, rule.component);
            }
        } else {
            rule.condition = null;
            if (DEBUG) Log.d(TAG, "zmc failed to subscribe");
        }
    }
    if (rule.condition == null) {
        rule.condition = mConditionProviders.findCondition(rule.component, rule.conditionId);
        if (rule.condition != null && DEBUG) Log.d(TAG, "Found existing condition for: "
                + rule.conditionId);
    }
}
 
Example 19
Source File: BackgroundDexOptService.java    From android_9.0.0_r45 with Apache License 2.0 4 votes vote down vote up
private void postBootUpdate(JobParameters jobParams, PackageManagerService pm,
        ArraySet<String> pkgs) {
    // Load low battery threshold from the system config. This is a 0-100 integer.
    final int lowBatteryThreshold = getResources().getInteger(
            com.android.internal.R.integer.config_lowBatteryWarningLevel);
    final long lowThreshold = getLowStorageThreshold(this);

    mAbortPostBootUpdate.set(false);

    ArraySet<String> updatedPackages = new ArraySet<>();
    for (String pkg : pkgs) {
        if (mAbortPostBootUpdate.get()) {
            // JobScheduler requested an early abort.
            return;
        }
        if (mExitPostBootUpdate.get()) {
            // Different job, which supersedes this one, is running.
            break;
        }
        if (getBatteryLevel() < lowBatteryThreshold) {
            // Rather bail than completely drain the battery.
            break;
        }
        long usableSpace = mDataDir.getUsableSpace();
        if (usableSpace < lowThreshold) {
            // Rather bail than completely fill up the disk.
            Log.w(TAG, "Aborting background dex opt job due to low storage: " +
                    usableSpace);
            break;
        }

        if (DEBUG_DEXOPT) {
            Log.i(TAG, "Updating package " + pkg);
        }

        // Update package if needed. Note that there can be no race between concurrent
        // jobs because PackageDexOptimizer.performDexOpt is synchronized.

        // checkProfiles is false to avoid merging profiles during boot which
        // might interfere with background compilation (b/28612421).
        // Unfortunately this will also means that "pm.dexopt.boot=speed-profile" will
        // behave differently than "pm.dexopt.bg-dexopt=speed-profile" but that's a
        // trade-off worth doing to save boot time work.
        int result = pm.performDexOptWithStatus(new DexoptOptions(
                pkg,
                PackageManagerService.REASON_BOOT,
                DexoptOptions.DEXOPT_BOOT_COMPLETE));
        if (result == PackageDexOptimizer.DEX_OPT_PERFORMED)  {
            updatedPackages.add(pkg);
        }
    }
    notifyPinService(updatedPackages);
    // Ran to completion, so we abandon our timeslice and do not reschedule.
    jobFinished(jobParams, /* reschedule */ false);
}
 
Example 20
Source File: BackgroundDexOptService.java    From android_9.0.0_r45 with Apache License 2.0 4 votes vote down vote up
private int optimizePackages(PackageManagerService pm, ArraySet<String> pkgs,
        long lowStorageThreshold, boolean is_for_primary_dex,
        ArraySet<String> failedPackageNames) {
    ArraySet<String> updatedPackages = new ArraySet<>();
    Set<String> unusedPackages = pm.getUnusedPackages(mDowngradeUnusedAppsThresholdInMillis);
    // Only downgrade apps when space is low on device.
    // Threshold is selected above the lowStorageThreshold so that we can pro-actively clean
    // up disk before user hits the actual lowStorageThreshold.
    final long lowStorageThresholdForDowngrade = LOW_THRESHOLD_MULTIPLIER_FOR_DOWNGRADE *
            lowStorageThreshold;
    boolean shouldDowngrade = shouldDowngrade(lowStorageThresholdForDowngrade);
    for (String pkg : pkgs) {
        int abort_code = abortIdleOptimizations(lowStorageThreshold);
        if (abort_code == OPTIMIZE_ABORT_BY_JOB_SCHEDULER) {
            return abort_code;
        }

        synchronized (failedPackageNames) {
            if (failedPackageNames.contains(pkg)) {
                // Skip previously failing package
                continue;
            }
        }

        int reason;
        boolean downgrade;
        // Downgrade unused packages.
        if (unusedPackages.contains(pkg) && shouldDowngrade) {
            // This applies for system apps or if packages location is not a directory, i.e.
            // monolithic install.
            if (is_for_primary_dex && !pm.canHaveOatDir(pkg)) {
                // For apps that don't have the oat directory, instead of downgrading,
                // remove their compiler artifacts from dalvik cache.
                pm.deleteOatArtifactsOfPackage(pkg);
                continue;
            } else {
                reason = PackageManagerService.REASON_INACTIVE_PACKAGE_DOWNGRADE;
                downgrade = true;
            }
        } else if (abort_code != OPTIMIZE_ABORT_NO_SPACE_LEFT) {
            reason = PackageManagerService.REASON_BACKGROUND_DEXOPT;
            downgrade = false;
        } else {
            // can't dexopt because of low space.
            continue;
        }

        synchronized (failedPackageNames) {
            // Conservatively add package to the list of failing ones in case
            // performDexOpt never returns.
            failedPackageNames.add(pkg);
        }

        // Optimize package if needed. Note that there can be no race between
        // concurrent jobs because PackageDexOptimizer.performDexOpt is synchronized.
        boolean success;
        int dexoptFlags =
                DexoptOptions.DEXOPT_CHECK_FOR_PROFILES_UPDATES |
                DexoptOptions.DEXOPT_BOOT_COMPLETE |
                (downgrade ? DexoptOptions.DEXOPT_DOWNGRADE : 0) |
                DexoptOptions.DEXOPT_IDLE_BACKGROUND_JOB;
        if (is_for_primary_dex) {
            int result = pm.performDexOptWithStatus(new DexoptOptions(pkg, reason,
                    dexoptFlags));
            success = result != PackageDexOptimizer.DEX_OPT_FAILED;
            if (result == PackageDexOptimizer.DEX_OPT_PERFORMED) {
                updatedPackages.add(pkg);
            }
        } else {
            success = pm.performDexOpt(new DexoptOptions(pkg,
                    reason, dexoptFlags | DexoptOptions.DEXOPT_ONLY_SECONDARY_DEX));
        }
        if (success) {
            // Dexopt succeeded, remove package from the list of failing ones.
            synchronized (failedPackageNames) {
                failedPackageNames.remove(pkg);
            }
        }
    }
    notifyPinService(updatedPackages);
    return OPTIMIZE_PROCESSED;
}