Mady Mellor | 87d7945 | 2017-01-10 11:52:52 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2017 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License |
| 15 | */ |
| 16 | |
Geoffrey Pitsch | df44b60 | 2017-02-03 13:31:50 -0500 | [diff] [blame] | 17 | package com.android.systemui.statusbar; |
| 18 | |
Julia Reynolds | e034148 | 2018-03-08 14:42:50 -0500 | [diff] [blame] | 19 | import static android.app.NotificationManager.IMPORTANCE_MIN; |
Julia Reynolds | 3aedded | 2017-03-31 14:42:09 -0400 | [diff] [blame] | 20 | import static android.app.NotificationManager.IMPORTANCE_NONE; |
| 21 | |
Julia Reynolds | 437cdb1 | 2018-01-03 12:27:24 -0500 | [diff] [blame] | 22 | import android.animation.Animator; |
| 23 | import android.animation.AnimatorListenerAdapter; |
| 24 | import android.animation.AnimatorSet; |
| 25 | import android.animation.ObjectAnimator; |
Rohan Shah | ca0447e | 2018-03-30 15:18:27 -0700 | [diff] [blame] | 26 | import android.annotation.Nullable; |
Mady Mellor | 87d7945 | 2017-01-10 11:52:52 -0800 | [diff] [blame] | 27 | import android.app.INotificationManager; |
Julia Reynolds | 3aedded | 2017-03-31 14:42:09 -0400 | [diff] [blame] | 28 | import android.app.Notification; |
Mady Mellor | 87d7945 | 2017-01-10 11:52:52 -0800 | [diff] [blame] | 29 | import android.app.NotificationChannel; |
Geoffrey Pitsch | df44b60 | 2017-02-03 13:31:50 -0500 | [diff] [blame] | 30 | import android.app.NotificationChannelGroup; |
Mady Mellor | 87d7945 | 2017-01-10 11:52:52 -0800 | [diff] [blame] | 31 | import android.content.Context; |
Julia Reynolds | 3aedded | 2017-03-31 14:42:09 -0400 | [diff] [blame] | 32 | import android.content.Intent; |
| 33 | import android.content.pm.ActivityInfo; |
Mady Mellor | 87d7945 | 2017-01-10 11:52:52 -0800 | [diff] [blame] | 34 | import android.content.pm.ApplicationInfo; |
Mady Mellor | 87d7945 | 2017-01-10 11:52:52 -0800 | [diff] [blame] | 35 | import android.content.pm.PackageManager; |
Julia Reynolds | 3aedded | 2017-03-31 14:42:09 -0400 | [diff] [blame] | 36 | import android.content.pm.ResolveInfo; |
Mady Mellor | 87d7945 | 2017-01-10 11:52:52 -0800 | [diff] [blame] | 37 | import android.graphics.drawable.Drawable; |
Rohan Shah | ca0447e | 2018-03-30 15:18:27 -0700 | [diff] [blame] | 38 | import android.os.Handler; |
Mady Mellor | 87d7945 | 2017-01-10 11:52:52 -0800 | [diff] [blame] | 39 | import android.os.RemoteException; |
Julia Reynolds | 3aedded | 2017-03-31 14:42:09 -0400 | [diff] [blame] | 40 | import android.service.notification.StatusBarNotification; |
| 41 | import android.text.TextUtils; |
Mady Mellor | 87d7945 | 2017-01-10 11:52:52 -0800 | [diff] [blame] | 42 | import android.util.AttributeSet; |
Rohan Shah | ca0447e | 2018-03-30 15:18:27 -0700 | [diff] [blame] | 43 | import android.util.Log; |
Mady Mellor | 87d7945 | 2017-01-10 11:52:52 -0800 | [diff] [blame] | 44 | import android.view.View; |
Julia Reynolds | e034148 | 2018-03-08 14:42:50 -0500 | [diff] [blame] | 45 | import android.view.ViewGroup; |
Geoffrey Pitsch | d94e788 | 2017-04-06 09:52:11 -0400 | [diff] [blame] | 46 | import android.view.accessibility.AccessibilityEvent; |
Mady Mellor | 87d7945 | 2017-01-10 11:52:52 -0800 | [diff] [blame] | 47 | import android.widget.ImageView; |
| 48 | import android.widget.LinearLayout; |
Mady Mellor | 87d7945 | 2017-01-10 11:52:52 -0800 | [diff] [blame] | 49 | import android.widget.TextView; |
| 50 | |
Rohan Shah | 524cf7b | 2018-03-15 14:40:02 -0700 | [diff] [blame] | 51 | import com.android.internal.annotations.VisibleForTesting; |
Mady Mellor | 87d7945 | 2017-01-10 11:52:52 -0800 | [diff] [blame] | 52 | import com.android.internal.logging.MetricsLogger; |
| 53 | import com.android.internal.logging.nano.MetricsProto.MetricsEvent; |
Rohan Shah | 524cf7b | 2018-03-15 14:40:02 -0700 | [diff] [blame] | 54 | import com.android.systemui.Dependency; |
Julia Reynolds | 437cdb1 | 2018-01-03 12:27:24 -0500 | [diff] [blame] | 55 | import com.android.systemui.Interpolators; |
Mady Mellor | 87d7945 | 2017-01-10 11:52:52 -0800 | [diff] [blame] | 56 | import com.android.systemui.R; |
Mady Mellor | 87d7945 | 2017-01-10 11:52:52 -0800 | [diff] [blame] | 57 | |
Geoffrey Pitsch | d0856f0 | 2017-02-16 10:51:18 -0500 | [diff] [blame] | 58 | import java.util.List; |
Mady Mellor | 87d7945 | 2017-01-10 11:52:52 -0800 | [diff] [blame] | 59 | |
| 60 | /** |
| 61 | * The guts of a notification revealed when performing a long press. |
| 62 | */ |
Mady Mellor | 95d743c | 2017-01-10 12:05:27 -0800 | [diff] [blame] | 63 | public class NotificationInfo extends LinearLayout implements NotificationGuts.GutsContent { |
Mady Mellor | 87d7945 | 2017-01-10 11:52:52 -0800 | [diff] [blame] | 64 | private static final String TAG = "InfoGuts"; |
| 65 | |
| 66 | private INotificationManager mINotificationManager; |
Julia Reynolds | 437cdb1 | 2018-01-03 12:27:24 -0500 | [diff] [blame] | 67 | private PackageManager mPm; |
| 68 | |
Rohan Shah | ca0447e | 2018-03-30 15:18:27 -0700 | [diff] [blame] | 69 | private String mPackageName; |
Geoffrey Pitsch | d94e788 | 2017-04-06 09:52:11 -0400 | [diff] [blame] | 70 | private String mAppName; |
Geoffrey Pitsch | d0856f0 | 2017-02-16 10:51:18 -0500 | [diff] [blame] | 71 | private int mAppUid; |
Rohan Shah | ca0447e | 2018-03-30 15:18:27 -0700 | [diff] [blame] | 72 | private int mNumUniqueChannelsInRow; |
Geoffrey Pitsch | d0856f0 | 2017-02-16 10:51:18 -0500 | [diff] [blame] | 73 | private NotificationChannel mSingleNotificationChannel; |
Mady Mellor | 87d7945 | 2017-01-10 11:52:52 -0800 | [diff] [blame] | 74 | private int mStartingUserImportance; |
Julia Reynolds | 437cdb1 | 2018-01-03 12:27:24 -0500 | [diff] [blame] | 75 | private int mChosenImportance; |
| 76 | private boolean mIsSingleDefaultChannel; |
Rohan Shah | 63411fc | 2018-03-28 19:05:52 -0700 | [diff] [blame] | 77 | private boolean mIsNonblockable; |
Julia Reynolds | 437cdb1 | 2018-01-03 12:27:24 -0500 | [diff] [blame] | 78 | private StatusBarNotification mSbn; |
| 79 | private AnimatorSet mExpandAnimation; |
Julia Reynolds | e034148 | 2018-03-08 14:42:50 -0500 | [diff] [blame] | 80 | private boolean mIsForeground; |
Mady Mellor | 87d7945 | 2017-01-10 11:52:52 -0800 | [diff] [blame] | 81 | |
Geoffrey Pitsch | 5278d3d | 2017-03-29 13:39:10 -0400 | [diff] [blame] | 82 | private CheckSaveListener mCheckSaveListener; |
Julia Reynolds | 437cdb1 | 2018-01-03 12:27:24 -0500 | [diff] [blame] | 83 | private OnSettingsClickListener mOnSettingsClickListener; |
Julia Reynolds | 3aedded | 2017-03-31 14:42:09 -0400 | [diff] [blame] | 84 | private OnAppSettingsClickListener mAppSettingsClickListener; |
Mady Mellor | 95d743c | 2017-01-10 12:05:27 -0800 | [diff] [blame] | 85 | private NotificationGuts mGutsContainer; |
Rohan Shah | 524cf7b | 2018-03-15 14:40:02 -0700 | [diff] [blame] | 86 | |
| 87 | /** Whether this view is being shown as part of the blocking helper */ |
| 88 | private boolean mIsForBlockingHelper; |
Julia Reynolds | 0ef7d84 | 2018-01-24 17:50:31 -0500 | [diff] [blame] | 89 | private boolean mNegativeUserSentiment; |
Mady Mellor | 87d7945 | 2017-01-10 11:52:52 -0800 | [diff] [blame] | 90 | |
Rohan Shah | 524cf7b | 2018-03-15 14:40:02 -0700 | [diff] [blame] | 91 | private OnClickListener mOnKeepShowing = this::closeControls; |
Julia Reynolds | 437cdb1 | 2018-01-03 12:27:24 -0500 | [diff] [blame] | 92 | |
Rohan Shah | ca0447e | 2018-03-30 15:18:27 -0700 | [diff] [blame] | 93 | private OnClickListener mOnStopOrMinimizeNotifications = v -> { |
Julia Reynolds | 437cdb1 | 2018-01-03 12:27:24 -0500 | [diff] [blame] | 94 | swapContent(false); |
| 95 | }; |
| 96 | |
| 97 | private OnClickListener mOnUndo = v -> { |
| 98 | swapContent(true); |
| 99 | }; |
| 100 | |
Mady Mellor | 87d7945 | 2017-01-10 11:52:52 -0800 | [diff] [blame] | 101 | public NotificationInfo(Context context, AttributeSet attrs) { |
| 102 | super(context, attrs); |
| 103 | } |
| 104 | |
Geoffrey Pitsch | 5278d3d | 2017-03-29 13:39:10 -0400 | [diff] [blame] | 105 | // Specify a CheckSaveListener to override when/if the user's changes are committed. |
| 106 | public interface CheckSaveListener { |
| 107 | // Invoked when importance has changed and the NotificationInfo wants to try to save it. |
| 108 | // Listener should run saveImportance unless the change should be canceled. |
Eliot Courtney | 47098cb | 2017-10-18 17:30:30 +0900 | [diff] [blame] | 109 | void checkSave(Runnable saveImportance, StatusBarNotification sbn); |
Geoffrey Pitsch | 5278d3d | 2017-03-29 13:39:10 -0400 | [diff] [blame] | 110 | } |
| 111 | |
Jason Monk | 2a6ea9c | 2017-01-26 11:14:51 -0500 | [diff] [blame] | 112 | public interface OnSettingsClickListener { |
Geoffrey Pitsch | d0856f0 | 2017-02-16 10:51:18 -0500 | [diff] [blame] | 113 | void onClick(View v, NotificationChannel channel, int appUid); |
Mady Mellor | 87d7945 | 2017-01-10 11:52:52 -0800 | [diff] [blame] | 114 | } |
| 115 | |
Julia Reynolds | 3aedded | 2017-03-31 14:42:09 -0400 | [diff] [blame] | 116 | public interface OnAppSettingsClickListener { |
| 117 | void onClick(View v, Intent intent); |
| 118 | } |
| 119 | |
Rohan Shah | 524cf7b | 2018-03-15 14:40:02 -0700 | [diff] [blame] | 120 | @VisibleForTesting |
| 121 | void bindNotification( |
| 122 | final PackageManager pm, |
Jason Monk | 2a6ea9c | 2017-01-26 11:14:51 -0500 | [diff] [blame] | 123 | final INotificationManager iNotificationManager, |
Geoffrey Pitsch | d0856f0 | 2017-02-16 10:51:18 -0500 | [diff] [blame] | 124 | final String pkg, |
Julia Reynolds | 437cdb1 | 2018-01-03 12:27:24 -0500 | [diff] [blame] | 125 | final NotificationChannel notificationChannel, |
Rohan Shah | ca0447e | 2018-03-30 15:18:27 -0700 | [diff] [blame] | 126 | final int numUniqueChannelsInRow, |
Julia Reynolds | 3aedded | 2017-03-31 14:42:09 -0400 | [diff] [blame] | 127 | final StatusBarNotification sbn, |
Julia Reynolds | 437cdb1 | 2018-01-03 12:27:24 -0500 | [diff] [blame] | 128 | final CheckSaveListener checkSaveListener, |
| 129 | final OnSettingsClickListener onSettingsClick, |
| 130 | final OnAppSettingsClickListener onAppSettingsClick, |
Rohan Shah | 63411fc | 2018-03-28 19:05:52 -0700 | [diff] [blame] | 131 | boolean isNonblockable) |
Geoffrey Pitsch | d0856f0 | 2017-02-16 10:51:18 -0500 | [diff] [blame] | 132 | throws RemoteException { |
Rohan Shah | ca0447e | 2018-03-30 15:18:27 -0700 | [diff] [blame] | 133 | bindNotification(pm, iNotificationManager, pkg, notificationChannel, |
| 134 | numUniqueChannelsInRow, sbn, checkSaveListener, onSettingsClick, |
| 135 | onAppSettingsClick, isNonblockable, false /* isBlockingHelper */, |
Rohan Shah | 524cf7b | 2018-03-15 14:40:02 -0700 | [diff] [blame] | 136 | false /* isUserSentimentNegative */); |
Julia Reynolds | 0ef7d84 | 2018-01-24 17:50:31 -0500 | [diff] [blame] | 137 | } |
| 138 | |
Rohan Shah | 524cf7b | 2018-03-15 14:40:02 -0700 | [diff] [blame] | 139 | public void bindNotification( |
| 140 | PackageManager pm, |
| 141 | INotificationManager iNotificationManager, |
| 142 | String pkg, |
| 143 | NotificationChannel notificationChannel, |
Rohan Shah | ca0447e | 2018-03-30 15:18:27 -0700 | [diff] [blame] | 144 | int numUniqueChannelsInRow, |
Rohan Shah | 524cf7b | 2018-03-15 14:40:02 -0700 | [diff] [blame] | 145 | StatusBarNotification sbn, |
| 146 | CheckSaveListener checkSaveListener, |
| 147 | OnSettingsClickListener onSettingsClick, |
| 148 | OnAppSettingsClickListener onAppSettingsClick, |
Rohan Shah | 63411fc | 2018-03-28 19:05:52 -0700 | [diff] [blame] | 149 | boolean isNonblockable, |
Rohan Shah | 524cf7b | 2018-03-15 14:40:02 -0700 | [diff] [blame] | 150 | boolean isForBlockingHelper, |
| 151 | boolean isUserSentimentNegative) |
| 152 | throws RemoteException { |
Mady Mellor | 87d7945 | 2017-01-10 11:52:52 -0800 | [diff] [blame] | 153 | mINotificationManager = iNotificationManager; |
Rohan Shah | ca0447e | 2018-03-30 15:18:27 -0700 | [diff] [blame] | 154 | mPackageName = pkg; |
| 155 | mNumUniqueChannelsInRow = numUniqueChannelsInRow; |
Julia Reynolds | 3aedded | 2017-03-31 14:42:09 -0400 | [diff] [blame] | 156 | mSbn = sbn; |
| 157 | mPm = pm; |
| 158 | mAppSettingsClickListener = onAppSettingsClick; |
Rohan Shah | ca0447e | 2018-03-30 15:18:27 -0700 | [diff] [blame] | 159 | mAppName = mPackageName; |
Julia Reynolds | 437cdb1 | 2018-01-03 12:27:24 -0500 | [diff] [blame] | 160 | mCheckSaveListener = checkSaveListener; |
| 161 | mOnSettingsClickListener = onSettingsClick; |
| 162 | mSingleNotificationChannel = notificationChannel; |
| 163 | mStartingUserImportance = mChosenImportance = mSingleNotificationChannel.getImportance(); |
Rohan Shah | 524cf7b | 2018-03-15 14:40:02 -0700 | [diff] [blame] | 164 | mNegativeUserSentiment = isUserSentimentNegative; |
Rohan Shah | 63411fc | 2018-03-28 19:05:52 -0700 | [diff] [blame] | 165 | mIsNonblockable = isNonblockable; |
Julia Reynolds | e034148 | 2018-03-08 14:42:50 -0500 | [diff] [blame] | 166 | mIsForeground = |
| 167 | (mSbn.getNotification().flags & Notification.FLAG_FOREGROUND_SERVICE) != 0; |
Rohan Shah | 524cf7b | 2018-03-15 14:40:02 -0700 | [diff] [blame] | 168 | mIsForBlockingHelper = isForBlockingHelper; |
Rohan Shah | dbd64e7 | 2018-03-28 14:46:50 -0700 | [diff] [blame] | 169 | mAppUid = mSbn.getUid(); |
Geoffrey Pitsch | df44b60 | 2017-02-03 13:31:50 -0500 | [diff] [blame] | 170 | |
Julia Reynolds | 437cdb1 | 2018-01-03 12:27:24 -0500 | [diff] [blame] | 171 | int numTotalChannels = mINotificationManager.getNumNotificationChannelsForPackage( |
Geoffrey Pitsch | d034d29 | 2017-05-12 11:59:20 -0400 | [diff] [blame] | 172 | pkg, mAppUid, false /* includeDeleted */); |
Rohan Shah | ca0447e | 2018-03-30 15:18:27 -0700 | [diff] [blame] | 173 | if (mNumUniqueChannelsInRow == 0) { |
Geoffrey Pitsch | d034d29 | 2017-05-12 11:59:20 -0400 | [diff] [blame] | 174 | throw new IllegalArgumentException("bindNotification requires at least one channel"); |
| 175 | } else { |
Julia Reynolds | 437cdb1 | 2018-01-03 12:27:24 -0500 | [diff] [blame] | 176 | // Special behavior for the Default channel if no other channels have been defined. |
Rohan Shah | ca0447e | 2018-03-30 15:18:27 -0700 | [diff] [blame] | 177 | mIsSingleDefaultChannel = mNumUniqueChannelsInRow == 1 |
Rohan Shah | dbd64e7 | 2018-03-28 14:46:50 -0700 | [diff] [blame] | 178 | && mSingleNotificationChannel.getId().equals( |
| 179 | NotificationChannel.DEFAULT_CHANNEL_ID) |
| 180 | && numTotalChannels == 1; |
Geoffrey Pitsch | d034d29 | 2017-05-12 11:59:20 -0400 | [diff] [blame] | 181 | } |
| 182 | |
Julia Reynolds | 437cdb1 | 2018-01-03 12:27:24 -0500 | [diff] [blame] | 183 | bindHeader(); |
| 184 | bindPrompt(); |
| 185 | bindButtons(); |
| 186 | } |
| 187 | |
| 188 | private void bindHeader() throws RemoteException { |
| 189 | // Package name |
| 190 | Drawable pkgicon = null; |
| 191 | ApplicationInfo info; |
| 192 | try { |
Rohan Shah | ca0447e | 2018-03-30 15:18:27 -0700 | [diff] [blame] | 193 | info = mPm.getApplicationInfo( |
| 194 | mPackageName, |
Julia Reynolds | 437cdb1 | 2018-01-03 12:27:24 -0500 | [diff] [blame] | 195 | PackageManager.MATCH_UNINSTALLED_PACKAGES |
| 196 | | PackageManager.MATCH_DISABLED_COMPONENTS |
| 197 | | PackageManager.MATCH_DIRECT_BOOT_UNAWARE |
| 198 | | PackageManager.MATCH_DIRECT_BOOT_AWARE); |
| 199 | if (info != null) { |
Julia Reynolds | 437cdb1 | 2018-01-03 12:27:24 -0500 | [diff] [blame] | 200 | mAppName = String.valueOf(mPm.getApplicationLabel(info)); |
| 201 | pkgicon = mPm.getApplicationIcon(info); |
Geoffrey Pitsch | ee8c81e | 2017-03-23 11:38:56 -0400 | [diff] [blame] | 202 | } |
Julia Reynolds | 437cdb1 | 2018-01-03 12:27:24 -0500 | [diff] [blame] | 203 | } catch (PackageManager.NameNotFoundException e) { |
| 204 | // app is gone, just show package name and generic icon |
| 205 | pkgicon = mPm.getDefaultActivityIcon(); |
Geoffrey Pitsch | d0856f0 | 2017-02-16 10:51:18 -0500 | [diff] [blame] | 206 | } |
Julia Reynolds | 437cdb1 | 2018-01-03 12:27:24 -0500 | [diff] [blame] | 207 | ((ImageView) findViewById(R.id.pkgicon)).setImageDrawable(pkgicon); |
Geoffrey Pitsch | d94e788 | 2017-04-06 09:52:11 -0400 | [diff] [blame] | 208 | ((TextView) findViewById(R.id.pkgname)).setText(mAppName); |
Mady Mellor | 87d7945 | 2017-01-10 11:52:52 -0800 | [diff] [blame] | 209 | |
Geoffrey Pitsch | df44b60 | 2017-02-03 13:31:50 -0500 | [diff] [blame] | 210 | // Set group information if this channel has an associated group. |
| 211 | CharSequence groupName = null; |
Geoffrey Pitsch | d0856f0 | 2017-02-16 10:51:18 -0500 | [diff] [blame] | 212 | if (mSingleNotificationChannel != null && mSingleNotificationChannel.getGroup() != null) { |
| 213 | final NotificationChannelGroup notificationChannelGroup = |
Julia Reynolds | 437cdb1 | 2018-01-03 12:27:24 -0500 | [diff] [blame] | 214 | mINotificationManager.getNotificationChannelGroupForPackage( |
Rohan Shah | ca0447e | 2018-03-30 15:18:27 -0700 | [diff] [blame] | 215 | mSingleNotificationChannel.getGroup(), mPackageName, mAppUid); |
Geoffrey Pitsch | d0856f0 | 2017-02-16 10:51:18 -0500 | [diff] [blame] | 216 | if (notificationChannelGroup != null) { |
| 217 | groupName = notificationChannelGroup.getName(); |
Geoffrey Pitsch | df44b60 | 2017-02-03 13:31:50 -0500 | [diff] [blame] | 218 | } |
Mady Mellor | 87d7945 | 2017-01-10 11:52:52 -0800 | [diff] [blame] | 219 | } |
Julia Reynolds | 437cdb1 | 2018-01-03 12:27:24 -0500 | [diff] [blame] | 220 | TextView groupNameView = findViewById(R.id.group_name); |
| 221 | TextView groupDividerView = findViewById(R.id.pkg_group_divider); |
Geoffrey Pitsch | df44b60 | 2017-02-03 13:31:50 -0500 | [diff] [blame] | 222 | if (groupName != null) { |
| 223 | groupNameView.setText(groupName); |
| 224 | groupNameView.setVisibility(View.VISIBLE); |
| 225 | groupDividerView.setVisibility(View.VISIBLE); |
| 226 | } else { |
| 227 | groupNameView.setVisibility(View.GONE); |
| 228 | groupDividerView.setVisibility(View.GONE); |
| 229 | } |
Mady Mellor | 87d7945 | 2017-01-10 11:52:52 -0800 | [diff] [blame] | 230 | |
Geoffrey Pitsch | df44b60 | 2017-02-03 13:31:50 -0500 | [diff] [blame] | 231 | // Settings button. |
Julia Reynolds | 437cdb1 | 2018-01-03 12:27:24 -0500 | [diff] [blame] | 232 | final View settingsButton = findViewById(R.id.info); |
| 233 | if (mAppUid >= 0 && mOnSettingsClickListener != null) { |
Geoffrey Pitsch | 029a3fa | 2017-03-30 13:01:57 -0400 | [diff] [blame] | 234 | settingsButton.setVisibility(View.VISIBLE); |
Geoffrey Pitsch | d0856f0 | 2017-02-16 10:51:18 -0500 | [diff] [blame] | 235 | final int appUidF = mAppUid; |
Geoffrey Pitsch | df44b60 | 2017-02-03 13:31:50 -0500 | [diff] [blame] | 236 | settingsButton.setOnClickListener( |
| 237 | (View view) -> { |
Julia Reynolds | 437cdb1 | 2018-01-03 12:27:24 -0500 | [diff] [blame] | 238 | mOnSettingsClickListener.onClick(view, |
Rohan Shah | ca0447e | 2018-03-30 15:18:27 -0700 | [diff] [blame] | 239 | mNumUniqueChannelsInRow > 1 ? null : mSingleNotificationChannel, |
Julia Reynolds | 437cdb1 | 2018-01-03 12:27:24 -0500 | [diff] [blame] | 240 | appUidF); |
Geoffrey Pitsch | df44b60 | 2017-02-03 13:31:50 -0500 | [diff] [blame] | 241 | }); |
Geoffrey Pitsch | df44b60 | 2017-02-03 13:31:50 -0500 | [diff] [blame] | 242 | } else { |
| 243 | settingsButton.setVisibility(View.GONE); |
| 244 | } |
Julia Reynolds | 437cdb1 | 2018-01-03 12:27:24 -0500 | [diff] [blame] | 245 | } |
Geoffrey Pitsch | df44b60 | 2017-02-03 13:31:50 -0500 | [diff] [blame] | 246 | |
Julia Reynolds | 437cdb1 | 2018-01-03 12:27:24 -0500 | [diff] [blame] | 247 | private void bindPrompt() { |
Julia Reynolds | 437cdb1 | 2018-01-03 12:27:24 -0500 | [diff] [blame] | 248 | final TextView blockPrompt = findViewById(R.id.block_prompt); |
Julia Reynolds | 0ef7d84 | 2018-01-24 17:50:31 -0500 | [diff] [blame] | 249 | bindName(); |
Rohan Shah | 63411fc | 2018-03-28 19:05:52 -0700 | [diff] [blame] | 250 | if (mIsNonblockable) { |
Julia Reynolds | 437cdb1 | 2018-01-03 12:27:24 -0500 | [diff] [blame] | 251 | blockPrompt.setText(R.string.notification_unblockable_desc); |
| 252 | } else { |
Julia Reynolds | 0ef7d84 | 2018-01-24 17:50:31 -0500 | [diff] [blame] | 253 | if (mNegativeUserSentiment) { |
| 254 | blockPrompt.setText(R.string.inline_blocking_helper); |
Rohan Shah | ca0447e | 2018-03-30 15:18:27 -0700 | [diff] [blame] | 255 | } else if (mIsSingleDefaultChannel || mNumUniqueChannelsInRow > 1) { |
Julia Reynolds | 437cdb1 | 2018-01-03 12:27:24 -0500 | [diff] [blame] | 256 | blockPrompt.setText(R.string.inline_keep_showing_app); |
| 257 | } else { |
Julia Reynolds | 437cdb1 | 2018-01-03 12:27:24 -0500 | [diff] [blame] | 258 | blockPrompt.setText(R.string.inline_keep_showing); |
| 259 | } |
| 260 | } |
Mady Mellor | 87d7945 | 2017-01-10 11:52:52 -0800 | [diff] [blame] | 261 | } |
| 262 | |
Julia Reynolds | 0ef7d84 | 2018-01-24 17:50:31 -0500 | [diff] [blame] | 263 | private void bindName() { |
| 264 | final TextView channelName = findViewById(R.id.channel_name); |
Rohan Shah | ca0447e | 2018-03-30 15:18:27 -0700 | [diff] [blame] | 265 | if (mIsSingleDefaultChannel || mNumUniqueChannelsInRow > 1) { |
Julia Reynolds | 0ef7d84 | 2018-01-24 17:50:31 -0500 | [diff] [blame] | 266 | channelName.setVisibility(View.GONE); |
| 267 | } else { |
| 268 | channelName.setText(mSingleNotificationChannel.getName()); |
| 269 | } |
| 270 | } |
| 271 | |
Geoffrey Pitsch | 5278d3d | 2017-03-29 13:39:10 -0400 | [diff] [blame] | 272 | private boolean hasImportanceChanged() { |
Julia Reynolds | 437cdb1 | 2018-01-03 12:27:24 -0500 | [diff] [blame] | 273 | return mSingleNotificationChannel != null && mStartingUserImportance != mChosenImportance; |
Mady Mellor | 87d7945 | 2017-01-10 11:52:52 -0800 | [diff] [blame] | 274 | } |
| 275 | |
Geoffrey Pitsch | df44b60 | 2017-02-03 13:31:50 -0500 | [diff] [blame] | 276 | private void saveImportance() { |
Rohan Shah | ca0447e | 2018-03-30 15:18:27 -0700 | [diff] [blame] | 277 | if (!mIsNonblockable) { |
| 278 | if (mCheckSaveListener != null) { |
| 279 | mCheckSaveListener.checkSave(this::updateImportance, mSbn); |
| 280 | } else { |
| 281 | updateImportance(); |
| 282 | } |
Geoffrey Pitsch | d0856f0 | 2017-02-16 10:51:18 -0500 | [diff] [blame] | 283 | } |
Rohan Shah | ca0447e | 2018-03-30 15:18:27 -0700 | [diff] [blame] | 284 | } |
| 285 | |
| 286 | /** |
| 287 | * Commits the updated importance values on the background thread. |
| 288 | */ |
| 289 | private void updateImportance() { |
Mady Mellor | 87d7945 | 2017-01-10 11:52:52 -0800 | [diff] [blame] | 290 | MetricsLogger.action(mContext, MetricsEvent.ACTION_SAVE_IMPORTANCE, |
Julia Reynolds | 437cdb1 | 2018-01-03 12:27:24 -0500 | [diff] [blame] | 291 | mChosenImportance - mStartingUserImportance); |
Rohan Shah | ca0447e | 2018-03-30 15:18:27 -0700 | [diff] [blame] | 292 | |
| 293 | Handler bgHandler = new Handler(Dependency.get(Dependency.BG_LOOPER)); |
| 294 | bgHandler.post(new UpdateImportanceRunnable(mINotificationManager, mPackageName, mAppUid, |
| 295 | mNumUniqueChannelsInRow == 1 ? mSingleNotificationChannel : null, |
| 296 | mStartingUserImportance, mChosenImportance)); |
Mady Mellor | 87d7945 | 2017-01-10 11:52:52 -0800 | [diff] [blame] | 297 | } |
| 298 | |
Julia Reynolds | 437cdb1 | 2018-01-03 12:27:24 -0500 | [diff] [blame] | 299 | private void bindButtons() { |
Rohan Shah | 524cf7b | 2018-03-15 14:40:02 -0700 | [diff] [blame] | 300 | // Set up stay-in-notification actions |
Julia Reynolds | 437cdb1 | 2018-01-03 12:27:24 -0500 | [diff] [blame] | 301 | View block = findViewById(R.id.block); |
Julia Reynolds | 437cdb1 | 2018-01-03 12:27:24 -0500 | [diff] [blame] | 302 | TextView keep = findViewById(R.id.keep); |
Julia Reynolds | e034148 | 2018-03-08 14:42:50 -0500 | [diff] [blame] | 303 | View minimize = findViewById(R.id.minimize); |
Rohan Shah | 524cf7b | 2018-03-15 14:40:02 -0700 | [diff] [blame] | 304 | |
| 305 | findViewById(R.id.undo).setOnClickListener(mOnUndo); |
Rohan Shah | ca0447e | 2018-03-30 15:18:27 -0700 | [diff] [blame] | 306 | block.setOnClickListener(mOnStopOrMinimizeNotifications); |
Rohan Shah | 524cf7b | 2018-03-15 14:40:02 -0700 | [diff] [blame] | 307 | keep.setOnClickListener(mOnKeepShowing); |
Rohan Shah | ca0447e | 2018-03-30 15:18:27 -0700 | [diff] [blame] | 308 | minimize.setOnClickListener(mOnStopOrMinimizeNotifications); |
Julia Reynolds | 437cdb1 | 2018-01-03 12:27:24 -0500 | [diff] [blame] | 309 | |
Rohan Shah | 63411fc | 2018-03-28 19:05:52 -0700 | [diff] [blame] | 310 | if (mIsNonblockable) { |
Julia Reynolds | 437cdb1 | 2018-01-03 12:27:24 -0500 | [diff] [blame] | 311 | keep.setText(R.string.notification_done); |
| 312 | block.setVisibility(GONE); |
Julia Reynolds | e034148 | 2018-03-08 14:42:50 -0500 | [diff] [blame] | 313 | minimize.setVisibility(GONE); |
| 314 | } else if (mIsForeground) { |
| 315 | block.setVisibility(GONE); |
| 316 | minimize.setVisibility(VISIBLE); |
| 317 | } else if (!mIsForeground) { |
| 318 | block.setVisibility(VISIBLE); |
| 319 | minimize.setVisibility(GONE); |
Julia Reynolds | 437cdb1 | 2018-01-03 12:27:24 -0500 | [diff] [blame] | 320 | } |
| 321 | |
Rohan Shah | 7c6b37a | 2018-03-30 21:07:45 +0000 | [diff] [blame] | 322 | // Set up app settings link (i.e. Customize) |
Julia Reynolds | 437cdb1 | 2018-01-03 12:27:24 -0500 | [diff] [blame] | 323 | TextView settingsLinkView = findViewById(R.id.app_settings); |
Rohan Shah | ca0447e | 2018-03-30 15:18:27 -0700 | [diff] [blame] | 324 | Intent settingsIntent = getAppSettingsIntent(mPm, mPackageName, mSingleNotificationChannel, |
Julia Reynolds | 437cdb1 | 2018-01-03 12:27:24 -0500 | [diff] [blame] | 325 | mSbn.getId(), mSbn.getTag()); |
Rohan Shah | 7c6b37a | 2018-03-30 21:07:45 +0000 | [diff] [blame] | 326 | if (!mIsForBlockingHelper |
| 327 | && settingsIntent != null |
Julia Reynolds | 437cdb1 | 2018-01-03 12:27:24 -0500 | [diff] [blame] | 328 | && !TextUtils.isEmpty(mSbn.getNotification().getSettingsText())) { |
Julia Reynolds | e034148 | 2018-03-08 14:42:50 -0500 | [diff] [blame] | 329 | settingsLinkView.setVisibility(VISIBLE); |
Rohan Shah | 7c6b37a | 2018-03-30 21:07:45 +0000 | [diff] [blame] | 330 | settingsLinkView.setText(mContext.getString(R.string.notification_app_settings)); |
Julia Reynolds | 437cdb1 | 2018-01-03 12:27:24 -0500 | [diff] [blame] | 331 | settingsLinkView.setOnClickListener((View view) -> { |
| 332 | mAppSettingsClickListener.onClick(view, settingsIntent); |
| 333 | }); |
Mady Mellor | 87d7945 | 2017-01-10 11:52:52 -0800 | [diff] [blame] | 334 | } else { |
Julia Reynolds | 437cdb1 | 2018-01-03 12:27:24 -0500 | [diff] [blame] | 335 | settingsLinkView.setVisibility(View.GONE); |
Mady Mellor | 87d7945 | 2017-01-10 11:52:52 -0800 | [diff] [blame] | 336 | } |
| 337 | } |
| 338 | |
Julia Reynolds | 437cdb1 | 2018-01-03 12:27:24 -0500 | [diff] [blame] | 339 | private void swapContent(boolean showPrompt) { |
| 340 | if (mExpandAnimation != null) { |
| 341 | mExpandAnimation.cancel(); |
| 342 | } |
Mady Mellor | 87d7945 | 2017-01-10 11:52:52 -0800 | [diff] [blame] | 343 | |
Julia Reynolds | e034148 | 2018-03-08 14:42:50 -0500 | [diff] [blame] | 344 | View prompt = findViewById(R.id.prompt); |
| 345 | ViewGroup confirmation = findViewById(R.id.confirmation); |
| 346 | TextView confirmationText = findViewById(R.id.confirmation_text); |
| 347 | View header = findViewById(R.id.header); |
| 348 | |
Julia Reynolds | 437cdb1 | 2018-01-03 12:27:24 -0500 | [diff] [blame] | 349 | if (showPrompt) { |
| 350 | mChosenImportance = mStartingUserImportance; |
Julia Reynolds | e034148 | 2018-03-08 14:42:50 -0500 | [diff] [blame] | 351 | } else if (mIsForeground) { |
| 352 | mChosenImportance = IMPORTANCE_MIN; |
| 353 | confirmationText.setText(R.string.notification_channel_minimized); |
Julia Reynolds | 437cdb1 | 2018-01-03 12:27:24 -0500 | [diff] [blame] | 354 | } else { |
| 355 | mChosenImportance = IMPORTANCE_NONE; |
Julia Reynolds | e034148 | 2018-03-08 14:42:50 -0500 | [diff] [blame] | 356 | confirmationText.setText(R.string.notification_channel_disabled); |
Julia Reynolds | 437cdb1 | 2018-01-03 12:27:24 -0500 | [diff] [blame] | 357 | } |
| 358 | |
Julia Reynolds | 437cdb1 | 2018-01-03 12:27:24 -0500 | [diff] [blame] | 359 | ObjectAnimator promptAnim = ObjectAnimator.ofFloat(prompt, View.ALPHA, |
| 360 | prompt.getAlpha(), showPrompt ? 1f : 0f); |
| 361 | promptAnim.setInterpolator(showPrompt ? Interpolators.ALPHA_IN : Interpolators.ALPHA_OUT); |
| 362 | ObjectAnimator confirmAnim = ObjectAnimator.ofFloat(confirmation, View.ALPHA, |
| 363 | confirmation.getAlpha(), showPrompt ? 0f : 1f); |
| 364 | confirmAnim.setInterpolator(showPrompt ? Interpolators.ALPHA_OUT : Interpolators.ALPHA_IN); |
| 365 | |
| 366 | prompt.setVisibility(showPrompt ? VISIBLE : GONE); |
| 367 | confirmation.setVisibility(showPrompt ? GONE : VISIBLE); |
Julia Reynolds | e034148 | 2018-03-08 14:42:50 -0500 | [diff] [blame] | 368 | header.setVisibility(showPrompt ? VISIBLE : GONE); |
Julia Reynolds | 437cdb1 | 2018-01-03 12:27:24 -0500 | [diff] [blame] | 369 | |
| 370 | mExpandAnimation = new AnimatorSet(); |
| 371 | mExpandAnimation.playTogether(promptAnim, confirmAnim); |
| 372 | mExpandAnimation.setDuration(150); |
| 373 | mExpandAnimation.addListener(new AnimatorListenerAdapter() { |
| 374 | boolean cancelled = false; |
| 375 | |
| 376 | @Override |
| 377 | public void onAnimationCancel(Animator animation) { |
| 378 | cancelled = true; |
Geoffrey Pitsch | df44b60 | 2017-02-03 13:31:50 -0500 | [diff] [blame] | 379 | } |
Julia Reynolds | 437cdb1 | 2018-01-03 12:27:24 -0500 | [diff] [blame] | 380 | |
| 381 | @Override |
| 382 | public void onAnimationEnd(Animator animation) { |
| 383 | if (!cancelled) { |
| 384 | prompt.setVisibility(showPrompt ? VISIBLE : GONE); |
| 385 | confirmation.setVisibility(showPrompt ? GONE : VISIBLE); |
| 386 | } |
| 387 | } |
Mady Mellor | 87d7945 | 2017-01-10 11:52:52 -0800 | [diff] [blame] | 388 | }); |
Julia Reynolds | 437cdb1 | 2018-01-03 12:27:24 -0500 | [diff] [blame] | 389 | mExpandAnimation.start(); |
Mady Mellor | 87d7945 | 2017-01-10 11:52:52 -0800 | [diff] [blame] | 390 | } |
| 391 | |
Geoffrey Pitsch | d94e788 | 2017-04-06 09:52:11 -0400 | [diff] [blame] | 392 | @Override |
| 393 | public void onInitializeAccessibilityEvent(AccessibilityEvent event) { |
| 394 | super.onInitializeAccessibilityEvent(event); |
| 395 | if (mGutsContainer != null && |
| 396 | event.getEventType() == AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED) { |
| 397 | if (mGutsContainer.isExposed()) { |
| 398 | event.getText().add(mContext.getString( |
| 399 | R.string.notification_channel_controls_opened_accessibility, mAppName)); |
| 400 | } else { |
| 401 | event.getText().add(mContext.getString( |
| 402 | R.string.notification_channel_controls_closed_accessibility, mAppName)); |
| 403 | } |
| 404 | } |
| 405 | } |
| 406 | |
Julia Reynolds | 3aedded | 2017-03-31 14:42:09 -0400 | [diff] [blame] | 407 | private Intent getAppSettingsIntent(PackageManager pm, String packageName, |
| 408 | NotificationChannel channel, int id, String tag) { |
| 409 | Intent intent = new Intent(Intent.ACTION_MAIN) |
| 410 | .addCategory(Notification.INTENT_CATEGORY_NOTIFICATION_PREFERENCES) |
| 411 | .setPackage(packageName); |
| 412 | final List<ResolveInfo> resolveInfos = pm.queryIntentActivities( |
| 413 | intent, |
| 414 | PackageManager.MATCH_DEFAULT_ONLY |
| 415 | ); |
| 416 | if (resolveInfos == null || resolveInfos.size() == 0 || resolveInfos.get(0) == null) { |
| 417 | return null; |
| 418 | } |
| 419 | final ActivityInfo activityInfo = resolveInfos.get(0).activityInfo; |
| 420 | intent.setClassName(activityInfo.packageName, activityInfo.name); |
| 421 | if (channel != null) { |
| 422 | intent.putExtra(Notification.EXTRA_CHANNEL_ID, channel.getId()); |
| 423 | } |
| 424 | intent.putExtra(Notification.EXTRA_NOTIFICATION_ID, id); |
| 425 | intent.putExtra(Notification.EXTRA_NOTIFICATION_TAG, tag); |
| 426 | return intent; |
| 427 | } |
| 428 | |
Rohan Shah | ca0447e | 2018-03-30 15:18:27 -0700 | [diff] [blame] | 429 | /** |
| 430 | * Closes the controls and commits the updated importance values (indirectly). If this view is |
| 431 | * being used to show the blocking helper, this will immediately dismiss the blocking helper and |
| 432 | * commit the updated importance. |
| 433 | * |
| 434 | * <p><b>Note,</b> this will only get called once the view is dismissing. This means that the |
| 435 | * user does not have the ability to undo the action anymore. See {@link #swapContent(boolean)} |
| 436 | * for where undo is handled. |
| 437 | */ |
Rohan Shah | 524cf7b | 2018-03-15 14:40:02 -0700 | [diff] [blame] | 438 | @VisibleForTesting |
| 439 | void closeControls(View v) { |
| 440 | if (mIsForBlockingHelper) { |
| 441 | NotificationBlockingHelperManager manager = |
| 442 | Dependency.get(NotificationBlockingHelperManager.class); |
| 443 | manager.dismissCurrentBlockingHelper(); |
Rohan Shah | ca0447e | 2018-03-30 15:18:27 -0700 | [diff] [blame] | 444 | |
| 445 | // Since this won't get a callback via gutsContainer.closeControls, save the new |
| 446 | // importance values immediately. |
| 447 | saveImportance(); |
Rohan Shah | 524cf7b | 2018-03-15 14:40:02 -0700 | [diff] [blame] | 448 | } else { |
| 449 | int[] parentLoc = new int[2]; |
| 450 | int[] targetLoc = new int[2]; |
| 451 | mGutsContainer.getLocationOnScreen(parentLoc); |
| 452 | v.getLocationOnScreen(targetLoc); |
| 453 | final int centerX = v.getWidth() / 2; |
| 454 | final int centerY = v.getHeight() / 2; |
| 455 | final int x = targetLoc[0] - parentLoc[0] + centerX; |
| 456 | final int y = targetLoc[1] - parentLoc[1] + centerY; |
| 457 | mGutsContainer.closeControls(x, y, true /* save */, false /* force */); |
| 458 | } |
Julia Reynolds | 437cdb1 | 2018-01-03 12:27:24 -0500 | [diff] [blame] | 459 | } |
| 460 | |
Mady Mellor | 87d7945 | 2017-01-10 11:52:52 -0800 | [diff] [blame] | 461 | @Override |
Mady Mellor | 95d743c | 2017-01-10 12:05:27 -0800 | [diff] [blame] | 462 | public void setGutsParent(NotificationGuts guts) { |
| 463 | mGutsContainer = guts; |
Mady Mellor | 87d7945 | 2017-01-10 11:52:52 -0800 | [diff] [blame] | 464 | } |
| 465 | |
| 466 | @Override |
Mady Mellor | 434180c | 2017-02-13 11:29:42 -0800 | [diff] [blame] | 467 | public boolean willBeRemoved() { |
Julia Reynolds | 437cdb1 | 2018-01-03 12:27:24 -0500 | [diff] [blame] | 468 | return hasImportanceChanged(); |
Mady Mellor | 434180c | 2017-02-13 11:29:42 -0800 | [diff] [blame] | 469 | } |
| 470 | |
| 471 | @Override |
Mady Mellor | 87d7945 | 2017-01-10 11:52:52 -0800 | [diff] [blame] | 472 | public View getContentView() { |
| 473 | return this; |
| 474 | } |
| 475 | |
| 476 | @Override |
Mady Mellor | c2dbe49 | 2017-03-30 13:22:03 -0700 | [diff] [blame] | 477 | public boolean handleCloseControls(boolean save, boolean force) { |
Julia Reynolds | c65656a | 2018-02-12 09:55:14 -0500 | [diff] [blame] | 478 | // Save regardless of the importance so we can lock the importance field if the user wants |
| 479 | // to keep getting notifications |
| 480 | if (save) { |
Rohan Shah | ca0447e | 2018-03-30 15:18:27 -0700 | [diff] [blame] | 481 | saveImportance(); |
Geoffrey Pitsch | df44b60 | 2017-02-03 13:31:50 -0500 | [diff] [blame] | 482 | } |
Mady Mellor | 87d7945 | 2017-01-10 11:52:52 -0800 | [diff] [blame] | 483 | return false; |
| 484 | } |
Mady Mellor | e09fb70 | 2017-03-30 13:23:29 -0700 | [diff] [blame] | 485 | |
| 486 | @Override |
| 487 | public int getActualHeight() { |
| 488 | return getHeight(); |
| 489 | } |
Rohan Shah | ca0447e | 2018-03-30 15:18:27 -0700 | [diff] [blame] | 490 | |
| 491 | /** |
| 492 | * Runnable to either update the given channel (with a new importance value) or, if no channel |
| 493 | * is provided, update notifications enabled state for the package. |
| 494 | */ |
| 495 | private static class UpdateImportanceRunnable implements Runnable { |
| 496 | private final INotificationManager mINotificationManager; |
| 497 | private final String mPackageName; |
| 498 | private final int mAppUid; |
| 499 | private final @Nullable NotificationChannel mChannelToUpdate; |
| 500 | private final int mCurrentImportance; |
| 501 | private final int mNewImportance; |
| 502 | |
| 503 | |
| 504 | public UpdateImportanceRunnable(INotificationManager notificationManager, |
| 505 | String packageName, int appUid, @Nullable NotificationChannel channelToUpdate, |
| 506 | int currentImportance, int newImportance) { |
| 507 | mINotificationManager = notificationManager; |
| 508 | mPackageName = packageName; |
| 509 | mAppUid = appUid; |
| 510 | mChannelToUpdate = channelToUpdate; |
| 511 | mCurrentImportance = currentImportance; |
| 512 | mNewImportance = newImportance; |
| 513 | } |
| 514 | |
| 515 | @Override |
| 516 | public void run() { |
| 517 | try { |
| 518 | if (mChannelToUpdate != null) { |
| 519 | mChannelToUpdate.setImportance(mNewImportance); |
| 520 | mChannelToUpdate.lockFields(NotificationChannel.USER_LOCKED_IMPORTANCE); |
| 521 | mINotificationManager.updateNotificationChannelForPackage( |
| 522 | mPackageName, mAppUid, mChannelToUpdate); |
| 523 | } else { |
| 524 | // For notifications with more than one channel, update notification enabled |
| 525 | // state. If the importance was lowered, we disable notifications. |
Rohan Shah | 590e1b2 | 2018-04-10 23:48:47 -0400 | [diff] [blame^] | 526 | mINotificationManager.setNotificationsEnabledWithImportanceLockForPackage( |
Rohan Shah | ca0447e | 2018-03-30 15:18:27 -0700 | [diff] [blame] | 527 | mPackageName, mAppUid, mNewImportance >= mCurrentImportance); |
| 528 | } |
| 529 | } catch (RemoteException e) { |
| 530 | Log.e(TAG, "Unable to update notification importance", e); |
| 531 | } |
| 532 | } |
| 533 | } |
Mady Mellor | 87d7945 | 2017-01-10 11:52:52 -0800 | [diff] [blame] | 534 | } |