Loading src/java/com/android/internal/telephony/satellite/SatelliteController.java +9 −9 Original line number Diff line number Diff line Loading @@ -133,7 +133,6 @@ import android.telephony.satellite.ISatelliteCapabilitiesCallback; import android.telephony.satellite.ISatelliteDatagramCallback; import android.telephony.satellite.ISatelliteModemStateCallback; import android.telephony.satellite.ISatelliteProvisionStateCallback; import android.telephony.satellite.ISatelliteSupportedStateCallback; import android.telephony.satellite.ISatelliteTransmissionUpdateCallback; import android.telephony.satellite.ISelectedNbIotSatelliteSubscriptionCallback; import android.telephony.satellite.NtnSignalStrength; Loading @@ -160,6 +159,7 @@ import com.android.internal.annotations.GuardedBy; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.telephony.CommandsInterface; import com.android.internal.telephony.DeviceStateMonitor; import com.android.internal.telephony.IBooleanConsumer; import com.android.internal.telephony.IIntegerConsumer; import com.android.internal.telephony.Phone; import com.android.internal.telephony.PhoneFactory; Loading Loading @@ -420,7 +420,7 @@ public class SatelliteController extends Handler { /** * Map key: binder of the callback, value: callback to receive supported state changed events. */ private final ConcurrentHashMap<IBinder, ISatelliteSupportedStateCallback> private final ConcurrentHashMap<IBinder, IBooleanConsumer> mSatelliteSupportedStateChangedListeners = new ConcurrentHashMap<>(); /** Loading Loading @@ -3328,7 +3328,7 @@ public class SatelliteController extends Handler { * @return The {@link SatelliteManager.SatelliteResult} result of the operation. */ @SatelliteManager.SatelliteResult public int registerForSatelliteSupportedStateChanged( @NonNull ISatelliteSupportedStateCallback callback) { @NonNull IBooleanConsumer callback) { if (!mFeatureFlags.oemEnabledSatelliteFlag()) { plogd("registerForSatelliteSupportedStateChanged: oemEnabledSatelliteFlag is disabled"); return SatelliteManager.SATELLITE_RESULT_REQUEST_NOT_SUPPORTED; Loading @@ -3343,10 +3343,10 @@ public class SatelliteController extends Handler { * If callback was not registered before, the request will be ignored. * * @param callback The callback that was passed to * {@link #registerForSatelliteSupportedStateChanged(int, ISatelliteSupportedStateCallback)}. * {@link #registerForSatelliteSupportedStateChanged(IBooleanConsumer)} */ public void unregisterForSatelliteSupportedStateChanged( @NonNull ISatelliteSupportedStateCallback callback) { @NonNull IBooleanConsumer callback) { if (!mFeatureFlags.oemEnabledSatelliteFlag()) { plogd("unregisterForSatelliteSupportedStateChanged: " + "oemEnabledSatelliteFlag is disabled"); Loading Loading @@ -5017,10 +5017,10 @@ public class SatelliteController extends Handler { } private void notifySatelliteSupportedStateChanged(boolean supported) { List<ISatelliteSupportedStateCallback> deadCallersList = new ArrayList<>(); List<IBooleanConsumer> deadCallersList = new ArrayList<>(); mSatelliteSupportedStateChangedListeners.values().forEach(listener -> { try { listener.onSatelliteSupportedStateChanged(supported); listener.accept(supported); } catch (RemoteException e) { plogd("handleSatelliteSupportedStateChangedEvent RemoteException: " + e); deadCallersList.add(listener); Loading Loading @@ -7148,7 +7148,7 @@ public class SatelliteController extends Handler { private Pair<String, Integer> getSubscriberIdAndType(@Nullable SubscriptionInfo info) { String subscriberId = ""; @SatelliteSubscriberInfo.SubscriberIdType int subscriberIdType = SatelliteSubscriberInfo.ICCID; SatelliteSubscriberInfo.SUBSCRIBER_ID_TYPE_ICCID; if (info == null) { logd("getSubscriberIdAndType: subscription info is null"); return new Pair<>(subscriberId, subscriberIdType); Loading @@ -7157,7 +7157,7 @@ public class SatelliteController extends Handler { subscriberId = info.getIccId(); } else if (info.isSatelliteESOSSupported()) { subscriberId = getPhoneNumberBasedCarrier(info.getSubscriptionId()); subscriberIdType = SatelliteSubscriberInfo.IMSI_MSISDN; subscriberIdType = SatelliteSubscriberInfo.SUBSCRIBER_ID_TYPE_IMSI_MSISDN; } logd("getSubscriberIdAndType: subscriberId=" + subscriberId + ", subscriberIdType=" + subscriberIdType); Loading src/java/com/android/internal/telephony/satellite/SatelliteServiceUtils.java +2 −2 Original line number Diff line number Diff line Loading @@ -290,8 +290,8 @@ public class SatelliteServiceUtils { android.telephony.satellite.stub.SatelliteModemEnableRequestAttributes converted = new android.telephony.satellite.stub.SatelliteModemEnableRequestAttributes(); converted.isEnabled = attributes.isEnabled(); converted.isDemoMode = attributes.isDemoMode(); converted.isEmergencyMode = attributes.isEmergencyMode(); converted.isDemoMode = attributes.isForDemoMode(); converted.isEmergencyMode = attributes.isForEmergencyMode(); converted.satelliteSubscriptionInfo = toSatelliteSubscriptionInfo( attributes.getSatelliteSubscriptionInfo()); return converted; Loading tests/telephonytests/src/com/android/internal/telephony/satellite/SatelliteControllerTest.java +11 −11 Original line number Diff line number Diff line Loading @@ -164,7 +164,6 @@ import android.telephony.satellite.ISatelliteCapabilitiesCallback; import android.telephony.satellite.ISatelliteDatagramCallback; import android.telephony.satellite.ISatelliteModemStateCallback; import android.telephony.satellite.ISatelliteProvisionStateCallback; import android.telephony.satellite.ISatelliteSupportedStateCallback; import android.telephony.satellite.ISatelliteTransmissionUpdateCallback; import android.telephony.satellite.ISelectedNbIotSatelliteSubscriptionCallback; import android.telephony.satellite.NtnSignalStrength; Loading @@ -187,6 +186,7 @@ import android.util.SparseArray; import android.util.SparseBooleanArray; import com.android.internal.R; import com.android.internal.telephony.IBooleanConsumer; import com.android.internal.telephony.IIntegerConsumer; import com.android.internal.telephony.IVoidConsumer; import com.android.internal.telephony.Phone; Loading Loading @@ -3769,8 +3769,8 @@ public class SatelliteControllerTest extends TelephonyTest { enableSatelliteResponse.capture()); SatelliteModemEnableRequestAttributes request = enableSatelliteRequest.getValue(); assertTrue(request.isEnabled()); assertFalse(request.isDemoMode()); assertFalse(request.isEmergencyMode()); assertFalse(request.isForDemoMode()); assertFalse(request.isForEmergencyMode()); clearInvocations(mMockSatelliteModemInterface); moveTimeForward(TEST_WAIT_FOR_SATELLITE_ENABLING_RESPONSE_TIMEOUT_MILLIS); Loading Loading @@ -3928,10 +3928,10 @@ public class SatelliteControllerTest extends TelephonyTest { Semaphore semaphore = new Semaphore(0); final boolean[] isSupported = new boolean[1]; ISatelliteSupportedStateCallback callback = new ISatelliteSupportedStateCallback.Stub() { IBooleanConsumer callback = new IBooleanConsumer.Stub() { @Override public void onSatelliteSupportedStateChanged(boolean supported) { public void accept(boolean supported) { logd("onSatelliteSupportedStateChanged: supported=" + supported); isSupported[0] = supported; try { Loading Loading @@ -4020,10 +4020,10 @@ public class SatelliteControllerTest extends TelephonyTest { when(mFeatureFlags.oemEnabledSatelliteFlag()).thenReturn(false); Semaphore semaphore = new Semaphore(0); ISatelliteSupportedStateCallback callback = new ISatelliteSupportedStateCallback.Stub() { IBooleanConsumer callback = new IBooleanConsumer.Stub() { @Override public void onSatelliteSupportedStateChanged(boolean supported) { public void accept(boolean supported) { logd("onSatelliteSupportedStateChanged: supported=" + supported); try { semaphore.release(); Loading Loading @@ -4891,10 +4891,10 @@ public class SatelliteControllerTest extends TelephonyTest { List<SatelliteSubscriberInfo> list = new ArrayList<>(); list.add(new SatelliteSubscriberInfo.Builder().setSubscriberId(mSubscriberId).setCarrierId( mCarrierId).setNiddApn(mNiddApn).setSubId(SUB_ID).setSubscriberIdType( SatelliteSubscriberInfo.IMSI_MSISDN).build()); SatelliteSubscriberInfo.SUBSCRIBER_ID_TYPE_IMSI_MSISDN).build()); list.add(new SatelliteSubscriberInfo.Builder().setSubscriberId(mSubscriberId2).setCarrierId( mCarrierId).setNiddApn(mNiddApn).setSubId(SUB_ID1).setSubscriberIdType( SatelliteSubscriberInfo.ICCID).build()); SatelliteSubscriberInfo.SUBSCRIBER_ID_TYPE_ICCID).build()); return list; } Loading Loading
src/java/com/android/internal/telephony/satellite/SatelliteController.java +9 −9 Original line number Diff line number Diff line Loading @@ -133,7 +133,6 @@ import android.telephony.satellite.ISatelliteCapabilitiesCallback; import android.telephony.satellite.ISatelliteDatagramCallback; import android.telephony.satellite.ISatelliteModemStateCallback; import android.telephony.satellite.ISatelliteProvisionStateCallback; import android.telephony.satellite.ISatelliteSupportedStateCallback; import android.telephony.satellite.ISatelliteTransmissionUpdateCallback; import android.telephony.satellite.ISelectedNbIotSatelliteSubscriptionCallback; import android.telephony.satellite.NtnSignalStrength; Loading @@ -160,6 +159,7 @@ import com.android.internal.annotations.GuardedBy; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.telephony.CommandsInterface; import com.android.internal.telephony.DeviceStateMonitor; import com.android.internal.telephony.IBooleanConsumer; import com.android.internal.telephony.IIntegerConsumer; import com.android.internal.telephony.Phone; import com.android.internal.telephony.PhoneFactory; Loading Loading @@ -420,7 +420,7 @@ public class SatelliteController extends Handler { /** * Map key: binder of the callback, value: callback to receive supported state changed events. */ private final ConcurrentHashMap<IBinder, ISatelliteSupportedStateCallback> private final ConcurrentHashMap<IBinder, IBooleanConsumer> mSatelliteSupportedStateChangedListeners = new ConcurrentHashMap<>(); /** Loading Loading @@ -3328,7 +3328,7 @@ public class SatelliteController extends Handler { * @return The {@link SatelliteManager.SatelliteResult} result of the operation. */ @SatelliteManager.SatelliteResult public int registerForSatelliteSupportedStateChanged( @NonNull ISatelliteSupportedStateCallback callback) { @NonNull IBooleanConsumer callback) { if (!mFeatureFlags.oemEnabledSatelliteFlag()) { plogd("registerForSatelliteSupportedStateChanged: oemEnabledSatelliteFlag is disabled"); return SatelliteManager.SATELLITE_RESULT_REQUEST_NOT_SUPPORTED; Loading @@ -3343,10 +3343,10 @@ public class SatelliteController extends Handler { * If callback was not registered before, the request will be ignored. * * @param callback The callback that was passed to * {@link #registerForSatelliteSupportedStateChanged(int, ISatelliteSupportedStateCallback)}. * {@link #registerForSatelliteSupportedStateChanged(IBooleanConsumer)} */ public void unregisterForSatelliteSupportedStateChanged( @NonNull ISatelliteSupportedStateCallback callback) { @NonNull IBooleanConsumer callback) { if (!mFeatureFlags.oemEnabledSatelliteFlag()) { plogd("unregisterForSatelliteSupportedStateChanged: " + "oemEnabledSatelliteFlag is disabled"); Loading Loading @@ -5017,10 +5017,10 @@ public class SatelliteController extends Handler { } private void notifySatelliteSupportedStateChanged(boolean supported) { List<ISatelliteSupportedStateCallback> deadCallersList = new ArrayList<>(); List<IBooleanConsumer> deadCallersList = new ArrayList<>(); mSatelliteSupportedStateChangedListeners.values().forEach(listener -> { try { listener.onSatelliteSupportedStateChanged(supported); listener.accept(supported); } catch (RemoteException e) { plogd("handleSatelliteSupportedStateChangedEvent RemoteException: " + e); deadCallersList.add(listener); Loading Loading @@ -7148,7 +7148,7 @@ public class SatelliteController extends Handler { private Pair<String, Integer> getSubscriberIdAndType(@Nullable SubscriptionInfo info) { String subscriberId = ""; @SatelliteSubscriberInfo.SubscriberIdType int subscriberIdType = SatelliteSubscriberInfo.ICCID; SatelliteSubscriberInfo.SUBSCRIBER_ID_TYPE_ICCID; if (info == null) { logd("getSubscriberIdAndType: subscription info is null"); return new Pair<>(subscriberId, subscriberIdType); Loading @@ -7157,7 +7157,7 @@ public class SatelliteController extends Handler { subscriberId = info.getIccId(); } else if (info.isSatelliteESOSSupported()) { subscriberId = getPhoneNumberBasedCarrier(info.getSubscriptionId()); subscriberIdType = SatelliteSubscriberInfo.IMSI_MSISDN; subscriberIdType = SatelliteSubscriberInfo.SUBSCRIBER_ID_TYPE_IMSI_MSISDN; } logd("getSubscriberIdAndType: subscriberId=" + subscriberId + ", subscriberIdType=" + subscriberIdType); Loading
src/java/com/android/internal/telephony/satellite/SatelliteServiceUtils.java +2 −2 Original line number Diff line number Diff line Loading @@ -290,8 +290,8 @@ public class SatelliteServiceUtils { android.telephony.satellite.stub.SatelliteModemEnableRequestAttributes converted = new android.telephony.satellite.stub.SatelliteModemEnableRequestAttributes(); converted.isEnabled = attributes.isEnabled(); converted.isDemoMode = attributes.isDemoMode(); converted.isEmergencyMode = attributes.isEmergencyMode(); converted.isDemoMode = attributes.isForDemoMode(); converted.isEmergencyMode = attributes.isForEmergencyMode(); converted.satelliteSubscriptionInfo = toSatelliteSubscriptionInfo( attributes.getSatelliteSubscriptionInfo()); return converted; Loading
tests/telephonytests/src/com/android/internal/telephony/satellite/SatelliteControllerTest.java +11 −11 Original line number Diff line number Diff line Loading @@ -164,7 +164,6 @@ import android.telephony.satellite.ISatelliteCapabilitiesCallback; import android.telephony.satellite.ISatelliteDatagramCallback; import android.telephony.satellite.ISatelliteModemStateCallback; import android.telephony.satellite.ISatelliteProvisionStateCallback; import android.telephony.satellite.ISatelliteSupportedStateCallback; import android.telephony.satellite.ISatelliteTransmissionUpdateCallback; import android.telephony.satellite.ISelectedNbIotSatelliteSubscriptionCallback; import android.telephony.satellite.NtnSignalStrength; Loading @@ -187,6 +186,7 @@ import android.util.SparseArray; import android.util.SparseBooleanArray; import com.android.internal.R; import com.android.internal.telephony.IBooleanConsumer; import com.android.internal.telephony.IIntegerConsumer; import com.android.internal.telephony.IVoidConsumer; import com.android.internal.telephony.Phone; Loading Loading @@ -3769,8 +3769,8 @@ public class SatelliteControllerTest extends TelephonyTest { enableSatelliteResponse.capture()); SatelliteModemEnableRequestAttributes request = enableSatelliteRequest.getValue(); assertTrue(request.isEnabled()); assertFalse(request.isDemoMode()); assertFalse(request.isEmergencyMode()); assertFalse(request.isForDemoMode()); assertFalse(request.isForEmergencyMode()); clearInvocations(mMockSatelliteModemInterface); moveTimeForward(TEST_WAIT_FOR_SATELLITE_ENABLING_RESPONSE_TIMEOUT_MILLIS); Loading Loading @@ -3928,10 +3928,10 @@ public class SatelliteControllerTest extends TelephonyTest { Semaphore semaphore = new Semaphore(0); final boolean[] isSupported = new boolean[1]; ISatelliteSupportedStateCallback callback = new ISatelliteSupportedStateCallback.Stub() { IBooleanConsumer callback = new IBooleanConsumer.Stub() { @Override public void onSatelliteSupportedStateChanged(boolean supported) { public void accept(boolean supported) { logd("onSatelliteSupportedStateChanged: supported=" + supported); isSupported[0] = supported; try { Loading Loading @@ -4020,10 +4020,10 @@ public class SatelliteControllerTest extends TelephonyTest { when(mFeatureFlags.oemEnabledSatelliteFlag()).thenReturn(false); Semaphore semaphore = new Semaphore(0); ISatelliteSupportedStateCallback callback = new ISatelliteSupportedStateCallback.Stub() { IBooleanConsumer callback = new IBooleanConsumer.Stub() { @Override public void onSatelliteSupportedStateChanged(boolean supported) { public void accept(boolean supported) { logd("onSatelliteSupportedStateChanged: supported=" + supported); try { semaphore.release(); Loading Loading @@ -4891,10 +4891,10 @@ public class SatelliteControllerTest extends TelephonyTest { List<SatelliteSubscriberInfo> list = new ArrayList<>(); list.add(new SatelliteSubscriberInfo.Builder().setSubscriberId(mSubscriberId).setCarrierId( mCarrierId).setNiddApn(mNiddApn).setSubId(SUB_ID).setSubscriberIdType( SatelliteSubscriberInfo.IMSI_MSISDN).build()); SatelliteSubscriberInfo.SUBSCRIBER_ID_TYPE_IMSI_MSISDN).build()); list.add(new SatelliteSubscriberInfo.Builder().setSubscriberId(mSubscriberId2).setCarrierId( mCarrierId).setNiddApn(mNiddApn).setSubId(SUB_ID1).setSubscriberIdType( SatelliteSubscriberInfo.ICCID).build()); SatelliteSubscriberInfo.SUBSCRIBER_ID_TYPE_ICCID).build()); return list; } Loading