Loading tests/common/com/android/documentsui/services/TestNotificationService.java +10 −3 Original line number Diff line number Diff line Loading @@ -80,8 +80,10 @@ public class TestNotificationService extends NotificationListenerService { public void onReceive(Context context, Intent intent) { String action = intent.getAction(); if (ACTION_CHANGE_CANCEL_MODE.equals(action)) { Log.i(TAG, "Received cancel mode"); mCurrentMode = MODE.CANCEL_MODE; } else if (ACTION_CHANGE_EXECUTION_MODE.equals(action)) { Log.i(TAG, "Received execution mode"); mCurrentMode = MODE.EXECUTION_MODE; } } Loading Loading @@ -113,6 +115,9 @@ public class TestNotificationService extends NotificationListenerService { @Override public void onNotificationPosted(StatusBarNotification sbn) { String pkgName = sbn.getPackageName(); Log.i(TAG, "Entering notification posted cancelMode = " + MODE.CANCEL_MODE .equals(mCurrentMode) + " targetPackageName " + mTargetPackageName + " packageName " + pkgName); if (mTargetPackageName.equals(pkgName)) { if (MODE.CANCEL_MODE.equals(mCurrentMode)) { try { Loading @@ -126,6 +131,8 @@ public class TestNotificationService extends NotificationListenerService { @Override public void onNotificationRemoved(StatusBarNotification sbn) { Log.i(TAG, "Entering notification removed cancelMode = " + MODE.CANCEL_MODE .equals(mCurrentMode)); String pkgName = sbn.getPackageName(); if (!mTargetPackageName.equals(pkgName)) { return; Loading Loading @@ -174,9 +181,9 @@ public class TestNotificationService extends NotificationListenerService { return result; } private boolean isStartProgress(Notification notification) { ProgressBar progressBar = getProgresssBar(getRemoteViews(notification)); return progressBar != null; private boolean isStartProgress(Notification notifiction) { ProgressBar progressBar = getProgresssBar(getRemoteViews(notifiction)); return (progressBar != null) ? progressBar.getProgress() > 0 : false; } private RemoteViews getRemoteViews(Notification notifiction) { Loading tests/functional/com/android/documentsui/CancelFromNotificationUiTest.java +0 −2 Original line number Diff line number Diff line Loading @@ -64,7 +64,6 @@ public class CancelFromNotificationUiTest extends ActivityTest<FilesActivity> { mErrorReason = intent.getStringExtra( TestNotificationService.EXTRA_ERROR_REASON); } Log.i(TAG, "Received operation broadcast " + mOperationExecuted); mCountDownLatch.countDown(); } } Loading Loading @@ -108,7 +107,6 @@ public class CancelFromNotificationUiTest extends ActivityTest<FilesActivity> { mOperationExecuted = false; mErrorReason = "No response from Notification"; Log.i(TAG, "Initializing mOperationExecuted."); mCountDownLatch = new CountDownLatch(1); } Loading Loading
tests/common/com/android/documentsui/services/TestNotificationService.java +10 −3 Original line number Diff line number Diff line Loading @@ -80,8 +80,10 @@ public class TestNotificationService extends NotificationListenerService { public void onReceive(Context context, Intent intent) { String action = intent.getAction(); if (ACTION_CHANGE_CANCEL_MODE.equals(action)) { Log.i(TAG, "Received cancel mode"); mCurrentMode = MODE.CANCEL_MODE; } else if (ACTION_CHANGE_EXECUTION_MODE.equals(action)) { Log.i(TAG, "Received execution mode"); mCurrentMode = MODE.EXECUTION_MODE; } } Loading Loading @@ -113,6 +115,9 @@ public class TestNotificationService extends NotificationListenerService { @Override public void onNotificationPosted(StatusBarNotification sbn) { String pkgName = sbn.getPackageName(); Log.i(TAG, "Entering notification posted cancelMode = " + MODE.CANCEL_MODE .equals(mCurrentMode) + " targetPackageName " + mTargetPackageName + " packageName " + pkgName); if (mTargetPackageName.equals(pkgName)) { if (MODE.CANCEL_MODE.equals(mCurrentMode)) { try { Loading @@ -126,6 +131,8 @@ public class TestNotificationService extends NotificationListenerService { @Override public void onNotificationRemoved(StatusBarNotification sbn) { Log.i(TAG, "Entering notification removed cancelMode = " + MODE.CANCEL_MODE .equals(mCurrentMode)); String pkgName = sbn.getPackageName(); if (!mTargetPackageName.equals(pkgName)) { return; Loading Loading @@ -174,9 +181,9 @@ public class TestNotificationService extends NotificationListenerService { return result; } private boolean isStartProgress(Notification notification) { ProgressBar progressBar = getProgresssBar(getRemoteViews(notification)); return progressBar != null; private boolean isStartProgress(Notification notifiction) { ProgressBar progressBar = getProgresssBar(getRemoteViews(notifiction)); return (progressBar != null) ? progressBar.getProgress() > 0 : false; } private RemoteViews getRemoteViews(Notification notifiction) { Loading
tests/functional/com/android/documentsui/CancelFromNotificationUiTest.java +0 −2 Original line number Diff line number Diff line Loading @@ -64,7 +64,6 @@ public class CancelFromNotificationUiTest extends ActivityTest<FilesActivity> { mErrorReason = intent.getStringExtra( TestNotificationService.EXTRA_ERROR_REASON); } Log.i(TAG, "Received operation broadcast " + mOperationExecuted); mCountDownLatch.countDown(); } } Loading Loading @@ -108,7 +107,6 @@ public class CancelFromNotificationUiTest extends ActivityTest<FilesActivity> { mOperationExecuted = false; mErrorReason = "No response from Notification"; Log.i(TAG, "Initializing mOperationExecuted."); mCountDownLatch = new CountDownLatch(1); } Loading