Disable SIM On/Off operation when device is in Satellite Enabled Mode

Cherry-picking ag/26965536 into the 24D1-dev branch caused conflicts. Therefore, manually create this CL to migrate the MobileNetworkSwitchController to Kotlin and utilize Compose.

Bug: 315928920
Test: atest, manual
Change-Id: I215b5a4615a3b3da6fc160f76c85c814210cc3ef
Merged-In: I7aaaf43b4c449129197e7cc92565d274ffdd2d8c
This commit is contained in:
Samuel Huang
2024-04-16 08:42:08 +00:00
parent 67df73a1fd
commit 316e7bf3e6
13 changed files with 603 additions and 543 deletions

View File

@@ -29,7 +29,7 @@ import android.util.Log;
import androidx.annotation.Nullable;
import com.android.settings.R;
import com.android.settings.network.SatelliteManagerUtil;
import com.android.settings.network.SatelliteRepository;
import com.google.common.util.concurrent.ListenableFuture;
@@ -58,8 +58,8 @@ public class SimSlotChangeReceiver extends BroadcastReceiver {
if (shouldHandleSlotChange(context)) {
Log.d(TAG, "Checking satellite enabled status");
Executor executor = Executors.newSingleThreadExecutor();
ListenableFuture<Boolean> satelliteEnabledFuture = SatelliteManagerUtil
.requestIsEnabled(context, executor);
ListenableFuture<Boolean> satelliteEnabledFuture = new SatelliteRepository(context)
.requestIsEnabled(executor);
satelliteEnabledFuture.addListener(() -> {
boolean isSatelliteEnabled = false;
try {