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

Commit 77e64f15 authored by Julia Reynolds's avatar Julia Reynolds Committed by android-build-merger
Browse files

Merge "Throw exception on rule creation failure." into nyc-dev am: 252a6b12 am: 2e1c9f15

am: 1f199545

* commit '1f199545':
  Throw exception on rule creation failure.

Change-Id: I9df61f78bcb4ab9395231d61ec36110c7d7f4e5e
parents f724b710 1f199545
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -55,6 +55,7 @@ import android.service.notification.ZenModeConfig.EventInfo;
import android.service.notification.ZenModeConfig.ScheduleInfo;
import android.service.notification.ZenModeConfig.ZenRule;
import android.text.TextUtils;
import android.util.AndroidRuntimeException;
import android.util.Log;
import android.util.SparseArray;

@@ -293,7 +294,9 @@ public class ZenModeHelper {

        ZenModeConfig newConfig;
        synchronized (mConfig) {
            if (mConfig == null) return null;
            if (mConfig == null) {
                throw new AndroidRuntimeException("Could not create rule");
            }
            if (DEBUG) {
                Log.d(TAG, "addAutomaticZenRule rule= " + automaticZenRule + " reason=" + reason);
            }
@@ -304,7 +307,7 @@ public class ZenModeHelper {
            if (setConfigLocked(newConfig, reason, true)) {
                return rule.id;
            } else {
                return null;
                throw new AndroidRuntimeException("Could not create rule");
            }
        }
    }