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

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

Snap for 5652689 from 38466fd8 to qt-c2f2-release

Change-Id: I71abf11bf91484423733d8a12a7d460b0b77964d
parents 0ccae10d 38466fd8
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
@@ -114,6 +114,24 @@ public class ExternalVibration implements Parcelable {
        return true;
    }

    /**
     * Links a recipient to death against this external vibration token
     */
    public void linkToDeath(IBinder.DeathRecipient recipient) {
        try {
            mToken.linkToDeath(recipient, 0);
        } catch (RemoteException e) {
            return;
        }
    }

    /**
     * Unlinks a recipient to death against this external vibration token
     */
    public void unlinkToDeath(IBinder.DeathRecipient recipient) {
        mToken.unlinkToDeath(recipient, 0);
    }

    @Override
    public boolean equals(Object o) {
        if (o == null || !(o instanceof ExternalVibration)) {
+2 −0
Original line number Diff line number Diff line
@@ -48,6 +48,8 @@ import java.util.concurrent.Executor;

/**
 * Device level configuration parameters which can be tuned by a separate configuration service.
 * Namespaces that end in "_native" such as {@link #NAMESPACE_NETD_NATIVE} are intended to be used
 * by native code and should be pushed to system properties to make them accessible.
 *
 * @hide
 */
+1 −2
Original line number Diff line number Diff line
@@ -16,12 +16,11 @@

package android.view.accessibility;

import android.util.SparseArray;
import android.view.View;

/** @hide */
public final class AccessibilityNodeIdManager {
    private SparseArray<View> mIdsToViews = new SparseArray<>();
    private WeakSparseArray<View> mIdsToViews = new WeakSparseArray<View>();
    private static AccessibilityNodeIdManager sIdManager;

    /**
+63 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2019 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package android.view.accessibility;

import android.util.SparseArray;

import java.lang.ref.Reference;
import java.lang.ref.ReferenceQueue;
import java.lang.ref.WeakReference;


final class WeakSparseArray<E> {

    private final ReferenceQueue<E> mRefQueue = new ReferenceQueue<>();
    private final SparseArray<WeakReferenceWithId<E>> mSparseArray = new SparseArray<>();

    public void append(int key, E value) {
        removeUnreachableValues();
        mSparseArray.append(key, new WeakReferenceWithId(value, mRefQueue, key));
    }

    public void remove(int key) {
        removeUnreachableValues();
        mSparseArray.remove(key);
    }

    public E get(int key) {
        removeUnreachableValues();
        WeakReferenceWithId<E> ref = mSparseArray.get(key);
        return ref != null ? ref.get() : null;
    }

    private void removeUnreachableValues() {
        for (Reference ref = mRefQueue.poll(); ref != null; ref = mRefQueue.poll()) {
            mSparseArray.remove(((WeakReferenceWithId) ref).mId);
        }
    }

    private static class WeakReferenceWithId<E> extends WeakReference<E> {

        final int mId;

        WeakReferenceWithId(E referent, ReferenceQueue<? super E> q, int id) {
            super(referent, q);
            mId = id;
        }
    }
}
+30 −0
Original line number Diff line number Diff line
@@ -38,6 +38,11 @@ import android.view.accessibility.AccessibilityNodeInfo;
import android.view.inspector.InspectableProperty;

import com.android.internal.R;
import com.android.internal.util.Preconditions;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;


/**
@@ -91,6 +96,10 @@ public abstract class AbsSeekBar extends ProgressBar {
    @UnsupportedAppUsage
    private boolean mIsDragging;

    private List<Rect> mUserGestureExclusionRects = Collections.emptyList();
    private final List<Rect> mGestureExclusionRects = new ArrayList<>();
    private final Rect mThumbRect = new Rect();

    public AbsSeekBar(Context context) {
        super(context);
    }
@@ -735,6 +744,27 @@ public abstract class AbsSeekBar extends ProgressBar {

        // Canvas will be translated, so 0,0 is where we start drawing
        thumb.setBounds(left, top, right, bottom);
        updateGestureExclusionRects();
    }

    @Override
    public void setSystemGestureExclusionRects(@NonNull List<Rect> rects) {
        Preconditions.checkNotNull(rects, "rects must not be null");
        mUserGestureExclusionRects = rects;
        updateGestureExclusionRects();
    }

    private void updateGestureExclusionRects() {
        final Drawable thumb = mThumb;
        if (thumb == null) {
            super.setSystemGestureExclusionRects(mUserGestureExclusionRects);
            return;
        }
        mGestureExclusionRects.clear();
        thumb.copyBounds(mThumbRect);
        mGestureExclusionRects.add(mThumbRect);
        mGestureExclusionRects.addAll(mUserGestureExclusionRects);
        super.setSystemGestureExclusionRects(mGestureExclusionRects);
    }

    /**
Loading