Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b3b31fcf authored by Aishwarya Mallampati's avatar Aishwarya Mallampati Committed by Android (Google) Code Review
Browse files

Merge "requestIsSatelliteSupported - send request to handler immediately" into main

parents c487e577 2c423e58
Loading
Loading
Loading
Loading
+25 −0
Original line number Diff line number Diff line
@@ -328,6 +328,7 @@ public class SatelliteController extends Handler {
    private static final int REQUEST_IS_SATELLITE_ENABLED = 67;
    private static final int REQUEST_IS_DEMO_MODE_ENABLED = 68;
    private static final int REQUEST_IS_EMERGENCY_MODE_ENABLED = 69;
    private static final int REQUEST_IS_SATELLITE_SUPPORTED = 70;

    @NonNull private static SatelliteController sInstance;
    @NonNull private final Context mContext;
@@ -2376,6 +2377,18 @@ public class SatelliteController extends Handler {
                break;
            }

            case REQUEST_IS_SATELLITE_SUPPORTED: {
                plogd("REQUEST_IS_SATELLITE_SUPPORTED");
                SomeArgs args = (SomeArgs) msg.obj;
                ResultReceiver result = (ResultReceiver) args.arg1;
                try {
                    handleRequestIsSatelliteSupported(result);
                } finally {
                    args.recycle();
                }
                break;
            }

            default:
                Log.w(TAG, "SatelliteControllerHandler: unexpected message code: " +
                        msg.what);
@@ -2918,6 +2931,18 @@ public class SatelliteController extends Handler {
     *               the device if the request is successful or an error code if the request failed.
     */
    public void requestIsSatelliteSupported(@NonNull ResultReceiver result) {
        if (mFeatureFlags.satelliteImproveMultiThreadDesign()) {
            SomeArgs args = SomeArgs.obtain();
            args.arg1 = result;
            sendMessage(obtainMessage(REQUEST_IS_SATELLITE_SUPPORTED, args));
            return;
        }

        handleRequestIsSatelliteSupported(result);
    }

    private void handleRequestIsSatelliteSupported(@NonNull ResultReceiver result) {
        plogd("handleRequestIsSatelliteSupported");
        int subId = getSelectedSatelliteSubId();
        Boolean isSatelliteSupported = getIsSatelliteSupported();
        if (isSatelliteSupported != null) {