Merge "Ensure broadcasts are sent as system" into rvc-dev am: 98bc8e9c71
Change-Id: Ibb98381e1e58a3e87be61330ac923b979fb7b0fe
This commit is contained in:
@@ -27,6 +27,8 @@ import static android.app.Notification.FLAG_ONLY_ALERT_ONCE;
|
|||||||
import static android.app.NotificationChannel.CONVERSATION_CHANNEL_ID_FORMAT;
|
import static android.app.NotificationChannel.CONVERSATION_CHANNEL_ID_FORMAT;
|
||||||
import static android.app.NotificationManager.ACTION_APP_BLOCK_STATE_CHANGED;
|
import static android.app.NotificationManager.ACTION_APP_BLOCK_STATE_CHANGED;
|
||||||
import static android.app.NotificationManager.ACTION_AUTOMATIC_ZEN_RULE_STATUS_CHANGED;
|
import static android.app.NotificationManager.ACTION_AUTOMATIC_ZEN_RULE_STATUS_CHANGED;
|
||||||
|
import static android.app.NotificationManager.ACTION_INTERRUPTION_FILTER_CHANGED;
|
||||||
|
import static android.app.NotificationManager.ACTION_INTERRUPTION_FILTER_CHANGED_INTERNAL;
|
||||||
import static android.app.NotificationManager.ACTION_NOTIFICATION_CHANNEL_BLOCK_STATE_CHANGED;
|
import static android.app.NotificationManager.ACTION_NOTIFICATION_CHANNEL_BLOCK_STATE_CHANGED;
|
||||||
import static android.app.NotificationManager.ACTION_NOTIFICATION_CHANNEL_GROUP_BLOCK_STATE_CHANGED;
|
import static android.app.NotificationManager.ACTION_NOTIFICATION_CHANNEL_GROUP_BLOCK_STATE_CHANGED;
|
||||||
import static android.app.NotificationManager.ACTION_NOTIFICATION_POLICY_ACCESS_GRANTED_CHANGED;
|
import static android.app.NotificationManager.ACTION_NOTIFICATION_POLICY_ACCESS_GRANTED_CHANGED;
|
||||||
@@ -241,6 +243,7 @@ import com.android.internal.util.ArrayUtils;
|
|||||||
import com.android.internal.util.CollectionUtils;
|
import com.android.internal.util.CollectionUtils;
|
||||||
import com.android.internal.util.DumpUtils;
|
import com.android.internal.util.DumpUtils;
|
||||||
import com.android.internal.util.FastXmlSerializer;
|
import com.android.internal.util.FastXmlSerializer;
|
||||||
|
import com.android.internal.util.FunctionalUtils;
|
||||||
import com.android.internal.util.Preconditions;
|
import com.android.internal.util.Preconditions;
|
||||||
import com.android.internal.util.XmlUtils;
|
import com.android.internal.util.XmlUtils;
|
||||||
import com.android.internal.util.function.TriPredicate;
|
import com.android.internal.util.function.TriPredicate;
|
||||||
@@ -1911,30 +1914,37 @@ public class NotificationManagerService extends SystemService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
void onZenModeChanged() {
|
void onZenModeChanged() {
|
||||||
sendRegisteredOnlyBroadcast(NotificationManager.ACTION_INTERRUPTION_FILTER_CHANGED);
|
Binder.withCleanCallingIdentity(() -> {
|
||||||
getContext().sendBroadcastAsUser(
|
sendRegisteredOnlyBroadcast(ACTION_INTERRUPTION_FILTER_CHANGED);
|
||||||
new Intent(NotificationManager.ACTION_INTERRUPTION_FILTER_CHANGED_INTERNAL)
|
getContext().sendBroadcastAsUser(
|
||||||
.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT),
|
new Intent(ACTION_INTERRUPTION_FILTER_CHANGED_INTERNAL)
|
||||||
UserHandle.ALL, android.Manifest.permission.MANAGE_NOTIFICATIONS);
|
.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT),
|
||||||
synchronized (mNotificationLock) {
|
UserHandle.ALL, permission.MANAGE_NOTIFICATIONS);
|
||||||
updateInterruptionFilterLocked();
|
synchronized (mNotificationLock) {
|
||||||
}
|
updateInterruptionFilterLocked();
|
||||||
mRankingHandler.requestSort();
|
}
|
||||||
|
mRankingHandler.requestSort();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
void onPolicyChanged() {
|
void onPolicyChanged() {
|
||||||
sendRegisteredOnlyBroadcast(NotificationManager.ACTION_NOTIFICATION_POLICY_CHANGED);
|
Binder.withCleanCallingIdentity(() -> {
|
||||||
mRankingHandler.requestSort();
|
sendRegisteredOnlyBroadcast(
|
||||||
|
NotificationManager.ACTION_NOTIFICATION_POLICY_CHANGED);
|
||||||
|
mRankingHandler.requestSort();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
void onAutomaticRuleStatusChanged(int userId, String pkg, String id, int status) {
|
void onAutomaticRuleStatusChanged(int userId, String pkg, String id, int status) {
|
||||||
Intent intent = new Intent(ACTION_AUTOMATIC_ZEN_RULE_STATUS_CHANGED);
|
Binder.withCleanCallingIdentity(() -> {
|
||||||
intent.setPackage(pkg);
|
Intent intent = new Intent(ACTION_AUTOMATIC_ZEN_RULE_STATUS_CHANGED);
|
||||||
intent.putExtra(EXTRA_AUTOMATIC_ZEN_RULE_ID, id);
|
intent.setPackage(pkg);
|
||||||
intent.putExtra(EXTRA_AUTOMATIC_ZEN_RULE_STATUS, status);
|
intent.putExtra(EXTRA_AUTOMATIC_ZEN_RULE_ID, id);
|
||||||
getContext().sendBroadcastAsUser(intent, UserHandle.of(userId));
|
intent.putExtra(EXTRA_AUTOMATIC_ZEN_RULE_STATUS, status);
|
||||||
|
getContext().sendBroadcastAsUser(intent, UserHandle.of(userId));
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
mPreferencesHelper = new PreferencesHelper(getContext(),
|
mPreferencesHelper = new PreferencesHelper(getContext(),
|
||||||
|
|||||||
Reference in New Issue
Block a user