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

Commit 1cc9e964 authored by Austin Tankiang's avatar Austin Tankiang Committed by Android (Google) Code Review
Browse files

Merge changes I114f6845,Ib6c445e7 into main

* changes:
  Fix bugs when cancelling jobs
  Add success green custom static colour
parents 33fb6cf7 eaf732ff
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -23,6 +23,9 @@
    <color name="secondary">#3D8AB4F8</color>
    <color name="hairline">#5F6368</color>

    <color name="success">#3CBA5A</color>
    <color name="on_success">#002110</color>

    <color name="error_image_color">@android:color/white</color>

    <color name="edge_effect">@android:color/white</color>
+3 −3
Original line number Diff line number Diff line
@@ -27,6 +27,9 @@
  <color name="secondary">#E3F2FD</color> <!-- Blue 50 -->
  <color name="hairline">#E0E0E0</color> <!-- Gray 300 -->

  <color name="success">#187231</color>
  <color name="on_success">@android:color/white</color>

  <!-- TODO(b/379776735): remove this after use_material3 flag is launched. -->
  <color name="chip_background_disable_color">#fff1f3f4</color>
  <color name="menu_search_background">@android:color/transparent</color>
@@ -101,7 +104,4 @@
  <!-- Scrim for the Top bar. Static color, 32% opacity in black. The same scrim is used in some
  parts of Android SysUI, it can't be used directly here. -->
  <color name="peek_topbar_scrim">#52000000</color>

  <!-- Custom green color indicating success not available in the base theme palette. -->
  <color name="job_progress_success">#187231</color>
</resources>
+1 −1
Original line number Diff line number Diff line
@@ -157,7 +157,7 @@
    </style>

    <style name="JobProgressItemStatusText.Success">
        <item name="android:textColor">@color/job_progress_success</item>
        <item name="android:textColor">@color/success</item>
    </style>

    <style name="JobProgressItemStatusText.Failure">
+14 −6
Original line number Diff line number Diff line
@@ -308,6 +308,7 @@ public class FileOperationService extends Service implements Job.Listener {
            if (record != null) {
                record.job.cancel();
                updateForegroundState(record.job);
                onFinished(record.job);
            }
        }

@@ -428,11 +429,16 @@ public class FileOperationService extends Service implements Job.Listener {
        if (DEBUG) {
            Log.d(TAG, "onFinished: " + job.id);
        }

        synchronized (mJobs) {
            if (!mJobs.containsKey(job.id)) {
                return;
            }

            if (mVisualSignalsEnabled) {
                mJobMonitor.sendProgress();
            }

        synchronized (mJobs) {
            // Delete the job from mJobs first to avoid this job being selected as the foreground
            // task again if we need to swap the foreground job.
            deleteJob(job);
@@ -476,7 +482,9 @@ public class FileOperationService extends Service implements Job.Listener {
                }

                notificationManager.cancel(candidate.id, NOTIFICATION_ID_PROGRESS);
                Notification notification = (candidate.getState() == Job.STATE_STARTED)
                var jobState = candidate.getState();
                Notification notification =
                        (jobState == Job.STATE_CREATED || jobState == Job.STATE_STARTED)
                                ? candidate.getSetupNotification()
                                : candidate.getProgressNotification();
                notificationManager.notify(NOTIFICATION_ID_PROGRESS, notification);