Change API requestIsEnabled to requestIsSessionStarted

- Avoid using APM/WIFI/BT in settings app from any transitioning from TN to NTN.

Flag: EXEMPT bugfix
fix: 354806125
Test: Manual test
Change-Id: Id65567971b3d1ea3e177a0cc1e1304446d8fa0e8
This commit is contained in:
tomhsu
2024-07-12 03:59:19 +00:00
committed by Tom Hsu
parent bbd5d8885e
commit b091995671
3 changed files with 4 additions and 3 deletions

View File

@@ -132,7 +132,7 @@ public final class BluetoothEnabler implements SwitchWidgetController.OnSwitchCh
new Thread(() -> { new Thread(() -> {
try { try {
mIsSatelliteOn.set(mSatelliteRepository.requestIsEnabled( mIsSatelliteOn.set(mSatelliteRepository.requestIsSessionStarted(
Executors.newSingleThreadExecutor()).get(3000, TimeUnit.MILLISECONDS)); Executors.newSingleThreadExecutor()).get(3000, TimeUnit.MILLISECONDS));
} catch (InterruptedException | ExecutionException | TimeoutException e) { } catch (InterruptedException | ExecutionException | TimeoutException e) {
Log.e(TAG, "Error to get satellite status : " + e); Log.e(TAG, "Error to get satellite status : " + e);

View File

@@ -162,7 +162,8 @@ public class AirplaneModePreferenceController extends TogglePreferenceController
public void onResume() { public void onResume() {
try { try {
mIsSatelliteOn.set( mIsSatelliteOn.set(
mSatelliteRepository.requestIsEnabled(Executors.newSingleThreadExecutor()) mSatelliteRepository
.requestIsSessionStarted(Executors.newSingleThreadExecutor())
.get(2000, TimeUnit.MILLISECONDS)); .get(2000, TimeUnit.MILLISECONDS));
} catch (ExecutionException | TimeoutException | InterruptedException e) { } catch (ExecutionException | TimeoutException | InterruptedException e) {
Log.e(TAG, "Error to get satellite status : " + e); Log.e(TAG, "Error to get satellite status : " + e);

View File

@@ -431,7 +431,7 @@ public class WifiSlice implements CustomSliceable {
boolean isSatelliteOn = false; boolean isSatelliteOn = false;
try { try {
isSatelliteOn = isSatelliteOn =
satelliteRepository.requestIsEnabled(Executors.newSingleThreadExecutor()) satelliteRepository.requestIsSessionStarted(Executors.newSingleThreadExecutor())
.get(2000, TimeUnit.MILLISECONDS); .get(2000, TimeUnit.MILLISECONDS);
} catch (ExecutionException | TimeoutException | InterruptedException e) { } catch (ExecutionException | TimeoutException | InterruptedException e) {
Log.e(TAG, "Error to get satellite status : " + e); Log.e(TAG, "Error to get satellite status : " + e);