xref: /aosp_15_r20/frameworks/base/packages/SettingsLib/src/com/android/settingslib/MobileNetworkTypeIcon.kt (revision d57664e9bc4670b3ecf6748a746a57c557b6bc9e)
1 /*
2  * Copyright (C) 2022 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.settingslib
18 
19 import androidx.annotation.DrawableRes
20 import androidx.annotation.StringRes
21 
22 /**
23  * A specification for the icon displaying the mobile network type -- 4G, 5G, LTE, etc. (aka "RAT
24  * icon" or "data type icon"). This is *not* the signal strength triangle.
25  *
26  * This is intended to eventually replace [SignalIcon.MobileIconGroup]. But for now,
27  * [MobileNetworkTypeIcons] just reads from the existing set of [SignalIcon.MobileIconGroup]
28  * instances to not duplicate data.
29  *
30  * TODO(b/238425913): Remove [SignalIcon.MobileIconGroup] and replace it with this class so that we
31  *   don't need to fill in the superfluous fields from its parent [SignalIcon.IconGroup] class. Then
32  *   this class can become either a sealed class or an enum with parameters.
33  */
34 data class MobileNetworkTypeIcon(
35     /** A human-readable name for this network type, used for logging. */
36     val name: String,
37 
38     /** The resource ID of the icon drawable to use. */
39     @DrawableRes val iconResId: Int,
40 
41     /** The resource ID of the content description to use. */
42     @StringRes val contentDescriptionResId: Int,
43 )
44