• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2023 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.systemui.statusbar.pipeline.satellite.data
18 
19 import com.android.systemui.statusbar.pipeline.satellite.shared.model.SatelliteConnectionState
20 import kotlinx.coroutines.flow.StateFlow
21 
22 /**
23  * Device-based satellite refers to the capability of a device to connect directly to a satellite
24  * network. This is in contrast to carrier-based satellite connectivity, which is a property of a
25  * given mobile data subscription.
26  */
27 interface DeviceBasedSatelliteRepository {
28     /** The current status of satellite provisioning. If not false, we don't want to show an icon */
29     val isSatelliteProvisioned: StateFlow<Boolean>
30 
31     /** See [SatelliteConnectionState] for available states */
32     val connectionState: StateFlow<SatelliteConnectionState>
33 
34     /** 0-4 level (similar to wifi and mobile) */
35     // @IntRange(from = 0, to = 4)
36     val signalStrength: StateFlow<Int>
37 
38     /** Clients must observe this property, as device-based satellite is location-dependent */
39     val isSatelliteAllowedForCurrentLocation: StateFlow<Boolean>
40 
41     /** When enabled, a satellite icon will display when all other connections are OOS */
42     val isOpportunisticSatelliteIconEnabled: Boolean
43 }
44 
45 /**
46  * A no-op interface used for Dagger bindings.
47  *
48  * [DeviceBasedSatelliteRepositorySwitcher] needs to inject both the real repository and the demo
49  * mode repository, both of which implement the [DeviceBasedSatelliteRepository] interface. To help
50  * distinguish the two for the switcher, [DeviceBasedSatelliteRepositoryImpl] will implement this
51  * [RealDeviceBasedSatelliteRepository] interface.
52  */
53 interface RealDeviceBasedSatelliteRepository : DeviceBasedSatelliteRepository
54