Modify isShowing method in Dialog

The method isShowing in Dialog.java is to judge whether
the dialog is currently showing, but it will return true
when the dialog is hidden.

Bug: 74416088
Test: modify testShow in DialogTest.java (see 639879)
run cts -m CtsAppTestCases -t android.app.cts.DialogTest#testShow

Change-Id: Ibf15e080678f414f8a66ff0841be17a2f9d2d652
Signed-off-by: tiansiming [田思明] <tiansiming@xiaomi.com>
This commit is contained in:
tiansiming [田思明]
2018-03-09 17:19:12 +08:00
parent 59787b4247
commit ca1c4d2755

View File

@@ -264,7 +264,7 @@ public class Dialog implements DialogInterface, Window.Callback,
* @return Whether the dialog is currently showing.
*/
public boolean isShowing() {
return mShowing;
return mDecor == null ? false : mDecor.getVisibility() == View.VISIBLE;
}
/**