Loading core/java/android/app/INotificationManager.aidl +2 −0 Original line number Diff line number Diff line Loading @@ -42,6 +42,7 @@ import android.service.notification.StatusBarNotification; import android.service.notification.ZenPolicy; import android.app.AutomaticZenRule; import android.service.notification.ZenModeConfig; import android.service.notification.ZenDeviceEffects; /** {@hide} */ interface INotificationManager Loading Loading @@ -227,6 +228,7 @@ interface INotificationManager int getRuleInstanceCount(in ComponentName owner); int getAutomaticZenRuleState(String id); void setAutomaticZenRuleState(String id, in Condition condition); void setManualZenRuleDeviceEffects(in ZenDeviceEffects effects); byte[] getBackupPayload(int user); void applyRestore(in byte[] payload, int user); Loading core/java/android/app/NotificationManager.java +13 −0 Original line number Diff line number Diff line Loading @@ -57,6 +57,7 @@ import android.provider.Settings.Global; import android.service.notification.Adjustment; import android.service.notification.Condition; import android.service.notification.StatusBarNotification; import android.service.notification.ZenDeviceEffects; import android.service.notification.ZenModeConfig; import android.service.notification.ZenPolicy; import android.util.Log; Loading Loading @@ -1828,6 +1829,18 @@ public class NotificationManager { throw e.rethrowFromSystemServer(); } } /** * @hide */ @FlaggedApi(Flags.FLAG_MODES_UI) public void setManualZenRuleDeviceEffects(@NonNull ZenDeviceEffects effects) { INotificationManager service = getService(); try { service.setManualZenRuleDeviceEffects(effects); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } /** * For apps targeting {@link Build.VERSION_CODES#VANILLA_ICE_CREAM} and above, the Loading core/java/android/service/notification/ZenAdapters.java +4 −4 Original line number Diff line number Diff line Loading @@ -33,7 +33,7 @@ public class ZenAdapters { .allowAlarms(policy.allowAlarms()) .allowCalls( policy.allowCalls() ? notificationPolicySendersToZenPolicyPeopleType( ? prioritySendersToPeopleType( policy.allowCallsFrom()) : ZenPolicy.PEOPLE_TYPE_NONE) .allowConversations( Loading @@ -45,7 +45,7 @@ public class ZenAdapters { .allowMedia(policy.allowMedia()) .allowMessages( policy.allowMessages() ? notificationPolicySendersToZenPolicyPeopleType( ? prioritySendersToPeopleType( policy.allowMessagesFrom()) : ZenPolicy.PEOPLE_TYPE_NONE) .allowReminders(policy.allowReminders()) Loading @@ -71,7 +71,7 @@ public class ZenAdapters { /** Maps {@link ZenPolicy.PeopleType} enum to {@link Policy.PrioritySenders}. */ @Policy.PrioritySenders public static int zenPolicyPeopleTypeToNotificationPolicySenders( public static int peopleTypeToPrioritySenders( @ZenPolicy.PeopleType int zpPeopleType, @Policy.PrioritySenders int defaultResult) { switch (zpPeopleType) { case ZenPolicy.PEOPLE_TYPE_ANYONE: Loading @@ -87,7 +87,7 @@ public class ZenAdapters { /** Maps {@link Policy.PrioritySenders} enum to {@link ZenPolicy.PeopleType}. */ @ZenPolicy.PeopleType public static int notificationPolicySendersToZenPolicyPeopleType( public static int prioritySendersToPeopleType( @Policy.PrioritySenders int npPrioritySenders) { switch (npPrioritySenders) { case Policy.PRIORITY_SENDERS_ANY: Loading core/java/android/service/notification/ZenDeviceEffects.aidl 0 → 100644 +20 −0 Original line number Diff line number Diff line /* * Copyright (c) 2024, The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package android.service.notification; parcelable ZenDeviceEffects; core/java/android/service/notification/ZenModeConfig.java +613 −180 File changed.Preview size limit exceeded, changes collapsed. Show changes Loading
core/java/android/app/INotificationManager.aidl +2 −0 Original line number Diff line number Diff line Loading @@ -42,6 +42,7 @@ import android.service.notification.StatusBarNotification; import android.service.notification.ZenPolicy; import android.app.AutomaticZenRule; import android.service.notification.ZenModeConfig; import android.service.notification.ZenDeviceEffects; /** {@hide} */ interface INotificationManager Loading Loading @@ -227,6 +228,7 @@ interface INotificationManager int getRuleInstanceCount(in ComponentName owner); int getAutomaticZenRuleState(String id); void setAutomaticZenRuleState(String id, in Condition condition); void setManualZenRuleDeviceEffects(in ZenDeviceEffects effects); byte[] getBackupPayload(int user); void applyRestore(in byte[] payload, int user); Loading
core/java/android/app/NotificationManager.java +13 −0 Original line number Diff line number Diff line Loading @@ -57,6 +57,7 @@ import android.provider.Settings.Global; import android.service.notification.Adjustment; import android.service.notification.Condition; import android.service.notification.StatusBarNotification; import android.service.notification.ZenDeviceEffects; import android.service.notification.ZenModeConfig; import android.service.notification.ZenPolicy; import android.util.Log; Loading Loading @@ -1828,6 +1829,18 @@ public class NotificationManager { throw e.rethrowFromSystemServer(); } } /** * @hide */ @FlaggedApi(Flags.FLAG_MODES_UI) public void setManualZenRuleDeviceEffects(@NonNull ZenDeviceEffects effects) { INotificationManager service = getService(); try { service.setManualZenRuleDeviceEffects(effects); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } /** * For apps targeting {@link Build.VERSION_CODES#VANILLA_ICE_CREAM} and above, the Loading
core/java/android/service/notification/ZenAdapters.java +4 −4 Original line number Diff line number Diff line Loading @@ -33,7 +33,7 @@ public class ZenAdapters { .allowAlarms(policy.allowAlarms()) .allowCalls( policy.allowCalls() ? notificationPolicySendersToZenPolicyPeopleType( ? prioritySendersToPeopleType( policy.allowCallsFrom()) : ZenPolicy.PEOPLE_TYPE_NONE) .allowConversations( Loading @@ -45,7 +45,7 @@ public class ZenAdapters { .allowMedia(policy.allowMedia()) .allowMessages( policy.allowMessages() ? notificationPolicySendersToZenPolicyPeopleType( ? prioritySendersToPeopleType( policy.allowMessagesFrom()) : ZenPolicy.PEOPLE_TYPE_NONE) .allowReminders(policy.allowReminders()) Loading @@ -71,7 +71,7 @@ public class ZenAdapters { /** Maps {@link ZenPolicy.PeopleType} enum to {@link Policy.PrioritySenders}. */ @Policy.PrioritySenders public static int zenPolicyPeopleTypeToNotificationPolicySenders( public static int peopleTypeToPrioritySenders( @ZenPolicy.PeopleType int zpPeopleType, @Policy.PrioritySenders int defaultResult) { switch (zpPeopleType) { case ZenPolicy.PEOPLE_TYPE_ANYONE: Loading @@ -87,7 +87,7 @@ public class ZenAdapters { /** Maps {@link Policy.PrioritySenders} enum to {@link ZenPolicy.PeopleType}. */ @ZenPolicy.PeopleType public static int notificationPolicySendersToZenPolicyPeopleType( public static int prioritySendersToPeopleType( @Policy.PrioritySenders int npPrioritySenders) { switch (npPrioritySenders) { case Policy.PRIORITY_SENDERS_ANY: Loading
core/java/android/service/notification/ZenDeviceEffects.aidl 0 → 100644 +20 −0 Original line number Diff line number Diff line /* * Copyright (c) 2024, The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package android.service.notification; parcelable ZenDeviceEffects;
core/java/android/service/notification/ZenModeConfig.java +613 −180 File changed.Preview size limit exceeded, changes collapsed. Show changes