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

Commit 2c257636 authored by Isaac Katzenelson's avatar Isaac Katzenelson
Browse files

Fix crash on widget

Bug: 7467875

Fixed bug where not testing if nextAlarm sting is a null.
This may happen in multiple users configuration.

Change-Id: I691c58b61e3489535133e458a56e74b8df4ad76d
parent a9ca3065
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@ import android.content.res.Resources;
import android.net.Uri;
import android.os.Bundle;
import android.provider.Settings;
import android.text.TextUtils;
import android.text.format.DateFormat;
import android.util.Log;
import android.util.TypedValue;
@@ -126,7 +127,7 @@ public class DigitalAppWidgetProvider extends AppWidgetProvider {
    private void refreshAlarm(Context c, RemoteViews clock) {
        String nextAlarm = Settings.System.getString(
                c.getContentResolver(), Settings.System.NEXT_ALARM_FORMATTED);
        if (!nextAlarm.isEmpty()) {
        if (!TextUtils.isEmpty(nextAlarm)) {
            clock.setTextViewText(R.id.nextAlarm,
                    c.getString(R.string.control_set_alarm_with_existing, nextAlarm));
            clock.setViewVisibility(R.id.nextAlarm, View.VISIBLE);
+2 −1
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.provider.Settings;
import android.text.TextUtils;
import android.text.format.DateFormat;
import android.util.Log;
import android.util.TypedValue;
@@ -242,7 +243,7 @@ public class DigitalWidgetViewsFactory extends BroadcastReceiver implements Remo
    private void refreshAlarm(Context c, RemoteViews widget) {
        String nextAlarm = Settings.System.getString(c.getContentResolver(),
                Settings.System.NEXT_ALARM_FORMATTED);
        if (!nextAlarm.isEmpty()) {
        if (!TextUtils.isEmpty(nextAlarm)) {
            widget.setTextViewText(R.id.nextAlarm,
                    c.getString(R.string.control_set_alarm_with_existing, nextAlarm));
            widget.setViewVisibility(R.id.nextAlarm, View.VISIBLE);