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

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

Merge "requestSatelliteCapabilities" into main

parents f98d141b 3323f800
Loading
Loading
Loading
Loading
+25 −0
Original line number Diff line number Diff line
@@ -329,6 +329,7 @@ public class SatelliteController extends Handler {
    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;
    private static final int REQUEST_SATELLITE_CAPABILITIES = 71;

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

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

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

        handleRequestSatelliteCapabilities(result);
    }

    private void handleRequestSatelliteCapabilities(@NonNull ResultReceiver result) {
        plogd("handleRequestSatelliteCapabilities");
        int error = evaluateOemSatelliteRequestAllowed(false);
        if (error != SATELLITE_RESULT_SUCCESS) {
            result.send(error, null);