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

Bug: 315928920
Test: atest, manual
Change-Id: I7aaaf43b4c449129197e7cc92565d274ffdd2d8c
This commit is contained in:
Samuel Huang
2024-04-15 12:31:17 +00:00
parent be60d166eb
commit cbf5154291
5 changed files with 206 additions and 79 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 {