Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit df21531a authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 5704917 from 95a52f63 to qt-c2f2-release

Change-Id: Ibcaff6bddd42626af30bb3ab2e1e2a962f58db3c
parents 3d701ad7 95a52f63
Loading
Loading
Loading
Loading
+20 −39
Original line number Diff line number Diff line
@@ -17,7 +17,6 @@
package android.content.pm;

import android.Manifest;
import android.annotation.Nullable;
import android.annotation.UnsupportedAppUsage;
import android.content.BroadcastReceiver;
import android.content.ComponentName;
@@ -177,8 +176,7 @@ public abstract class RegisteredServicesCache<V> {
        mContext.registerReceiver(mUserRemovedReceiver, userFilter);
    }

    @VisibleForTesting
    protected void handlePackageEvent(Intent intent, int userId) {
    private void handlePackageEvent(Intent intent, int userId) {
        // Don't regenerate the services map when the package is removed or its
        // ASEC container unmounted as a step in replacement.  The subsequent
        // _ADDED / _AVAILABLE call will regenerate the map in the final state.
@@ -240,9 +238,6 @@ public abstract class RegisteredServicesCache<V> {

    public void invalidateCache(int userId) {
        synchronized (mServicesLock) {
            if (DEBUG) {
                Slog.d(TAG, "invalidating cache for " + userId + " " + mInterfaceName);
            }
            final UserServices<V> user = findOrCreateUserLocked(userId);
            user.services = null;
            onServicesChangedLocked(userId);
@@ -472,37 +467,16 @@ public abstract class RegisteredServicesCache<V> {
     *                    or null to assume that everything is affected.
     * @param userId the user for whom to update the services map.
     */
    private void generateServicesMap(@Nullable int[] changedUids, int userId) {
    private void generateServicesMap(int[] changedUids, int userId) {
        if (DEBUG) {
            Slog.d(TAG, "generateServicesMap() for " + userId + ", changed UIDs = "
                    + Arrays.toString(changedUids));
        }

        synchronized (mServicesLock) {
            final UserServices<V> user = findOrCreateUserLocked(userId);
            final boolean cacheInvalid = user.services == null;
            if (cacheInvalid) {
                user.services = Maps.newHashMap();
            }

        final ArrayList<ServiceInfo<V>> serviceInfos = new ArrayList<>();
        final List<ResolveInfo> resolveInfos = queryIntentServices(userId);

        for (ResolveInfo resolveInfo : resolveInfos) {
            try {
                    // when changedUids == null, we want to do a rescan of everything, this means
                    // it's the initial scan, and containsUid will trivially return true
                    // when changedUids != null, we got here because a package changed, but
                    // invalidateCache could have been called (thus user.services == null), and we
                    // should query from PackageManager again
                    if (!cacheInvalid
                            && !containsUid(
                                    changedUids, resolveInfo.serviceInfo.applicationInfo.uid)) {
                        if (DEBUG) {
                            Slog.d(TAG, "Skipping parseServiceInfo for " + resolveInfo);
                        }
                        continue;
                    }
                ServiceInfo<V> info = parseServiceInfo(resolveInfo);
                if (info == null) {
                    Log.w(TAG, "Unable to load service info " + resolveInfo.toString());
@@ -514,6 +488,13 @@ public abstract class RegisteredServicesCache<V> {
            }
        }

        synchronized (mServicesLock) {
            final UserServices<V> user = findOrCreateUserLocked(userId);
            final boolean firstScan = user.services == null;
            if (firstScan) {
                user.services = Maps.newHashMap();
            }

            StringBuilder changes = new StringBuilder();
            boolean changed = false;
            for (ServiceInfo<V> info : serviceInfos) {
@@ -534,7 +515,7 @@ public abstract class RegisteredServicesCache<V> {
                    changed = true;
                    user.services.put(info.type, info);
                    user.persistentServices.put(info.type, info.uid);
                    if (!(user.mPersistentServicesFileDidNotExist && cacheInvalid)) {
                    if (!(user.mPersistentServicesFileDidNotExist && firstScan)) {
                        notifyListener(info.type, userId, false /* removed */);
                    }
                } else if (previousUid == info.uid) {
+28 −5
Original line number Diff line number Diff line
@@ -7764,6 +7764,12 @@ public final class Settings {
         */
        public static final String SKIP_GESTURE_COUNT = "skip_gesture_count";
        /**
         * Count of non-gesture interaction.
         * @hide
         */
        public static final String SKIP_TOUCH_COUNT = "skip_touch_count";
        private static final Validator SKIP_GESTURE_COUNT_VALIDATOR =
                NON_NEGATIVE_INTEGER_VALIDATOR;
@@ -7808,11 +7814,22 @@ public final class Settings {
        public static final String SILENCE_CALL_GESTURE_COUNT = "silence_call_gesture_count";
        /**
         * Count of successful silence notification gestures.
         * Count of non-gesture interaction.
         * @hide
         */
        public static final String SILENCE_ALARMS_TOUCH_COUNT = "silence_alarms_touch_count";
        /**
         * Count of non-gesture interaction.
         * @hide
         */
        public static final String SILENCE_TIMER_TOUCH_COUNT = "silence_timer_touch_count";
        /**
         * Count of non-gesture interaction.
         * @hide
         */
        public static final String SILENCE_NOTIFICATION_GESTURE_COUNT =
                "silence_notification_gesture_count";
        public static final String SILENCE_CALL_TOUCH_COUNT = "silence_call_touch_count";
        private static final Validator SILENCE_GESTURE_COUNT_VALIDATOR =
                NON_NEGATIVE_INTEGER_VALIDATOR;
@@ -9036,10 +9053,13 @@ public final class Settings {
            NAVIGATION_MODE,
            AWARE_ENABLED,
            SKIP_GESTURE_COUNT,
            SKIP_TOUCH_COUNT,
            SILENCE_ALARMS_GESTURE_COUNT,
            SILENCE_NOTIFICATION_GESTURE_COUNT,
            SILENCE_CALL_GESTURE_COUNT,
            SILENCE_TIMER_GESTURE_COUNT,
            SILENCE_ALARMS_TOUCH_COUNT,
            SILENCE_CALL_TOUCH_COUNT,
            SILENCE_TIMER_TOUCH_COUNT,
            DARK_MODE_DIALOG_SEEN,
            GLOBAL_ACTIONS_PANEL_ENABLED,
            AWARE_LOCK_ENABLED
@@ -9227,10 +9247,13 @@ public final class Settings {
            VALIDATORS.put(NAVIGATION_MODE, NAVIGATION_MODE_VALIDATOR);
            VALIDATORS.put(AWARE_ENABLED, AWARE_ENABLED_VALIDATOR);
            VALIDATORS.put(SKIP_GESTURE_COUNT, SKIP_GESTURE_COUNT_VALIDATOR);
            VALIDATORS.put(SKIP_TOUCH_COUNT, SKIP_GESTURE_COUNT_VALIDATOR);
            VALIDATORS.put(SILENCE_ALARMS_GESTURE_COUNT, SILENCE_GESTURE_COUNT_VALIDATOR);
            VALIDATORS.put(SILENCE_TIMER_GESTURE_COUNT, SILENCE_GESTURE_COUNT_VALIDATOR);
            VALIDATORS.put(SILENCE_CALL_GESTURE_COUNT, SILENCE_GESTURE_COUNT_VALIDATOR);
            VALIDATORS.put(SILENCE_NOTIFICATION_GESTURE_COUNT, SILENCE_GESTURE_COUNT_VALIDATOR);
            VALIDATORS.put(SILENCE_ALARMS_TOUCH_COUNT, SILENCE_GESTURE_COUNT_VALIDATOR);
            VALIDATORS.put(SILENCE_TIMER_TOUCH_COUNT, SILENCE_GESTURE_COUNT_VALIDATOR);
            VALIDATORS.put(SILENCE_CALL_TOUCH_COUNT, SILENCE_GESTURE_COUNT_VALIDATOR);
            VALIDATORS.put(ODI_CAPTIONS_ENABLED, ODI_CAPTIONS_ENABLED_VALIDATOR);
            VALIDATORS.put(DARK_MODE_DIALOG_SEEN, BOOLEAN_VALIDATOR);
            VALIDATORS.put(UI_NIGHT_MODE, UI_NIGHT_MODE_VALIDATOR);
+8 −3
Original line number Diff line number Diff line
@@ -1534,7 +1534,11 @@ public class ChooserActivity extends ResolverActivity {
                if (driList.get(i).getResolvedComponentName().equals(
                            resultList.get(j).getTargetComponent())) {
                    ShortcutManager.ShareShortcutInfo shareShortcutInfo = resultList.get(j);
                    ChooserTarget chooserTarget = convertToChooserTarget(shareShortcutInfo);
                    // Incoming results are ordered but without a score. Create a score
                    // based on the index in order to be sorted appropriately when joined
                    // with legacy direct share api results.
                    float score = Math.max(1.0f - (0.05f * j), 0.0f);
                    ChooserTarget chooserTarget = convertToChooserTarget(shareShortcutInfo, score);
                    chooserTargets.add(chooserTarget);
                    if (mDirectShareAppTargetCache != null && appTargets != null) {
                        mDirectShareAppTargetCache.put(chooserTarget, appTargets.get(j));
@@ -1580,7 +1584,8 @@ public class ChooserActivity extends ResolverActivity {
        return false;
    }

    private ChooserTarget convertToChooserTarget(ShortcutManager.ShareShortcutInfo shareShortcut) {
    private ChooserTarget convertToChooserTarget(ShortcutManager.ShareShortcutInfo shareShortcut,
                                                 float score) {
        ShortcutInfo shortcutInfo = shareShortcut.getShortcutInfo();
        Bundle extras = new Bundle();
        extras.putString(Intent.EXTRA_SHORTCUT_ID, shortcutInfo.getId());
@@ -1591,7 +1596,7 @@ public class ChooserActivity extends ResolverActivity {
                null,
                // The ranking score for this target (0.0-1.0); the system will omit items with low
                // scores when there are too many Direct Share items.
                1.0f,
                score,
                // The name of the component to be launched if this target is chosen.
                shareShortcut.getTargetComponent().clone(),
                // The extra values here will be merged into the Intent when this target is chosen.
+0 −8
Original line number Diff line number Diff line
@@ -146,14 +146,6 @@ public final class SystemUiDeviceConfigFlags {
    public static final String ASSIST_HANDLES_SHOWN_FREQUENCY_THRESHOLD_MS =
            "assist_handles_shown_frequency_threshold_ms";

    // Flag related to clock face

    /**
     * (String) Contains the clock plugin service names that are not allow to be shown.
     * Each service name is seperated by a comma(",") in the string.
     */
    public static final String CLOCK_FACE_BLACKLIST = "clock_face_blacklist";

    /**
     * (long) How long, in milliseconds, for teaching behaviors to wait before considering the user
     * taught.
+7 −0
Original line number Diff line number Diff line
@@ -188,6 +188,13 @@ public class ZygoteInit {
        System.loadLibrary("android");
        System.loadLibrary("compiler_rt");
        System.loadLibrary("jnigraphics");

        // tolerate missing sfplugin_ccodec which is only present on Codec 2 devices
        try {
            System.loadLibrary("sfplugin_ccodec");
        } catch (Error | RuntimeException e) {
            Log.w(TAG, "Problem preloading sfplugin_ccodec: " + e);
        }
    }

    native private static void nativePreloadAppProcessHALs();
Loading