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

Commit 95423a90 authored by Sarah Chin's avatar Sarah Chin
Browse files

Create getSystemSelectionChannel API

Test: atest TelephonyManagerTest
Bug: 152813408
Change-Id: I7261a14cc9783409764e4c1f2f2fa6abcf32f50e
Merged-In: I7261a14cc9783409764e4c1f2f2fa6abcf32f50e
parent bb424290
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -2501,6 +2501,13 @@ public interface CommandsInterface {
    default void setSystemSelectionChannels(@NonNull List<RadioAccessSpecifier> specifiers,
            Message onComplete) {}

    /**
     * Get which bands the modem's background scan is acting on.
     *
     * @param onComplete a message to send when complete.
     */
    default void getSystemSelectionChannels(Message onComplete) {}

    /**
     * Whether uicc applications are enabled or not.
     *
+9 −0
Original line number Diff line number Diff line
@@ -2570,6 +2570,15 @@ public abstract class Phone extends Handler implements PhoneInternalInterface {
        mCi.setSystemSelectionChannels(specifiers, response);
    }

    /**
     * Get which bands the modem's background scan is acting on.
     *
     * @param response Callback message.
     */
    public void getSystemSelectionChannels(Message response) {
        mCi.getSystemSelectionChannels(response);
    }

    public void notifyDataActivity() {
        mNotifier.notifyDataActivity(this);
    }
+33 −0
Original line number Diff line number Diff line
@@ -1219,6 +1219,39 @@ public class RIL extends BaseCommands implements CommandsInterface {
        }
    }

    @Override
    public void getSystemSelectionChannels(Message onComplete) {
        IRadio radioProxy = getRadioProxy(onComplete);
        if (mRadioVersion.less(RADIO_HAL_VERSION_1_6)) {
            if (RILJ_LOGV) riljLog("getSystemSelectionChannels: not supported.");
            if (onComplete != null) {
                AsyncResult.forMessage(onComplete, null,
                        CommandException.fromRilErrno(REQUEST_NOT_SUPPORTED));
                onComplete.sendToTarget();
            }
            return;
        }

        RILRequest rr = obtainRequest(RIL_REQUEST_SET_SYSTEM_SELECTION_CHANNELS, onComplete,
                mRILDefaultWorkSource);

        android.hardware.radio.V1_6.IRadio radioProxy16 =
                (android.hardware.radio.V1_6.IRadio) radioProxy;

        if (radioProxy16 != null) {
            if (RILJ_LOGD) {
                riljLog(rr.serialString() + "> " + requestToString(rr.mRequest)
                        + " getSystemSelectionChannels");
            }

            try {
                radioProxy16.getSystemSelectionChannels(rr.mSerial);
            } catch (RemoteException | RuntimeException e) {
                handleRadioProxyExceptionForRR(rr, "getSystemSelectionChannels", e);
            }
        }
    }

    @Override
    public void getModemStatus(Message result) {
        IRadio radioProxy = getRadioProxy(result);
+9 −0
Original line number Diff line number Diff line
@@ -2830,6 +2830,15 @@ public class RadioResponse extends IRadioResponse.Stub {
        responseVoid(info);
    }


    /**
     * @param info Response info struct containing response type, serial no. and error.
     */
    public void getSystemSelectionChannelsResponse(
            android.hardware.radio.V1_6.RadioResponseInfo info) {
        responseVoid_1_6(info);
    }

    /**
     * @param responseInfo Response info struct containing response type, serial no. and error.
     * @param cellIdentity CellIdentity for the barringInfos.