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

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

Snap for 6545159 from 5376309e to mainline-release

Change-Id: Ibc4d090d1a8e4213ce7d3afc698b34832f04bad4
parents 65adb316 5376309e
Loading
Loading
Loading
Loading
+10 −3
Original line number Original line Diff line number Diff line
@@ -80,8 +80,10 @@ public class TestNotificationService extends NotificationListenerService {
        public void onReceive(Context context, Intent intent) {
        public void onReceive(Context context, Intent intent) {
            String action = intent.getAction();
            String action = intent.getAction();
            if (ACTION_CHANGE_CANCEL_MODE.equals(action)) {
            if (ACTION_CHANGE_CANCEL_MODE.equals(action)) {
                Log.i(TAG, "Received cancel mode");
                mCurrentMode = MODE.CANCEL_MODE;
                mCurrentMode = MODE.CANCEL_MODE;
            } else if (ACTION_CHANGE_EXECUTION_MODE.equals(action)) {
            } else if (ACTION_CHANGE_EXECUTION_MODE.equals(action)) {
                Log.i(TAG, "Received execution mode");
                mCurrentMode = MODE.EXECUTION_MODE;
                mCurrentMode = MODE.EXECUTION_MODE;
            }
            }
        }
        }
@@ -113,6 +115,9 @@ public class TestNotificationService extends NotificationListenerService {
    @Override
    @Override
    public void onNotificationPosted(StatusBarNotification sbn) {
    public void onNotificationPosted(StatusBarNotification sbn) {
        String pkgName = sbn.getPackageName();
        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 (mTargetPackageName.equals(pkgName)) {
            if (MODE.CANCEL_MODE.equals(mCurrentMode)) {
            if (MODE.CANCEL_MODE.equals(mCurrentMode)) {
                try {
                try {
@@ -126,6 +131,8 @@ public class TestNotificationService extends NotificationListenerService {


    @Override
    @Override
    public void onNotificationRemoved(StatusBarNotification sbn) {
    public void onNotificationRemoved(StatusBarNotification sbn) {
        Log.i(TAG, "Entering notification removed cancelMode = " + MODE.CANCEL_MODE
                .equals(mCurrentMode));
        String pkgName = sbn.getPackageName();
        String pkgName = sbn.getPackageName();
        if (!mTargetPackageName.equals(pkgName)) {
        if (!mTargetPackageName.equals(pkgName)) {
            return;
            return;
@@ -174,9 +181,9 @@ public class TestNotificationService extends NotificationListenerService {
        return result;
        return result;
    }
    }


    private boolean isStartProgress(Notification notification) {
    private boolean isStartProgress(Notification notifiction) {
        ProgressBar progressBar = getProgresssBar(getRemoteViews(notification));
        ProgressBar progressBar = getProgresssBar(getRemoteViews(notifiction));
        return progressBar != null;
        return (progressBar != null) ? progressBar.getProgress() > 0 : false;
    }
    }


    private RemoteViews getRemoteViews(Notification notifiction) {
    private RemoteViews getRemoteViews(Notification notifiction) {
+0 −2
Original line number Original line Diff line number Diff line
@@ -64,7 +64,6 @@ public class CancelFromNotificationUiTest extends ActivityTest<FilesActivity> {
                    mErrorReason = intent.getStringExtra(
                    mErrorReason = intent.getStringExtra(
                            TestNotificationService.EXTRA_ERROR_REASON);
                            TestNotificationService.EXTRA_ERROR_REASON);
                }
                }
                Log.i(TAG, "Received operation broadcast " + mOperationExecuted);
                mCountDownLatch.countDown();
                mCountDownLatch.countDown();
            }
            }
        }
        }
@@ -108,7 +107,6 @@ public class CancelFromNotificationUiTest extends ActivityTest<FilesActivity> {


        mOperationExecuted = false;
        mOperationExecuted = false;
        mErrorReason = "No response from Notification";
        mErrorReason = "No response from Notification";
        Log.i(TAG, "Initializing mOperationExecuted.");
        mCountDownLatch = new CountDownLatch(1);
        mCountDownLatch = new CountDownLatch(1);
    }
    }