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

Commit 35ae8748 authored by Svetoslav's avatar Svetoslav Committed by Android (Google) Code Review
Browse files

Merge "Optimize loading of resource name when reported to accessibility."

parents 9a79ecca a33243eb
Loading
Loading
Loading
Loading
+2 −9
Original line number Diff line number Diff line
@@ -16,8 +16,6 @@

package android.view;

import android.app.ActivityThread;
import android.content.Context;
import android.graphics.Point;
import android.graphics.Rect;
import android.os.Bundle;
@@ -218,13 +216,8 @@ final class AccessibilityInteractionController {
                root = mViewRootImpl.mView;
            }
            if (root != null) {
                int resolvedViewId = root.getContext().getResources().getIdentifier(
                        viewId, "id", root.getContext().getPackageName());
                if (resolvedViewId <= 0) {
                    resolvedViewId = ((Context) ActivityThread.currentActivityThread()
                            .getSystemContext()).getResources()
                            .getIdentifier(viewId, "id", "android");
                }
                final int resolvedViewId = root.getContext().getResources()
                        .getIdentifier(viewId, null, null);
                if (resolvedViewId <= 0) {
                    return;
                }
+2 −11
Original line number Diff line number Diff line
@@ -5040,22 +5040,13 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
            if ((mAttachInfo.mAccessibilityFetchFlags
                    & AccessibilityNodeInfo.FLAG_REPORT_VIEW_IDS) != 0) {
                String viewId = null;
                try {
                    viewId = getResources().getResourceName(mID);
                } catch (Resources.NotFoundException nfe) {
                    /* ignore */
                }
                if (viewId == null) {
                    try {
                        viewId = ((Context) ActivityThread.currentActivityThread()
                                .getSystemContext()).getResources().getResourceName(mID);
                    String viewId = getResources().getResourceName(mID);
                    info.setViewIdResourceName(viewId);
                } catch (Resources.NotFoundException nfe) {
                    /* ignore */
                }
            }
                info.setViewIdResourceName(viewId);
            }
        }
        if (mLabelForId != View.NO_ID) {