From ca1c4d275565f53d9775130763f18cbb3ab7dae1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?tiansiming=20=5B=E7=94=B0=E6=80=9D=E6=98=8E=5D?= Date: Fri, 9 Mar 2018 17:19:12 +0800 Subject: [PATCH] Modify isShowing method in Dialog MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 [田思明] --- core/java/android/app/Dialog.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/java/android/app/Dialog.java b/core/java/android/app/Dialog.java index 2eabd86c5da97..44a8930322425 100644 --- a/core/java/android/app/Dialog.java +++ b/core/java/android/app/Dialog.java @@ -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; } /**