Loading core/java/android/provider/Settings.java +9 −0 Original line number Diff line number Diff line Loading @@ -888,6 +888,15 @@ public final class Settings { public static final String ACTION_ZEN_MODE_SCHEDULE_RULE_SETTINGS = "android.settings.ZEN_MODE_SCHEDULE_RULE_SETTINGS"; /** * Activity Action: Show Zen Mode external rule configuration settings. * * @hide */ @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) public static final String ACTION_ZEN_MODE_EXTERNAL_RULE_SETTINGS = "android.settings.ZEN_MODE_EXTERNAL_RULE_SETTINGS"; /** * Activity Action: Show the regulatory information screen for the device. * <p> Loading core/java/android/service/notification/ZenModeConfig.java +7 −4 Original line number Diff line number Diff line Loading @@ -654,8 +654,7 @@ public class ZenModeConfig implements Parcelable { } String summary = ""; for (ZenRule automaticRule : config.automaticRules.values()) { if (automaticRule.enabled && !automaticRule.snoozing && automaticRule.isTrueOrUnknown()) { if (automaticRule.isAutomaticActive()) { if (summary.isEmpty()) { summary = automaticRule.name; } else { Loading Loading @@ -745,9 +744,13 @@ public class ZenModeConfig implements Parcelable { component); } public boolean isAutomaticActive() { return enabled && !snoozing && component != null && isTrueOrUnknown(); } public boolean isTrueOrUnknown() { return condition == null || condition.state == Condition.STATE_TRUE || condition.state == Condition.STATE_UNKNOWN; return condition != null && (condition.state == Condition.STATE_TRUE || condition.state == Condition.STATE_UNKNOWN); } public static final Parcelable.Creator<ZenRule> CREATOR Loading core/java/com/android/internal/logging/MetricsLogger.java +2 −1 Original line number Diff line number Diff line Loading @@ -26,9 +26,10 @@ import android.os.Build; */ public class MetricsLogger implements MetricsConstants { // These constants are temporary, they should migrate to MetricsConstants. // next value is 145; // next value is 146; public static final int NOTIFICATION_ZEN_MODE_SCHEDULE_RULE = 144; public static final int NOTIFICATION_ZEN_MODE_EXTERNAL_RULE = 145; public static void visible(Context context, int category) throws IllegalArgumentException { if (Build.IS_DEBUGGABLE && category == VIEW_UNKNOWN) { Loading services/core/java/com/android/server/notification/ConditionProviders.java +14 −0 Original line number Diff line number Diff line Loading @@ -142,6 +142,9 @@ public class ConditionProviders extends ManagedServices { } catch (RemoteException e) { // we tried } if (mCallback != null) { mCallback.onServiceAdded(info.component); } } @Override Loading Loading @@ -246,6 +249,16 @@ public class ConditionProviders extends ManagedServices { } } public IConditionProvider findConditionProvider(ComponentName component) { if (component == null) return null; for (ManagedServiceInfo service : mServices) { if (component.equals(service.component)) { return provider(service); } } return null; } public void ensureRecordExists(ComponentName component, Uri conditionId, IConditionProvider provider) { // constructed by convention, make sure the record exists... Loading Loading @@ -378,6 +391,7 @@ public class ConditionProviders extends ManagedServices { public interface Callback { void onBootComplete(); void onServiceAdded(ComponentName component); void onConditionChanged(Uri id, Condition condition); void onUserSwitched(); } Loading services/core/java/com/android/server/notification/CountdownConditionProvider.java +1 −1 Original line number Diff line number Diff line Loading @@ -38,7 +38,7 @@ import java.util.Date; /** Built-in zen condition provider for simple time-based conditions */ public class CountdownConditionProvider extends SystemConditionProviderService { private static final String TAG = "CountdownConditions"; private static final String TAG = "ConditionProviders"; private static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG); public static final ComponentName COMPONENT = Loading Loading
core/java/android/provider/Settings.java +9 −0 Original line number Diff line number Diff line Loading @@ -888,6 +888,15 @@ public final class Settings { public static final String ACTION_ZEN_MODE_SCHEDULE_RULE_SETTINGS = "android.settings.ZEN_MODE_SCHEDULE_RULE_SETTINGS"; /** * Activity Action: Show Zen Mode external rule configuration settings. * * @hide */ @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION) public static final String ACTION_ZEN_MODE_EXTERNAL_RULE_SETTINGS = "android.settings.ZEN_MODE_EXTERNAL_RULE_SETTINGS"; /** * Activity Action: Show the regulatory information screen for the device. * <p> Loading
core/java/android/service/notification/ZenModeConfig.java +7 −4 Original line number Diff line number Diff line Loading @@ -654,8 +654,7 @@ public class ZenModeConfig implements Parcelable { } String summary = ""; for (ZenRule automaticRule : config.automaticRules.values()) { if (automaticRule.enabled && !automaticRule.snoozing && automaticRule.isTrueOrUnknown()) { if (automaticRule.isAutomaticActive()) { if (summary.isEmpty()) { summary = automaticRule.name; } else { Loading Loading @@ -745,9 +744,13 @@ public class ZenModeConfig implements Parcelable { component); } public boolean isAutomaticActive() { return enabled && !snoozing && component != null && isTrueOrUnknown(); } public boolean isTrueOrUnknown() { return condition == null || condition.state == Condition.STATE_TRUE || condition.state == Condition.STATE_UNKNOWN; return condition != null && (condition.state == Condition.STATE_TRUE || condition.state == Condition.STATE_UNKNOWN); } public static final Parcelable.Creator<ZenRule> CREATOR Loading
core/java/com/android/internal/logging/MetricsLogger.java +2 −1 Original line number Diff line number Diff line Loading @@ -26,9 +26,10 @@ import android.os.Build; */ public class MetricsLogger implements MetricsConstants { // These constants are temporary, they should migrate to MetricsConstants. // next value is 145; // next value is 146; public static final int NOTIFICATION_ZEN_MODE_SCHEDULE_RULE = 144; public static final int NOTIFICATION_ZEN_MODE_EXTERNAL_RULE = 145; public static void visible(Context context, int category) throws IllegalArgumentException { if (Build.IS_DEBUGGABLE && category == VIEW_UNKNOWN) { Loading
services/core/java/com/android/server/notification/ConditionProviders.java +14 −0 Original line number Diff line number Diff line Loading @@ -142,6 +142,9 @@ public class ConditionProviders extends ManagedServices { } catch (RemoteException e) { // we tried } if (mCallback != null) { mCallback.onServiceAdded(info.component); } } @Override Loading Loading @@ -246,6 +249,16 @@ public class ConditionProviders extends ManagedServices { } } public IConditionProvider findConditionProvider(ComponentName component) { if (component == null) return null; for (ManagedServiceInfo service : mServices) { if (component.equals(service.component)) { return provider(service); } } return null; } public void ensureRecordExists(ComponentName component, Uri conditionId, IConditionProvider provider) { // constructed by convention, make sure the record exists... Loading Loading @@ -378,6 +391,7 @@ public class ConditionProviders extends ManagedServices { public interface Callback { void onBootComplete(); void onServiceAdded(ComponentName component); void onConditionChanged(Uri id, Condition condition); void onUserSwitched(); } Loading
services/core/java/com/android/server/notification/CountdownConditionProvider.java +1 −1 Original line number Diff line number Diff line Loading @@ -38,7 +38,7 @@ import java.util.Date; /** Built-in zen condition provider for simple time-based conditions */ public class CountdownConditionProvider extends SystemConditionProviderService { private static final String TAG = "CountdownConditions"; private static final String TAG = "ConditionProviders"; private static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG); public static final ComponentName COMPONENT = Loading