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

Commit 71297c8a authored by Vadim Caen's avatar Vadim Caen
Browse files

Some cleanup logging and test for back navigation

 - Better logging
 - Remove method form OnBackInvokedDispatcher interface (but not the
   implementation)
 - Add test for ag/17211289

Bug: 222675481
Test: BackNavigationControllerTests#testUnregisterCallbacksWithSystemCallback
Change-Id: I6a3ae30da7e29dddda116acd8fa0c9af4b9faa6e
parent 924b02bb
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -10743,7 +10743,7 @@ public final class ViewRootImpl implements ViewParent,
    private void registerBackCallbackOnWindow() {
        if (OnBackInvokedDispatcher.DEBUG) {
            Log.d(OnBackInvokedDispatcher.TAG, TextUtils.formatSimple(
                    "ViewRootImpl.registerBackCallbackOnWindow. Callback:%s Package:%s "
                    "ViewRootImpl.registerBackCallbackOnWindow. Dispatcher:%s Package:%s "
                            + "IWindow:%s Session:%s",
                    mOnBackInvokedDispatcher, mBasePackageName, mWindow, mWindowSession));
        }
+0 −10
Original line number Diff line number Diff line
@@ -19,7 +19,6 @@ package android.window;
import android.annotation.IntDef;
import android.annotation.IntRange;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.SuppressLint;
import android.os.Build;

@@ -92,15 +91,6 @@ public interface OnBackInvokedDispatcher {
     */
    void unregisterOnBackInvokedCallback(@NonNull OnBackInvokedCallback callback);

    /**
     * Returns the most prioritized callback to receive back dispatch next.
     * @hide
     */
    @Nullable
    default OnBackInvokedCallback getTopCallback() {
        return null;
    }

    /**
     * Registers a {@link OnBackInvokedCallback} with system priority.
     * @hide
+1 −1
Original line number Diff line number Diff line
@@ -54,7 +54,7 @@ public class ProxyOnBackInvokedDispatcher implements OnBackInvokedDispatcher {
    public void registerOnBackInvokedCallback(
            int priority, @NonNull OnBackInvokedCallback callback) {
        if (DEBUG) {
            Log.v(TAG, String.format("Pending register %s. Actual=%s", callback,
            Log.v(TAG, String.format("Proxy: register %s. actualDispatcherOwner=%s", callback,
                    mActualDispatcherOwner));
        }
        if (priority < 0) {
+0 −1
Original line number Diff line number Diff line
@@ -175,7 +175,6 @@ public class WindowOnBackInvokedDispatcher implements OnBackInvokedDispatcher {
        }
    }

    @Override
    public OnBackInvokedCallback getTopCallback() {
        if (mAllCallbacks.isEmpty()) {
            return null;
+6 −0
Original line number Diff line number Diff line
@@ -703,6 +703,12 @@
      "group": "WM_DEBUG_STATES",
      "at": "com\/android\/server\/wm\/ActivityRecord.java"
    },
    "-1427392850": {
      "message": "WindowState: Setting back callback %s (priority: %d) (Client IWindow: %s). (WindowState: %s)",
      "level": "DEBUG",
      "group": "WM_DEBUG_BACK_PREVIEW",
      "at": "com\/android\/server\/wm\/WindowState.java"
    },
    "-1427184084": {
      "message": "addWindow: New client %s: window=%s Callers=%s",
      "level": "VERBOSE",
Loading