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

Commit a7f366f6 authored by Michał Brzeziński's avatar Michał Brzeziński Committed by Automerger Merge Worker
Browse files

Merge "Moving setIsRootNamespace in notification one level higher" into udc-qpr-dev am: 136a00dc

parents ec426e58 136a00dc
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -402,7 +402,7 @@ public class NotificationRemoteInputManager implements Dumpable {
        while (p != null) {
        while (p != null) {
            if (p instanceof View) {
            if (p instanceof View) {
                View pv = (View) p;
                View pv = (View) p;
                if (pv.isRootNamespace()) {
                if (pv.getId() == com.android.internal.R.id.status_bar_latest_event_content) {
                    riv = findRemoteInputView(pv);
                    riv = findRemoteInputView(pv);
                    row = (ExpandableNotificationRow) pv.getTag(R.id.row_tag_for_content_view);
                    row = (ExpandableNotificationRow) pv.getTag(R.id.row_tag_for_content_view);
                    break;
                    break;
+0 −2
Original line number Original line Diff line number Diff line
@@ -474,7 +474,6 @@ public class NotificationContentInflater implements NotificationRowContentBinder
                            parentLayout,
                            parentLayout,
                            remoteViewClickHandler);
                            remoteViewClickHandler);
                    validateView(v, entry, row.getResources());
                    validateView(v, entry, row.getResources());
                    v.setIsRootNamespace(true);
                    applyCallback.setResultView(v);
                    applyCallback.setResultView(v);
                } else {
                } else {
                    newContentView.reapply(
                    newContentView.reapply(
@@ -511,7 +510,6 @@ public class NotificationContentInflater implements NotificationRowContentBinder
                    return;
                    return;
                }
                }
                if (isNewView) {
                if (isNewView) {
                    v.setIsRootNamespace(true);
                    applyCallback.setResultView(v);
                    applyCallback.setResultView(v);
                } else if (existingWrapper != null) {
                } else if (existingWrapper != null) {
                    existingWrapper.onReinflated();
                    existingWrapper.onReinflated();
+17 −0
Original line number Original line Diff line number Diff line
@@ -208,6 +208,23 @@ public class NotificationContentView extends FrameLayout implements Notification
        mSmartReplyConstants = smartReplyConstants;
        mSmartReplyConstants = smartReplyConstants;
        mSmartReplyController = smartReplyController;
        mSmartReplyController = smartReplyController;
        mStatusBarService = statusBarService;
        mStatusBarService = statusBarService;
        // We set root namespace so that we avoid searching children for id. Notification  might
        // contain custom view and their ids may clash with ids already existing in shade or
        // notification panel
        setIsRootNamespace(true);
    }

    @Override
    public View focusSearch(View focused, int direction) {
        // This implementation is copied from ViewGroup but with removed special handling of
        // setIsRootNamespace. This view is set as tree root using setIsRootNamespace and it
        // causes focus to be stuck inside of it. We need to be root to avoid id conflicts
        // but we don't want to behave like root when it comes to focusing.
        if (mParent != null) {
            return mParent.focusSearch(focused, direction);
        }
        Log.wtf(TAG, "NotificationContentView doesn't have parent");
        return null;
    }
    }


    public void reinflate() {
    public void reinflate() {