1 package com.android.systemui.plugins.clocks 2 3 import android.provider.Settings.Global.ZEN_MODE_ALARMS 4 import android.provider.Settings.Global.ZEN_MODE_IMPORTANT_INTERRUPTIONS 5 import android.provider.Settings.Global.ZEN_MODE_NO_INTERRUPTIONS 6 import android.provider.Settings.Global.ZEN_MODE_OFF 7 8 data class ZenData( 9 val zenMode: ZenMode, 10 val descriptionId: String?, 11 ) { 12 enum class ZenMode(val zenMode: Int) { 13 OFF(ZEN_MODE_OFF), 14 IMPORTANT_INTERRUPTIONS(ZEN_MODE_IMPORTANT_INTERRUPTIONS), 15 NO_INTERRUPTIONS(ZEN_MODE_NO_INTERRUPTIONS), 16 ALARMS(ZEN_MODE_ALARMS); 17 18 companion object { <lambda>null19 fun fromInt(zenMode: Int) = values().firstOrNull { it.zenMode == zenMode } 20 } 21 } 22 } 23