private void onPackagesEvent(final String[] pkgs, final boolean removed) {
		final Map<String, T> apps = mAppMap.get();
		final List<T> updated_apps = new ArrayList<>();
		if (removed) {
			for (final String pkg : pkgs) {
				final T removed_app = apps.remove(pkg);
				if (removed_app != null) updated_apps.add(removed_app);
			}
			Log.i(TAG, "Removed: " + Arrays.toString(pkgs));
			notifyRemoval(updated_apps);
		} else {
			for (final String pkg : pkgs) {
				ApplicationInfo info = null;
				try { //noinspection WrongConstant
					info = context().getPackageManager().getApplicationInfo(pkg, PM_FLAGS_APP_INFO);
				} catch (final PackageManager.NameNotFoundException ignored) {}
				if (info == null) {
					Log.w(TAG, "Unexpected package absence: " + pkg);
					continue;	// May happen during continuous events.
				}

				final T app = createEntry(info, apps.get(pkg)/* last entry */);
				apps.put(pkg, app);
				updated_apps.add(app);
				Log.i(TAG, "Added: " + pkg);
			}
			notifyUpdate(updated_apps);
		}
	}
Called upon the first fetch to build the list lazily and start to monitor related events.
mobile/src/main/java/com/oasisfeng/common/app/AppListProvider.java