Fix a problem that Dialog does not close in new dispatch.

We can treat Dialog as a standard widget that handles back.
Its dedicated back nav type is not in use and can eventually be removed.

Test: try dismiss dialog in BackTest app.

Change-Id: If89856ccfac8b1fd968aa674628476de02fbf489
(cherry picked from commit 6cb6399008)
This commit is contained in:
Shan Huang
2022-03-01 02:44:55 +00:00
committed by Vadim Caen
parent 379a87059e
commit e5f99e6360

View File

@@ -465,7 +465,8 @@ public class Dialog implements DialogInterface, Window.Callback,
onBackPressed();
}
};
getOnBackInvokedDispatcher().registerSystemOnBackInvokedCallback(mDefaultBackCallback);
getOnBackInvokedDispatcher().registerOnBackInvokedCallback(
mDefaultBackCallback, OnBackInvokedDispatcher.PRIORITY_DEFAULT);
mDefaultBackCallback = null;
}
}