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

Commit fe4f4166 authored by Sean Stout's avatar Sean Stout
Browse files

Tapping Timer/Stopwatch notifications doesn't crash on KK.

Bug: 31381487
Test: manual - Tap notifications on KitKat
Change-Id: I1ae5ecf91c0079fea95620de764fd520ee560ec7
parent 490edb39
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -63,12 +63,10 @@ class StopwatchNotificationBuilderPreN implements StopwatchModel.NotificationBui

        final RemoteViews collapsed = new RemoteViews(pname, R.layout.stopwatch_notif_collapsed);
        collapsed.setChronometer(R.id.swn_collapsed_chronometer, base, null, running);
        collapsed.setOnClickPendingIntent(R.id.swn_collapsed_hitspace, pendingShowApp);
        collapsed.setImageViewResource(R.id.notification_icon, R.drawable.stat_notify_stopwatch);

        final RemoteViews expanded = new RemoteViews(pname, R.layout.stopwatch_notif_expanded);
        expanded.setChronometer(R.id.swn_expanded_chronometer, base, null, running);
        expanded.setOnClickPendingIntent(R.id.swn_expanded_hitspace, pendingShowApp);
        expanded.setImageViewResource(R.id.notification_icon, R.drawable.stat_notify_stopwatch);

        @IdRes final int leftButtonId = R.id.swn_left_button;
@@ -142,6 +140,7 @@ class StopwatchNotificationBuilderPreN implements StopwatchModel.NotificationBui
                .setLocalOnly(true)
                .setOngoing(running)
                .setContent(collapsed)
                .setContentIntent(pendingShowApp)
                .setAutoCancel(stopwatch.isPaused())
                .setPriority(NotificationCompat.PRIORITY_MAX)
                .setSmallIcon(R.drawable.stat_notify_stopwatch)
+3 −1
Original line number Diff line number Diff line
@@ -65,7 +65,9 @@ public final class StopwatchService extends Service {

                // Open DeskClock positioned on the stopwatch tab.
                UiDataModel.getUiDataModel().setSelectedTab(STOPWATCH);
                startActivity(new Intent(this, DeskClock.class));
                final Intent showStopwatch = new Intent(this, DeskClock.class)
                        .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                startActivity(showStopwatch);
                break;
            }
            case ACTION_START_STOPWATCH: {
+2 −1
Original line number Diff line number Diff line
@@ -153,7 +153,8 @@ public final class TimerService extends Service {
                    // Open DeskClock which is now positioned on the timers tab and show the timer
                    // in question.
                    final Intent showTimers = new Intent(this, DeskClock.class)
                            .putExtra(EXTRA_TIMER_ID, timerId);
                            .putExtra(EXTRA_TIMER_ID, timerId)
                            .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                    startActivity(showTimers);
                    break;
                } case ACTION_START_TIMER: {