Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 399e2697 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 6544952 from ba59b7dd to sc-d1-release

Change-Id: Ib71c2c29a73224482111d27a4277989fdb4308b4
parents 7f98f26e ba59b7dd
Loading
Loading
Loading
Loading
+10 −3
Original line number Diff line number Diff line
@@ -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;
            }
        }
@@ -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 {
@@ -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;
@@ -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) {
+0 −2
Original line number Diff line number Diff line
@@ -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();
            }
        }
@@ -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);
    }