Reorganize notification Settings classes
The notification package was getting too big. Test: make -j64 RunSettingsRoboTests Fixes: 145224451 Change-Id: I25ba82f42f7a137d8adcce72dcf8089d0e018bdc
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
package com.android.settings.notification.zen;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.UserHandle;
|
||||
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.notification.NotificationBackend;
|
||||
import com.android.settingslib.core.lifecycle.Lifecycle;
|
||||
|
||||
public class ZenModeBypassingAppsPreferenceController extends AbstractZenModePreferenceController {
|
||||
|
||||
protected static final String KEY = "zen_mode_bypassing_apps";
|
||||
private NotificationBackend mNotificationBackend = new NotificationBackend();
|
||||
|
||||
public ZenModeBypassingAppsPreferenceController(Context context, Lifecycle lifecycle) {
|
||||
super(context, KEY, lifecycle);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAvailable() {
|
||||
return mNotificationBackend.getNumAppsBypassingDnd(UserHandle.getCallingUserId()) != 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSummary() {
|
||||
final int channelsBypassing =
|
||||
mNotificationBackend.getNumAppsBypassingDnd(UserHandle.getCallingUserId());
|
||||
return mContext.getResources().getQuantityString(R.plurals.zen_mode_bypassing_apps_subtext,
|
||||
channelsBypassing, channelsBypassing);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user