From ca5002f6bde51c0dc80281a821650ab28f36b39c Mon Sep 17 00:00:00 2001 From: Felipe Leme Date: Wed, 3 Aug 2016 11:51:00 -0700 Subject: Fixed BugreportReceiverTest failures: - testProgress_changeJustDetailsTouchingNotification was failing because the notification mechanism changed and now provides a way to expand and collapse the actions bar, and the test was collapsing it instead of opening the details dialog. It was fixed by tapping the notification content instead of the notification title. - Similarly, openProgressNotification() was refactored to use the bugreport name instead of id. - Uses getObject() (instead of getVisibleObject()) to get the activity from the intent chooser. - Removed the redundant call to back to dismiss the keyboard, which was causing some tests to fail due to an accessibility bug. - Retry a few times in case the bugreport name system property assertion fails, since the property is set by a background thread. - Improved how notifications are canceled. - Created a sleep() helper. Besides the test case improvements, it also removed a redundant call to setCancelable() in the main code. BUG: 30641229 BUG: 30639703 Change-Id: Icd79fada22d0b8e4be034068c3e9143ef0134eed --- packages/Shell/src/com/android/shell/BugreportProgressService.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'packages/Shell/src') diff --git a/packages/Shell/src/com/android/shell/BugreportProgressService.java b/packages/Shell/src/com/android/shell/BugreportProgressService.java index 6d4461e665d0..a677ba54c05e 100644 --- a/packages/Shell/src/com/android/shell/BugreportProgressService.java +++ b/packages/Shell/src/com/android/shell/BugreportProgressService.java @@ -1455,7 +1455,7 @@ public class BugreportProgressService extends Service { mDialog = new AlertDialog.Builder(context) .setView(view) .setTitle(dialogTitle) - .setCancelable(false) + .setCancelable(true) .setPositiveButton(context.getString(R.string.save), null) .setNegativeButton(context.getString(com.android.internal.R.string.cancel), @@ -1474,7 +1474,6 @@ public class BugreportProgressService extends Service { } }) .create(); - mDialog.setCancelable(true); mDialog.getWindow().setAttributes( new WindowManager.LayoutParams( -- cgit v1.2.3-59-g8ed1b