Loading src/java/com/android/internal/telephony/BaseCommands.java +12 −0 Original line number Diff line number Diff line Loading @@ -72,6 +72,7 @@ public abstract class BaseCommands implements CommandsInterface { new RegistrantList(); protected RegistrantList mPcoDataRegistrants = new RegistrantList(); protected RegistrantList mCarrierInfoForImsiEncryptionRegistrants = new RegistrantList(); protected RegistrantList mRilNetworkScanResultRegistrants = new RegistrantList(); protected Registrant mGsmSmsRegistrant; Loading Loading @@ -730,6 +731,17 @@ public abstract class BaseCommands implements CommandsInterface { mHardwareConfigChangeRegistrants.remove(h); } @Override public void registerForNetworkScanResult(Handler h, int what, Object obj) { Registrant r = new Registrant(h, what, obj); mRilNetworkScanResultRegistrants.add(r); } @Override public void unregisterForNetworkScanResult(Handler h) { mRilNetworkScanResultRegistrants.remove(h); } /** * {@inheritDoc} */ Loading src/java/com/android/internal/telephony/CommandsInterface.java +35 −2 Original line number Diff line number Diff line Loading @@ -1288,8 +1288,25 @@ public interface CommandsInterface { */ void getAvailableNetworks(Message response); void getBasebandVersion (Message response); /** * Starts a radio network scan * * ((AsyncResult)response.obj).result is a NetworkScanResult object */ void startNetworkScan(Message response); /** * Stops the ongoing network scan * * ((AsyncResult)response.obj).result is a NetworkScanResult object * */ void stopNetworkScan(Message response); /** * Gets the baseband version */ void getBasebandVersion(Message response); /** * (AsyncResult)response.obj).result will be an Integer representing Loading Loading @@ -2102,6 +2119,22 @@ public interface CommandsInterface { */ void unregisterForCarrierInfoForImsiEncryption(Handler h); /** * Register for unsolicited Network Scan result. * * @param h Handler for notificaiton message. * @param what User-defined message code. * @param obj User object. */ void registerForNetworkScanResult(Handler h, int what, Object obj); /** * DeRegister for unsolicited Network Scan result. * * @param h Handler for notificaiton message. */ void unregisterForNetworkScanResult(Handler h); default public List<ClientRequestStats> getClientRequestStats() { return null; } Loading src/java/com/android/internal/telephony/GsmCdmaPhone.java +10 −0 Original line number Diff line number Diff line Loading @@ -1778,6 +1778,16 @@ public class GsmCdmaPhone extends Phone { } } @Override public void startNetworkScan(Message response) { mCi.startNetworkScan(response); } @Override public void stopNetworkScan(Message response) { mCi.stopNetworkScan(response); } @Override public void getNeighboringCids(Message response, WorkSource workSource) { if (isPhoneTypeGsm()) { Loading src/java/com/android/internal/telephony/PhoneInternalInterface.java +26 −16 Original line number Diff line number Diff line Loading @@ -16,32 +16,18 @@ package com.android.internal.telephony; import android.content.Context; import android.net.LinkProperties; import android.net.NetworkCapabilities; import android.os.Bundle; import android.os.Handler; import android.os.Message; import android.os.WorkSource; import android.os.ResultReceiver; import android.telephony.CellInfo; import android.telephony.CellLocation; import android.os.WorkSource; import android.telephony.CarrierConfigManager; import android.telephony.PhoneStateListener; import android.telephony.CellLocation; import android.telephony.ServiceState; import android.telephony.SignalStrength; import com.android.internal.telephony.imsphone.ImsPhone; import com.android.internal.telephony.RadioCapability; import com.android.internal.telephony.test.SimulatedRadioControl; import com.android.internal.telephony.uicc.IsimRecords; import com.android.internal.telephony.uicc.UiccCard; import com.android.internal.telephony.uicc.UsimServiceTable; import com.android.internal.telephony.PhoneConstants.*; // ???? import java.util.List; import java.util.Locale; /** * Internal interface used to control the phone; SDK developers cannot Loading Loading @@ -656,6 +642,30 @@ public interface PhoneInternalInterface { */ void getAvailableNetworks(Message response); /** * Start a network scan. This method is asynchronous; . * On completion, <code>response.obj</code> is set to an AsyncResult with * one of the following members:.<p> * <ul> * <li><code>response.obj.result</code> will be a <code>NetworkScanResult</code> object, or</li> * <li><code>response.obj.exception</code> will be set with an exception * on failure.</li> * </ul> */ void startNetworkScan(Message response); /** * Stop ongoing network scan. This method is asynchronous; . * On completion, <code>response.obj</code> is set to an AsyncResult with * one of the following members:.<p> * <ul> * <li><code>response.obj.result</code> will be a <code>NetworkScanResult</code> object, or</li> * <li><code>response.obj.exception</code> will be set with an exception * on failure.</li> * </ul> */ void stopNetworkScan(Message response); /** * Query neighboring cell IDs. <code>response</code> is dispatched when * this is complete. <code>response.obj</code> will be an AsyncResult, Loading src/java/com/android/internal/telephony/RIL.java +96 −0 Original line number Diff line number Diff line Loading @@ -69,14 +69,18 @@ import android.telephony.CellInfo; import android.telephony.ClientRequestStats; import android.telephony.ModemActivityInfo; import android.telephony.NeighboringCellInfo; import android.telephony.NetworkScanRequest; import android.telephony.PhoneNumberUtils; import android.telephony.RadioAccessFamily; import android.telephony.RadioAccessSpecifier; import android.telephony.RadioNetworkConstants.RadioAccessNetworks; import android.telephony.Rlog; import android.telephony.SignalStrength; import android.telephony.SmsManager; import android.telephony.TelephonyHistogram; import android.telephony.TelephonyManager; import android.text.TextUtils; import android.util.Log; import android.util.SparseArray; import com.android.internal.telephony.TelephonyProto.SmsSession; Loading Loading @@ -1773,6 +1777,98 @@ public final class RIL extends BaseCommands implements CommandsInterface { } } @Override public void startNetworkScan(Message result) { IRadio radioProxy = getRadioProxy(result); if (radioProxy != null) { android.hardware.radio.V1_1.IRadio radioProxy11 = android.hardware.radio.V1_1.IRadio.castFrom(radioProxy); if (radioProxy11 == null) { if (result != null) { AsyncResult.forMessage(result, null, CommandException.fromRilErrno(REQUEST_NOT_SUPPORTED)); result.sendToTarget(); } } else { NetworkScanRequest nsr = (NetworkScanRequest) result.obj; android.hardware.radio.V1_1.NetworkScanRequest request = new android.hardware.radio.V1_1.NetworkScanRequest(); request.type = nsr.scanType; request.interval = 60; for (RadioAccessSpecifier ras : nsr.specifiers) { android.hardware.radio.V1_1.RadioAccessSpecifier s = new android.hardware.radio.V1_1.RadioAccessSpecifier(); s.radioAccessNetwork = ras.radioAccessNetwork; List<Integer> bands = null; switch (ras.radioAccessNetwork) { case RadioAccessNetworks.GERAN: bands = s.geranBands; break; case RadioAccessNetworks.UTRAN: bands = s.utranBands; break; case RadioAccessNetworks.EUTRAN: bands = s.eutranBands; break; default: Log.wtf(RILJ_LOG_TAG, "radioAccessNetwork " + ras.radioAccessNetwork + " not supported!"); return; } for (int band : ras.bands) { bands.add(band); } for (int channel : ras.channels) { s.channels.add(channel); } request.specifiers.add(s); } RILRequest rr = obtainRequest(RIL_REQUEST_START_NETWORK_SCAN, result, mRILDefaultWorkSource); if (RILJ_LOGD) { riljLog(rr.serialString() + "> " + requestToString(rr.mRequest)); } try { radioProxy11.startNetworkScan(rr.mSerial, request); } catch (RemoteException | RuntimeException e) { handleRadioProxyExceptionForRR(rr, "startNetworkScan", e); } } } } @Override public void stopNetworkScan(Message result) { IRadio radioProxy = getRadioProxy(result); if (radioProxy != null) { android.hardware.radio.V1_1.IRadio radioProxy11 = android.hardware.radio.V1_1.IRadio.castFrom(radioProxy); if (radioProxy11 == null) { if (result != null) { AsyncResult.forMessage(result, null, CommandException.fromRilErrno(REQUEST_NOT_SUPPORTED)); result.sendToTarget(); } } else { RILRequest rr = obtainRequest(RIL_REQUEST_STOP_NETWORK_SCAN, result, mRILDefaultWorkSource); if (RILJ_LOGD) { riljLog(rr.serialString() + "> " + requestToString(rr.mRequest)); } try { radioProxy11.stopNetworkScan(rr.mSerial); } catch (RemoteException | RuntimeException e) { handleRadioProxyExceptionForRR(rr, "stopNetworkScan", e); } } } } @Override public void startDtmf(char c, Message result) { IRadio radioProxy = getRadioProxy(result); Loading Loading
src/java/com/android/internal/telephony/BaseCommands.java +12 −0 Original line number Diff line number Diff line Loading @@ -72,6 +72,7 @@ public abstract class BaseCommands implements CommandsInterface { new RegistrantList(); protected RegistrantList mPcoDataRegistrants = new RegistrantList(); protected RegistrantList mCarrierInfoForImsiEncryptionRegistrants = new RegistrantList(); protected RegistrantList mRilNetworkScanResultRegistrants = new RegistrantList(); protected Registrant mGsmSmsRegistrant; Loading Loading @@ -730,6 +731,17 @@ public abstract class BaseCommands implements CommandsInterface { mHardwareConfigChangeRegistrants.remove(h); } @Override public void registerForNetworkScanResult(Handler h, int what, Object obj) { Registrant r = new Registrant(h, what, obj); mRilNetworkScanResultRegistrants.add(r); } @Override public void unregisterForNetworkScanResult(Handler h) { mRilNetworkScanResultRegistrants.remove(h); } /** * {@inheritDoc} */ Loading
src/java/com/android/internal/telephony/CommandsInterface.java +35 −2 Original line number Diff line number Diff line Loading @@ -1288,8 +1288,25 @@ public interface CommandsInterface { */ void getAvailableNetworks(Message response); void getBasebandVersion (Message response); /** * Starts a radio network scan * * ((AsyncResult)response.obj).result is a NetworkScanResult object */ void startNetworkScan(Message response); /** * Stops the ongoing network scan * * ((AsyncResult)response.obj).result is a NetworkScanResult object * */ void stopNetworkScan(Message response); /** * Gets the baseband version */ void getBasebandVersion(Message response); /** * (AsyncResult)response.obj).result will be an Integer representing Loading Loading @@ -2102,6 +2119,22 @@ public interface CommandsInterface { */ void unregisterForCarrierInfoForImsiEncryption(Handler h); /** * Register for unsolicited Network Scan result. * * @param h Handler for notificaiton message. * @param what User-defined message code. * @param obj User object. */ void registerForNetworkScanResult(Handler h, int what, Object obj); /** * DeRegister for unsolicited Network Scan result. * * @param h Handler for notificaiton message. */ void unregisterForNetworkScanResult(Handler h); default public List<ClientRequestStats> getClientRequestStats() { return null; } Loading
src/java/com/android/internal/telephony/GsmCdmaPhone.java +10 −0 Original line number Diff line number Diff line Loading @@ -1778,6 +1778,16 @@ public class GsmCdmaPhone extends Phone { } } @Override public void startNetworkScan(Message response) { mCi.startNetworkScan(response); } @Override public void stopNetworkScan(Message response) { mCi.stopNetworkScan(response); } @Override public void getNeighboringCids(Message response, WorkSource workSource) { if (isPhoneTypeGsm()) { Loading
src/java/com/android/internal/telephony/PhoneInternalInterface.java +26 −16 Original line number Diff line number Diff line Loading @@ -16,32 +16,18 @@ package com.android.internal.telephony; import android.content.Context; import android.net.LinkProperties; import android.net.NetworkCapabilities; import android.os.Bundle; import android.os.Handler; import android.os.Message; import android.os.WorkSource; import android.os.ResultReceiver; import android.telephony.CellInfo; import android.telephony.CellLocation; import android.os.WorkSource; import android.telephony.CarrierConfigManager; import android.telephony.PhoneStateListener; import android.telephony.CellLocation; import android.telephony.ServiceState; import android.telephony.SignalStrength; import com.android.internal.telephony.imsphone.ImsPhone; import com.android.internal.telephony.RadioCapability; import com.android.internal.telephony.test.SimulatedRadioControl; import com.android.internal.telephony.uicc.IsimRecords; import com.android.internal.telephony.uicc.UiccCard; import com.android.internal.telephony.uicc.UsimServiceTable; import com.android.internal.telephony.PhoneConstants.*; // ???? import java.util.List; import java.util.Locale; /** * Internal interface used to control the phone; SDK developers cannot Loading Loading @@ -656,6 +642,30 @@ public interface PhoneInternalInterface { */ void getAvailableNetworks(Message response); /** * Start a network scan. This method is asynchronous; . * On completion, <code>response.obj</code> is set to an AsyncResult with * one of the following members:.<p> * <ul> * <li><code>response.obj.result</code> will be a <code>NetworkScanResult</code> object, or</li> * <li><code>response.obj.exception</code> will be set with an exception * on failure.</li> * </ul> */ void startNetworkScan(Message response); /** * Stop ongoing network scan. This method is asynchronous; . * On completion, <code>response.obj</code> is set to an AsyncResult with * one of the following members:.<p> * <ul> * <li><code>response.obj.result</code> will be a <code>NetworkScanResult</code> object, or</li> * <li><code>response.obj.exception</code> will be set with an exception * on failure.</li> * </ul> */ void stopNetworkScan(Message response); /** * Query neighboring cell IDs. <code>response</code> is dispatched when * this is complete. <code>response.obj</code> will be an AsyncResult, Loading
src/java/com/android/internal/telephony/RIL.java +96 −0 Original line number Diff line number Diff line Loading @@ -69,14 +69,18 @@ import android.telephony.CellInfo; import android.telephony.ClientRequestStats; import android.telephony.ModemActivityInfo; import android.telephony.NeighboringCellInfo; import android.telephony.NetworkScanRequest; import android.telephony.PhoneNumberUtils; import android.telephony.RadioAccessFamily; import android.telephony.RadioAccessSpecifier; import android.telephony.RadioNetworkConstants.RadioAccessNetworks; import android.telephony.Rlog; import android.telephony.SignalStrength; import android.telephony.SmsManager; import android.telephony.TelephonyHistogram; import android.telephony.TelephonyManager; import android.text.TextUtils; import android.util.Log; import android.util.SparseArray; import com.android.internal.telephony.TelephonyProto.SmsSession; Loading Loading @@ -1773,6 +1777,98 @@ public final class RIL extends BaseCommands implements CommandsInterface { } } @Override public void startNetworkScan(Message result) { IRadio radioProxy = getRadioProxy(result); if (radioProxy != null) { android.hardware.radio.V1_1.IRadio radioProxy11 = android.hardware.radio.V1_1.IRadio.castFrom(radioProxy); if (radioProxy11 == null) { if (result != null) { AsyncResult.forMessage(result, null, CommandException.fromRilErrno(REQUEST_NOT_SUPPORTED)); result.sendToTarget(); } } else { NetworkScanRequest nsr = (NetworkScanRequest) result.obj; android.hardware.radio.V1_1.NetworkScanRequest request = new android.hardware.radio.V1_1.NetworkScanRequest(); request.type = nsr.scanType; request.interval = 60; for (RadioAccessSpecifier ras : nsr.specifiers) { android.hardware.radio.V1_1.RadioAccessSpecifier s = new android.hardware.radio.V1_1.RadioAccessSpecifier(); s.radioAccessNetwork = ras.radioAccessNetwork; List<Integer> bands = null; switch (ras.radioAccessNetwork) { case RadioAccessNetworks.GERAN: bands = s.geranBands; break; case RadioAccessNetworks.UTRAN: bands = s.utranBands; break; case RadioAccessNetworks.EUTRAN: bands = s.eutranBands; break; default: Log.wtf(RILJ_LOG_TAG, "radioAccessNetwork " + ras.radioAccessNetwork + " not supported!"); return; } for (int band : ras.bands) { bands.add(band); } for (int channel : ras.channels) { s.channels.add(channel); } request.specifiers.add(s); } RILRequest rr = obtainRequest(RIL_REQUEST_START_NETWORK_SCAN, result, mRILDefaultWorkSource); if (RILJ_LOGD) { riljLog(rr.serialString() + "> " + requestToString(rr.mRequest)); } try { radioProxy11.startNetworkScan(rr.mSerial, request); } catch (RemoteException | RuntimeException e) { handleRadioProxyExceptionForRR(rr, "startNetworkScan", e); } } } } @Override public void stopNetworkScan(Message result) { IRadio radioProxy = getRadioProxy(result); if (radioProxy != null) { android.hardware.radio.V1_1.IRadio radioProxy11 = android.hardware.radio.V1_1.IRadio.castFrom(radioProxy); if (radioProxy11 == null) { if (result != null) { AsyncResult.forMessage(result, null, CommandException.fromRilErrno(REQUEST_NOT_SUPPORTED)); result.sendToTarget(); } } else { RILRequest rr = obtainRequest(RIL_REQUEST_STOP_NETWORK_SCAN, result, mRILDefaultWorkSource); if (RILJ_LOGD) { riljLog(rr.serialString() + "> " + requestToString(rr.mRequest)); } try { radioProxy11.stopNetworkScan(rr.mSerial); } catch (RemoteException | RuntimeException e) { handleRadioProxyExceptionForRR(rr, "stopNetworkScan", e); } } } } @Override public void startDtmf(char c, Message result) { IRadio radioProxy = getRadioProxy(result); Loading