DO NOT MERGE It will failed sometimes when run testGrantPreviouslyRevokedWithPrejudiceShowsPrompt23

testGrantPreviouslyRevokedWithPrejudiceShowsPrompt_part1 -> grantPermission -> revokePermission
setPermissionGrantState called by revokePermission will crash.

The UI still not run into Permission activity after call click(permItemView) when call findSwitch.
The currect UI still been App info UI.
findCollectionItem can find READ_CALENDAR node in App info UI while it can't find the toggle node.

system will receive TYPE_WINDOW_CONTENT_CHANGED fistly when it call click, however the currect UI
still not jump to Permission UI. This patch use TYPE_WINDOWS_CHANGED instead of TYPE_WINDOW_CONTENT_CHANGED.

Error log:
05-22 21:50:08.725  1086  1102 I TestRunner: junit.framework.AssertionFailedError: Permission toggle should be present
05-22 21:50:08.725  1086  1102 I TestRunner:    at junit.framework.Assert.fail(Assert.java:50)
05-22 21:50:08.725  1086  1102 I TestRunner:    at junit.framework.Assert.assertTrue(Assert.java:20)
05-22 21:50:08.725  1086  1102 I TestRunner:    at junit.framework.Assert.assertNotNull(Assert.java:218)
05-22 21:50:08.725  1086  1102 I TestRunner:    at com.android.cts.usepermission.BasePermissionsTest.setPermissionGrantState(BasePermissionsTest.java:389)

Change-Id: I5cdc2f8ae6720f2d46719e0d8d458500dff634dc
Signed-off-by: sanshan.zhang <pete.zhang@nxp.com>
1 file changed