Merge "Fix deadlock when create alert window notification" into oc-dev

am: 678477b383

Change-Id: If4da36399c68f7a91c0ab87d398eb3cdb70f2215
This commit is contained in:
Wale Ogunwale
2017-06-09 13:15:38 +00:00
committed by android-build-merger

View File

@@ -63,12 +63,6 @@ class AlertWindowNotification {
mNotificationTag = CHANNEL_PREFIX + mPackageName; mNotificationTag = CHANNEL_PREFIX + mPackageName;
mRequestCode = sNextRequestCode++; mRequestCode = sNextRequestCode++;
mIconUtilities = new IconUtilities(mService.mContext); mIconUtilities = new IconUtilities(mService.mContext);
if (sChannelGroup == null) {
sChannelGroup = new NotificationChannelGroup(CHANNEL_PREFIX,
mService.mContext.getString(
R.string.alert_windows_notification_channel_group_name));
mNotificationManager.createNotificationChannelGroup(sChannelGroup);
}
} }
void post() { void post() {
@@ -143,6 +137,13 @@ class AlertWindowNotification {
} }
private void createNotificationChannel(Context context, String appName) { private void createNotificationChannel(Context context, String appName) {
if (sChannelGroup == null) {
sChannelGroup = new NotificationChannelGroup(CHANNEL_PREFIX,
mService.mContext.getString(
R.string.alert_windows_notification_channel_group_name));
mNotificationManager.createNotificationChannelGroup(sChannelGroup);
}
final String nameChannel = final String nameChannel =
context.getString(R.string.alert_windows_notification_channel_name, appName); context.getString(R.string.alert_windows_notification_channel_name, appName);
final NotificationChannel channel = final NotificationChannel channel =