1 /* 2 * Copyright (C) 2021 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 17 package com.android.permissioncontroller.safetycenter.ui; 18 19 import com.android.permissioncontroller.R; 20 21 /** A severity level used for Safety Center entries and warnings. */ 22 enum SeverityLevel { 23 24 SEVERITY_LEVEL_UNKNOWN( 25 R.drawable.ic_safety_empty, 26 R.drawable.ic_safety_empty 27 ), 28 NONE( 29 R.drawable.ic_safety_null_state, 30 R.drawable.ic_safety_null_state 31 ), 32 INFORMATION( 33 R.drawable.ic_safety_info, 34 R.drawable.ic_safety_info_outline 35 ), 36 RECOMMENDATION( 37 R.drawable.ic_safety_recommendation, 38 R.drawable.ic_safety_recommendation_outline 39 ), 40 CRITICAL_WARNING( 41 R.drawable.ic_safety_warn, 42 R.drawable.ic_safety_warn_outline 43 ); 44 45 private final int mEntryIconResId; 46 private final int mWarningCardIconResId; 47 SeverityLevel(int entryIconResId, int warningCardIconResId)48 SeverityLevel(int entryIconResId, int warningCardIconResId) { 49 mEntryIconResId = entryIconResId; 50 mWarningCardIconResId = warningCardIconResId; 51 } 52 53 /** Returns the res id of the icon that should be used for a safety entry of this severity. */ getEntryIconResId()54 public int getEntryIconResId() { 55 return mEntryIconResId; 56 } 57 58 /** Returns the res id of the icon that should be used for a warning card of this severity. */ getWarningCardIconResId()59 public int getWarningCardIconResId() { 60 return mWarningCardIconResId; 61 } 62 63 } 64