Loading res/values/strings.xml +4 −0 Original line number Diff line number Diff line Loading @@ -8685,4 +8685,8 @@ <!-- Title for the installed app info storage page. The total storage space taken up by this app. [CHAR LIMIT=40]--> <string name="app_info_storage_title">Space used</string> <!-- The divider symbol between different parts of the notification header including spaces. not translatable [CHAR LIMIT=3] --> <string name="notification_header_divider_symbol_with_spaces" translatable="false">" • "</string> </resources> src/com/android/settings/notification/ChannelNotificationSettings.java +45 −6 Original line number Diff line number Diff line Loading @@ -22,15 +22,17 @@ import static android.app.NotificationManager.IMPORTANCE_UNSPECIFIED; import android.app.Activity; import android.app.NotificationChannel; import android.app.NotificationChannelGroup; import android.app.NotificationManager; import android.content.Intent; import android.content.pm.UserInfo; import android.net.Uri; import android.os.Bundle; import android.os.UserHandle; import android.os.AsyncTask; import android.provider.Settings; import android.support.v7.preference.Preference; import android.text.TextUtils; import android.text.BidiFormatter; import android.text.SpannableStringBuilder; import android.util.ArrayMap; import android.util.Log; import android.view.LayoutInflater; Loading @@ -38,7 +40,6 @@ import android.view.View; import android.widget.Switch; import com.android.internal.logging.nano.MetricsProto.MetricsEvent; import com.android.internal.widget.LockPatternUtils; import com.android.settings.AppHeader; import com.android.settings.R; import com.android.settings.RingtonePreference; Loading @@ -64,6 +65,8 @@ public class ChannelNotificationSettings extends NotificationSettingsBase { private RestrictedSwitchPreference mVibrate; private NotificationSoundPreference mRingtone; private FooterPreference mFooter; private NotificationChannelGroup mChannelGroup; private AppHeaderController mHeaderPref; @Override public int getMetricsCategory() { Loading Loading @@ -93,6 +96,27 @@ public class ChannelNotificationSettings extends NotificationSettingsBase { mShowLegacyChannelConfig = true; } else { populateUpgradedChannelPrefs(); if (mChannel.getGroup() != null) { // Go look up group name new AsyncTask<Void, Void, Void>() { @Override protected Void doInBackground(Void... unused) { if (mChannel.getGroup() != null) { mChannelGroup = mBackend.getGroup(mChannel.getGroup(), mPkg, mUid); } return null; } @Override protected void onPostExecute(Void unused) { if (getHost() == null || mChannelGroup == null) { return; } setChannelGroupLabel(mChannelGroup.getName()); } }.execute(); } } updateDependents(mChannel.getImportance() == IMPORTANCE_NONE); Loading @@ -114,9 +138,10 @@ public class ChannelNotificationSettings extends NotificationSettingsBase { rows.put(mAppRow.pkg, mAppRow); collectConfigActivities(rows); final Activity activity = getActivity(); final Preference pref = FeatureFactory.getFactory(activity) mHeaderPref = FeatureFactory.getFactory(activity) .getApplicationFeatureProvider(activity) .newAppHeaderController(this /* fragment */, null /* appHeader */) .newAppHeaderController(this /* fragment */, null /* appHeader */); final Preference pref = mHeaderPref .setIcon(mAppRow.icon) .setLabel(mChannel.getName()) .setSummary(mAppRow.label) Loading @@ -128,6 +153,20 @@ public class ChannelNotificationSettings extends NotificationSettingsBase { getPreferenceScreen().addPreference(pref); } private void setChannelGroupLabel(CharSequence groupName) { final SpannableStringBuilder summary = new SpannableStringBuilder(); BidiFormatter bidi = BidiFormatter.getInstance(); summary.append(bidi.unicodeWrap(mAppRow.label.toString())); if (groupName != null) { summary.append(bidi.unicodeWrap(mContext.getText( R.string.notification_header_divider_symbol_with_spaces))); summary.append(bidi.unicodeWrap(groupName.toString())); } final Activity activity = getActivity(); mHeaderPref.setSummary(summary.toString()); mHeaderPref.done(activity, getPrefContext()); } private void addFooterPref() { if (!TextUtils.isEmpty(mChannel.getDescription())) { FooterPreference descPref = new FooterPreference(getPrefContext()); Loading src/com/android/settings/notification/NotificationBackend.java +13 −0 Original line number Diff line number Diff line Loading @@ -122,6 +122,19 @@ public class NotificationBackend { } } public NotificationChannelGroup getGroup(String groupId, String pkg, int uid) { if (groupId == null) { return null; } try { return sINM.getNotificationChannelGroupForPackage(groupId, pkg, uid); } catch (Exception e) { Log.w(TAG, "Error calling NoMan", e); return null; } } public ParceledListSlice<NotificationChannelGroup> getChannelGroups(String pkg, int uid) { try { return sINM.getNotificationChannelGroupsForPackage(pkg, uid, false); Loading Loading
res/values/strings.xml +4 −0 Original line number Diff line number Diff line Loading @@ -8685,4 +8685,8 @@ <!-- Title for the installed app info storage page. The total storage space taken up by this app. [CHAR LIMIT=40]--> <string name="app_info_storage_title">Space used</string> <!-- The divider symbol between different parts of the notification header including spaces. not translatable [CHAR LIMIT=3] --> <string name="notification_header_divider_symbol_with_spaces" translatable="false">" • "</string> </resources>
src/com/android/settings/notification/ChannelNotificationSettings.java +45 −6 Original line number Diff line number Diff line Loading @@ -22,15 +22,17 @@ import static android.app.NotificationManager.IMPORTANCE_UNSPECIFIED; import android.app.Activity; import android.app.NotificationChannel; import android.app.NotificationChannelGroup; import android.app.NotificationManager; import android.content.Intent; import android.content.pm.UserInfo; import android.net.Uri; import android.os.Bundle; import android.os.UserHandle; import android.os.AsyncTask; import android.provider.Settings; import android.support.v7.preference.Preference; import android.text.TextUtils; import android.text.BidiFormatter; import android.text.SpannableStringBuilder; import android.util.ArrayMap; import android.util.Log; import android.view.LayoutInflater; Loading @@ -38,7 +40,6 @@ import android.view.View; import android.widget.Switch; import com.android.internal.logging.nano.MetricsProto.MetricsEvent; import com.android.internal.widget.LockPatternUtils; import com.android.settings.AppHeader; import com.android.settings.R; import com.android.settings.RingtonePreference; Loading @@ -64,6 +65,8 @@ public class ChannelNotificationSettings extends NotificationSettingsBase { private RestrictedSwitchPreference mVibrate; private NotificationSoundPreference mRingtone; private FooterPreference mFooter; private NotificationChannelGroup mChannelGroup; private AppHeaderController mHeaderPref; @Override public int getMetricsCategory() { Loading Loading @@ -93,6 +96,27 @@ public class ChannelNotificationSettings extends NotificationSettingsBase { mShowLegacyChannelConfig = true; } else { populateUpgradedChannelPrefs(); if (mChannel.getGroup() != null) { // Go look up group name new AsyncTask<Void, Void, Void>() { @Override protected Void doInBackground(Void... unused) { if (mChannel.getGroup() != null) { mChannelGroup = mBackend.getGroup(mChannel.getGroup(), mPkg, mUid); } return null; } @Override protected void onPostExecute(Void unused) { if (getHost() == null || mChannelGroup == null) { return; } setChannelGroupLabel(mChannelGroup.getName()); } }.execute(); } } updateDependents(mChannel.getImportance() == IMPORTANCE_NONE); Loading @@ -114,9 +138,10 @@ public class ChannelNotificationSettings extends NotificationSettingsBase { rows.put(mAppRow.pkg, mAppRow); collectConfigActivities(rows); final Activity activity = getActivity(); final Preference pref = FeatureFactory.getFactory(activity) mHeaderPref = FeatureFactory.getFactory(activity) .getApplicationFeatureProvider(activity) .newAppHeaderController(this /* fragment */, null /* appHeader */) .newAppHeaderController(this /* fragment */, null /* appHeader */); final Preference pref = mHeaderPref .setIcon(mAppRow.icon) .setLabel(mChannel.getName()) .setSummary(mAppRow.label) Loading @@ -128,6 +153,20 @@ public class ChannelNotificationSettings extends NotificationSettingsBase { getPreferenceScreen().addPreference(pref); } private void setChannelGroupLabel(CharSequence groupName) { final SpannableStringBuilder summary = new SpannableStringBuilder(); BidiFormatter bidi = BidiFormatter.getInstance(); summary.append(bidi.unicodeWrap(mAppRow.label.toString())); if (groupName != null) { summary.append(bidi.unicodeWrap(mContext.getText( R.string.notification_header_divider_symbol_with_spaces))); summary.append(bidi.unicodeWrap(groupName.toString())); } final Activity activity = getActivity(); mHeaderPref.setSummary(summary.toString()); mHeaderPref.done(activity, getPrefContext()); } private void addFooterPref() { if (!TextUtils.isEmpty(mChannel.getDescription())) { FooterPreference descPref = new FooterPreference(getPrefContext()); Loading
src/com/android/settings/notification/NotificationBackend.java +13 −0 Original line number Diff line number Diff line Loading @@ -122,6 +122,19 @@ public class NotificationBackend { } } public NotificationChannelGroup getGroup(String groupId, String pkg, int uid) { if (groupId == null) { return null; } try { return sINM.getNotificationChannelGroupForPackage(groupId, pkg, uid); } catch (Exception e) { Log.w(TAG, "Error calling NoMan", e); return null; } } public ParceledListSlice<NotificationChannelGroup> getChannelGroups(String pkg, int uid) { try { return sINM.getNotificationChannelGroupsForPackage(pkg, uid, false); Loading