Loading services/core/java/com/android/server/TelephonyRegistry.java +52 −0 Original line number Diff line number Diff line Loading @@ -37,6 +37,7 @@ import android.telephony.CellLocation; import android.telephony.DisconnectCause; import android.telephony.LocationAccessPolicy; import android.telephony.PhoneStateListener; import android.telephony.PhysicalChannelConfig; import android.telephony.PreciseCallState; import android.telephony.PreciseDataConnectionState; import android.telephony.PreciseDisconnectCause; Loading Loading @@ -179,6 +180,8 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub { private ArrayList<List<CellInfo>> mCellInfo = null; private ArrayList<List<PhysicalChannelConfig>> mPhysicalChannelConfigs; private VoLteServiceState mVoLteServiceState = new VoLteServiceState(); private int mDefaultSubId = SubscriptionManager.INVALID_SUBSCRIPTION_ID; Loading Loading @@ -335,6 +338,7 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub { mDataConnectionLinkProperties = new LinkProperties[numPhones]; mDataConnectionNetworkCapabilities = new NetworkCapabilities[numPhones]; mCellInfo = new ArrayList<List<CellInfo>>(); mPhysicalChannelConfigs = new ArrayList<List<PhysicalChannelConfig>>(); for (int i = 0; i < numPhones; i++) { mCallState[i] = TelephonyManager.CALL_STATE_IDLE; mDataActivity[i] = TelephonyManager.DATA_ACTIVITY_NONE; Loading @@ -349,6 +353,7 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub { mCallForwarding[i] = false; mCellLocation[i] = new Bundle(); mCellInfo.add(i, null); mPhysicalChannelConfigs.add(i, null); mConnectedApns[i] = new ArrayList<String>(); } Loading Loading @@ -659,6 +664,14 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub { remove(r.binder); } } if ((events & PhoneStateListener.LISTEN_PHYSICAL_CHANNEL_CONFIGURATION) != 0) { try { r.callback.onPhysicalChannelConfigurationChanged( mPhysicalChannelConfigs.get(phoneId)); } catch (RemoteException ex) { remove(r.binder); } } } } } else { Loading Loading @@ -1020,6 +1033,45 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub { } } public void notifyPhysicalChannelConfiguration(List<PhysicalChannelConfig> configs) { notifyPhysicalChannelConfigurationForSubscriber(SubscriptionManager.DEFAULT_SUBSCRIPTION_ID, configs); } public void notifyPhysicalChannelConfigurationForSubscriber(int subId, List<PhysicalChannelConfig> configs) { if (!checkNotifyPermission("notifyPhysicalChannelConfiguration()")) { return; } if (VDBG) { log("notifyPhysicalChannelConfiguration: subId=" + subId + " configs=" + configs); } synchronized (mRecords) { int phoneId = SubscriptionManager.getPhoneId(subId); if (validatePhoneId(phoneId)) { mPhysicalChannelConfigs.set(phoneId, configs); for (Record r : mRecords) { if (r.matchPhoneStateListenerEvent( PhoneStateListener.LISTEN_PHYSICAL_CHANNEL_CONFIGURATION) && idMatch(r.subId, subId, phoneId)) { try { if (DBG_LOC) { log("notifyPhysicalChannelConfiguration: mPhysicalChannelConfigs=" + configs + " r=" + r); } r.callback.onPhysicalChannelConfigurationChanged(configs); } catch (RemoteException ex) { mRemoveList.add(r.binder); } } } } handleRemoveListLocked(); } } @Override public void notifyMessageWaitingChangedForPhoneId(int phoneId, int subId, boolean mwi) { if (!checkNotifyPermission("notifyMessageWaitingChanged()")) { Loading telephony/java/android/telephony/PhoneStateListener.java +5 −1 Original line number Diff line number Diff line Loading @@ -700,6 +700,10 @@ public class PhoneStateListener { public void onCarrierNetworkChange(boolean active) { send(LISTEN_CARRIER_NETWORK_CHANGE, 0, 0, active); } public void onPhysicalChannelConfigurationChanged(List<PhysicalChannelConfig> configs) { send(LISTEN_PHYSICAL_CHANNEL_CONFIGURATION, 0, 0, configs); } } IPhoneStateListener callback = new IPhoneStateListenerStub(this); Loading telephony/java/android/telephony/PhysicalChannelConfig.java +6 −1 Original line number Diff line number Diff line Loading @@ -27,8 +27,9 @@ import java.lang.annotation.RetentionPolicy; */ public final class PhysicalChannelConfig implements Parcelable { // TODO(b/72993578) consolidate these enums in a central location. @Retention(RetentionPolicy.SOURCE) @IntDef({CONNECTION_PRIMARY_SERVING, CONNECTION_SECONDARY_SERVING}) @IntDef({CONNECTION_PRIMARY_SERVING, CONNECTION_SECONDARY_SERVING, CONNECTION_UNKNOWN}) public @interface ConnectionStatus {} /** Loading @@ -41,6 +42,9 @@ public final class PhysicalChannelConfig implements Parcelable { */ public static final int CONNECTION_SECONDARY_SERVING = 2; /** Connection status is unknown. */ public static final int CONNECTION_UNKNOWN = Integer.MAX_VALUE; /** * Connection status of the cell. * Loading Loading @@ -86,6 +90,7 @@ public final class PhysicalChannelConfig implements Parcelable { * * @see #CONNECTION_PRIMARY_SERVING * @see #CONNECTION_SECONDARY_SERVING * @see #CONNECTION_UNKNOWN * * @return Connection status of the cell */ Loading telephony/java/com/android/internal/telephony/IPhoneStateListener.aidl +2 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import android.telephony.ServiceState; import android.telephony.SignalStrength; import android.telephony.CellInfo; import android.telephony.DataConnectionRealTimeInfo; import android.telephony.PhysicalChannelConfig; import android.telephony.PreciseCallState; import android.telephony.PreciseDataConnectionState; import android.telephony.VoLteServiceState; Loading @@ -37,6 +38,7 @@ oneway interface IPhoneStateListener { void onDataConnectionStateChanged(int state, int networkType); void onDataActivity(int direction); void onSignalStrengthsChanged(in SignalStrength signalStrength); void onPhysicalChannelConfigurationChanged(in List<PhysicalChannelConfig> configs); void onOtaspChanged(in int otaspMode); void onCellInfoChanged(in List<CellInfo> cellInfo); void onPreciseCallStateChanged(in PreciseCallState callState); Loading telephony/java/com/android/internal/telephony/ITelephonyRegistry.aidl +4 −1 Original line number Diff line number Diff line Loading @@ -21,9 +21,9 @@ import android.net.LinkProperties; import android.net.NetworkCapabilities; import android.os.Bundle; import android.telephony.CellInfo; import android.telephony.PhysicalChannelConfig; import android.telephony.ServiceState; import android.telephony.SignalStrength; import android.telephony.CellInfo; import android.telephony.VoLteServiceState; import com.android.internal.telephony.IPhoneStateListener; import com.android.internal.telephony.IOnSubscriptionsChangedListener; Loading Loading @@ -58,6 +58,9 @@ interface ITelephonyRegistry { void notifyCellLocationForSubscriber(in int subId, in Bundle cellLocation); void notifyOtaspChanged(in int otaspMode); void notifyCellInfo(in List<CellInfo> cellInfo); void notifyPhysicalChannelConfiguration(in List<PhysicalChannelConfig> configs); void notifyPhysicalChannelConfigurationForSubscriber(in int subId, in List<PhysicalChannelConfig> configs); void notifyPreciseCallState(int ringingCallState, int foregroundCallState, int backgroundCallState); void notifyDisconnectCause(int disconnectCause, int preciseDisconnectCause); Loading Loading
services/core/java/com/android/server/TelephonyRegistry.java +52 −0 Original line number Diff line number Diff line Loading @@ -37,6 +37,7 @@ import android.telephony.CellLocation; import android.telephony.DisconnectCause; import android.telephony.LocationAccessPolicy; import android.telephony.PhoneStateListener; import android.telephony.PhysicalChannelConfig; import android.telephony.PreciseCallState; import android.telephony.PreciseDataConnectionState; import android.telephony.PreciseDisconnectCause; Loading Loading @@ -179,6 +180,8 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub { private ArrayList<List<CellInfo>> mCellInfo = null; private ArrayList<List<PhysicalChannelConfig>> mPhysicalChannelConfigs; private VoLteServiceState mVoLteServiceState = new VoLteServiceState(); private int mDefaultSubId = SubscriptionManager.INVALID_SUBSCRIPTION_ID; Loading Loading @@ -335,6 +338,7 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub { mDataConnectionLinkProperties = new LinkProperties[numPhones]; mDataConnectionNetworkCapabilities = new NetworkCapabilities[numPhones]; mCellInfo = new ArrayList<List<CellInfo>>(); mPhysicalChannelConfigs = new ArrayList<List<PhysicalChannelConfig>>(); for (int i = 0; i < numPhones; i++) { mCallState[i] = TelephonyManager.CALL_STATE_IDLE; mDataActivity[i] = TelephonyManager.DATA_ACTIVITY_NONE; Loading @@ -349,6 +353,7 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub { mCallForwarding[i] = false; mCellLocation[i] = new Bundle(); mCellInfo.add(i, null); mPhysicalChannelConfigs.add(i, null); mConnectedApns[i] = new ArrayList<String>(); } Loading Loading @@ -659,6 +664,14 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub { remove(r.binder); } } if ((events & PhoneStateListener.LISTEN_PHYSICAL_CHANNEL_CONFIGURATION) != 0) { try { r.callback.onPhysicalChannelConfigurationChanged( mPhysicalChannelConfigs.get(phoneId)); } catch (RemoteException ex) { remove(r.binder); } } } } } else { Loading Loading @@ -1020,6 +1033,45 @@ class TelephonyRegistry extends ITelephonyRegistry.Stub { } } public void notifyPhysicalChannelConfiguration(List<PhysicalChannelConfig> configs) { notifyPhysicalChannelConfigurationForSubscriber(SubscriptionManager.DEFAULT_SUBSCRIPTION_ID, configs); } public void notifyPhysicalChannelConfigurationForSubscriber(int subId, List<PhysicalChannelConfig> configs) { if (!checkNotifyPermission("notifyPhysicalChannelConfiguration()")) { return; } if (VDBG) { log("notifyPhysicalChannelConfiguration: subId=" + subId + " configs=" + configs); } synchronized (mRecords) { int phoneId = SubscriptionManager.getPhoneId(subId); if (validatePhoneId(phoneId)) { mPhysicalChannelConfigs.set(phoneId, configs); for (Record r : mRecords) { if (r.matchPhoneStateListenerEvent( PhoneStateListener.LISTEN_PHYSICAL_CHANNEL_CONFIGURATION) && idMatch(r.subId, subId, phoneId)) { try { if (DBG_LOC) { log("notifyPhysicalChannelConfiguration: mPhysicalChannelConfigs=" + configs + " r=" + r); } r.callback.onPhysicalChannelConfigurationChanged(configs); } catch (RemoteException ex) { mRemoveList.add(r.binder); } } } } handleRemoveListLocked(); } } @Override public void notifyMessageWaitingChangedForPhoneId(int phoneId, int subId, boolean mwi) { if (!checkNotifyPermission("notifyMessageWaitingChanged()")) { Loading
telephony/java/android/telephony/PhoneStateListener.java +5 −1 Original line number Diff line number Diff line Loading @@ -700,6 +700,10 @@ public class PhoneStateListener { public void onCarrierNetworkChange(boolean active) { send(LISTEN_CARRIER_NETWORK_CHANGE, 0, 0, active); } public void onPhysicalChannelConfigurationChanged(List<PhysicalChannelConfig> configs) { send(LISTEN_PHYSICAL_CHANNEL_CONFIGURATION, 0, 0, configs); } } IPhoneStateListener callback = new IPhoneStateListenerStub(this); Loading
telephony/java/android/telephony/PhysicalChannelConfig.java +6 −1 Original line number Diff line number Diff line Loading @@ -27,8 +27,9 @@ import java.lang.annotation.RetentionPolicy; */ public final class PhysicalChannelConfig implements Parcelable { // TODO(b/72993578) consolidate these enums in a central location. @Retention(RetentionPolicy.SOURCE) @IntDef({CONNECTION_PRIMARY_SERVING, CONNECTION_SECONDARY_SERVING}) @IntDef({CONNECTION_PRIMARY_SERVING, CONNECTION_SECONDARY_SERVING, CONNECTION_UNKNOWN}) public @interface ConnectionStatus {} /** Loading @@ -41,6 +42,9 @@ public final class PhysicalChannelConfig implements Parcelable { */ public static final int CONNECTION_SECONDARY_SERVING = 2; /** Connection status is unknown. */ public static final int CONNECTION_UNKNOWN = Integer.MAX_VALUE; /** * Connection status of the cell. * Loading Loading @@ -86,6 +90,7 @@ public final class PhysicalChannelConfig implements Parcelable { * * @see #CONNECTION_PRIMARY_SERVING * @see #CONNECTION_SECONDARY_SERVING * @see #CONNECTION_UNKNOWN * * @return Connection status of the cell */ Loading
telephony/java/com/android/internal/telephony/IPhoneStateListener.aidl +2 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import android.telephony.ServiceState; import android.telephony.SignalStrength; import android.telephony.CellInfo; import android.telephony.DataConnectionRealTimeInfo; import android.telephony.PhysicalChannelConfig; import android.telephony.PreciseCallState; import android.telephony.PreciseDataConnectionState; import android.telephony.VoLteServiceState; Loading @@ -37,6 +38,7 @@ oneway interface IPhoneStateListener { void onDataConnectionStateChanged(int state, int networkType); void onDataActivity(int direction); void onSignalStrengthsChanged(in SignalStrength signalStrength); void onPhysicalChannelConfigurationChanged(in List<PhysicalChannelConfig> configs); void onOtaspChanged(in int otaspMode); void onCellInfoChanged(in List<CellInfo> cellInfo); void onPreciseCallStateChanged(in PreciseCallState callState); Loading
telephony/java/com/android/internal/telephony/ITelephonyRegistry.aidl +4 −1 Original line number Diff line number Diff line Loading @@ -21,9 +21,9 @@ import android.net.LinkProperties; import android.net.NetworkCapabilities; import android.os.Bundle; import android.telephony.CellInfo; import android.telephony.PhysicalChannelConfig; import android.telephony.ServiceState; import android.telephony.SignalStrength; import android.telephony.CellInfo; import android.telephony.VoLteServiceState; import com.android.internal.telephony.IPhoneStateListener; import com.android.internal.telephony.IOnSubscriptionsChangedListener; Loading Loading @@ -58,6 +58,9 @@ interface ITelephonyRegistry { void notifyCellLocationForSubscriber(in int subId, in Bundle cellLocation); void notifyOtaspChanged(in int otaspMode); void notifyCellInfo(in List<CellInfo> cellInfo); void notifyPhysicalChannelConfiguration(in List<PhysicalChannelConfig> configs); void notifyPhysicalChannelConfigurationForSubscriber(in int subId, in List<PhysicalChannelConfig> configs); void notifyPreciseCallState(int ringingCallState, int foregroundCallState, int backgroundCallState); void notifyDisconnectCause(int disconnectCause, int preciseDisconnectCause); Loading