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

Commit f297115e authored by joonhunshin's avatar joonhunshin Committed by Joonhun Shin
Browse files

Clean up subId as parameter for skylo and OEM based NB IOT satellite

Bug: 361182572
Test: atest SatelliteManagerTestOnMockService
Flag: EXEMPT refactor
Change-Id: I0a2be5785e4bbb2cf2ef980bcd38557862d80079
parent 61468e66
Loading
Loading
Loading
Loading
+28 −31
Original line number Diff line number Diff line
@@ -582,7 +582,7 @@ public final class SatelliteManager {
                                () -> resultListener.accept(result)));
                    }
                };
                telephony.requestSatelliteEnabled(mSubId, attributes.isEnabled(),
                telephony.requestSatelliteEnabled(attributes.isEnabled(),
                        attributes.isDemoMode(), attributes.isEmergencyMode(), errorCallback);
            } else {
                Rlog.e(TAG, "requestEnabled() invalid telephony");
@@ -640,7 +640,7 @@ public final class SatelliteManager {
                        }
                    }
                };
                telephony.requestIsSatelliteEnabled(mSubId, receiver);
                telephony.requestIsSatelliteEnabled(receiver);
            } else {
                loge("requestIsEnabled() invalid telephony");
                executor.execute(() -> Binder.withCleanCallingIdentity(() -> callback.onError(
@@ -697,7 +697,7 @@ public final class SatelliteManager {
                        }
                    }
                };
                telephony.requestIsDemoModeEnabled(mSubId, receiver);
                telephony.requestIsDemoModeEnabled(receiver);
            } else {
                loge("requestIsDemoModeEnabled() invalid telephony");
                executor.execute(() -> Binder.withCleanCallingIdentity(() -> callback.onError(
@@ -754,7 +754,7 @@ public final class SatelliteManager {
                        }
                    }
                };
                telephony.requestIsEmergencyModeEnabled(mSubId, receiver);
                telephony.requestIsEmergencyModeEnabled(receiver);
            } else {
                executor.execute(() -> Binder.withCleanCallingIdentity(() -> callback.onError(
                        new SatelliteException(SATELLITE_RESULT_ILLEGAL_STATE))));
@@ -811,7 +811,7 @@ public final class SatelliteManager {
                        }
                    }
                };
                telephony.requestIsSatelliteSupported(mSubId, receiver);
                telephony.requestIsSatelliteSupported(receiver);
            } else {
                loge("requestIsSupported() invalid telephony");
                executor.execute(() -> Binder.withCleanCallingIdentity(() -> callback.onError(
@@ -868,7 +868,7 @@ public final class SatelliteManager {
                        }
                    }
                };
                telephony.requestSatelliteCapabilities(mSubId, receiver);
                telephony.requestSatelliteCapabilities(receiver);
            } else {
                loge("requestCapabilities() invalid telephony");
                executor.execute(() -> Binder.withCleanCallingIdentity(() -> callback.onError(
@@ -1194,8 +1194,7 @@ public final class SatelliteManager {
                            }
                        };
                sSatelliteTransmissionUpdateCallbackMap.put(callback, internalCallback);
                telephony.startSatelliteTransmissionUpdates(mSubId, errorCallback,
                        internalCallback);
                telephony.startSatelliteTransmissionUpdates(errorCallback, internalCallback);
            } else {
                loge("startTransmissionUpdates() invalid telephony");
                executor.execute(() -> Binder.withCleanCallingIdentity(
@@ -1245,8 +1244,7 @@ public final class SatelliteManager {
                                    () -> resultListener.accept(result)));
                        }
                    };
                    telephony.stopSatelliteTransmissionUpdates(mSubId, errorCallback,
                            internalCallback);
                    telephony.stopSatelliteTransmissionUpdates(errorCallback, internalCallback);
                    // TODO: Notify SmsHandler that pointing UI stopped
                } else {
                    loge("stopSatelliteTransmissionUpdates: No internal callback.");
@@ -1302,7 +1300,7 @@ public final class SatelliteManager {
                                () -> resultListener.accept(result)));
                    }
                };
                cancelRemote = telephony.provisionSatelliteService(mSubId, token, provisionData,
                cancelRemote = telephony.provisionSatelliteService(token, provisionData,
                        errorCallback);
            } else {
                loge("provisionService() invalid telephony");
@@ -1354,7 +1352,7 @@ public final class SatelliteManager {
                                () -> resultListener.accept(result)));
                    }
                };
                telephony.deprovisionSatelliteService(mSubId, token, errorCallback);
                telephony.deprovisionSatelliteService(token, errorCallback);
            } else {
                loge("deprovisionService() invalid telephony");
                executor.execute(() -> Binder.withCleanCallingIdentity(
@@ -1409,8 +1407,7 @@ public final class SatelliteManager {
                            }
                        };
                sSatelliteProvisionStateCallbackMap.put(callback, internalCallback);
                return telephony.registerForSatelliteProvisionStateChanged(
                        mSubId, internalCallback);
                return telephony.registerForSatelliteProvisionStateChanged(internalCallback);
            } else {
                throw new IllegalStateException("telephony service is null.");
            }
@@ -1443,7 +1440,7 @@ public final class SatelliteManager {
            ITelephony telephony = getITelephony();
            if (telephony != null) {
                if (internalCallback != null) {
                    telephony.unregisterForSatelliteProvisionStateChanged(mSubId, internalCallback);
                    telephony.unregisterForSatelliteProvisionStateChanged(internalCallback);
                } else {
                    loge("unregisterForProvisionStateChanged: No internal callback.");
                }
@@ -1500,7 +1497,7 @@ public final class SatelliteManager {
                        }
                    }
                };
                telephony.requestIsSatelliteProvisioned(mSubId, receiver);
                telephony.requestIsSatelliteProvisioned(receiver);
            } else {
                loge("requestIsProvisioned() invalid telephony");
                executor.execute(() -> Binder.withCleanCallingIdentity(() -> callback.onError(
@@ -1550,7 +1547,7 @@ public final class SatelliteManager {
                    }
                };
                sSatelliteModemStateCallbackMap.put(callback, internalCallback);
                return telephony.registerForSatelliteModemStateChanged(mSubId, internalCallback);
                return telephony.registerForSatelliteModemStateChanged(internalCallback);
            } else {
                throw new IllegalStateException("telephony service is null.");
            }
@@ -1583,7 +1580,7 @@ public final class SatelliteManager {
            ITelephony telephony = getITelephony();
            if (telephony != null) {
                if (internalCallback != null) {
                    telephony.unregisterForModemStateChanged(mSubId, internalCallback);
                    telephony.unregisterForModemStateChanged(internalCallback);
                } else {
                    loge("unregisterForModemStateChanged: No internal callback.");
                }
@@ -1646,7 +1643,7 @@ public final class SatelliteManager {
                            }
                        };
                sSatelliteDatagramCallbackMap.put(callback, internalCallback);
                return telephony.registerForIncomingDatagram(mSubId, internalCallback);
                return telephony.registerForIncomingDatagram(internalCallback);
            } else {
                throw new IllegalStateException("telephony service is null.");
            }
@@ -1678,7 +1675,7 @@ public final class SatelliteManager {
            ITelephony telephony = getITelephony();
            if (telephony != null) {
                if (internalCallback != null) {
                    telephony.unregisterForIncomingDatagram(mSubId, internalCallback);
                    telephony.unregisterForIncomingDatagram(internalCallback);
                } else {
                    loge("unregisterForIncomingDatagram: No internal callback.");
                }
@@ -1722,7 +1719,7 @@ public final class SatelliteManager {
                                () -> resultListener.accept(result)));
                    }
                };
                telephony.pollPendingDatagrams(mSubId, internalCallback);
                telephony.pollPendingDatagrams(internalCallback);
            } else {
                loge("pollPendingDatagrams() invalid telephony");
                executor.execute(() -> Binder.withCleanCallingIdentity(
@@ -1780,7 +1777,7 @@ public final class SatelliteManager {
                                () -> resultListener.accept(result)));
                    }
                };
                telephony.sendDatagram(mSubId, datagramType, datagram,
                telephony.sendDatagram(datagramType, datagram,
                        needFullScreenPointingUI, internalCallback);
            } else {
                loge("sendDatagram() invalid telephony");
@@ -1898,7 +1895,7 @@ public final class SatelliteManager {
                        }
                    }
                };
                telephony.requestTimeForNextSatelliteVisibility(mSubId, receiver);
                telephony.requestTimeForNextSatelliteVisibility(receiver);
            } else {
                loge("requestTimeForNextSatelliteVisibility() invalid telephony");
                executor.execute(() -> Binder.withCleanCallingIdentity(() -> callback.onError(
@@ -1929,7 +1926,7 @@ public final class SatelliteManager {
        try {
            ITelephony telephony = getITelephony();
            if (telephony != null) {
                telephony.setDeviceAlignedWithSatellite(mSubId, isAligned);
                telephony.setDeviceAlignedWithSatellite(isAligned);
            } else {
                throw new IllegalStateException("telephony service is null.");
            }
@@ -2193,7 +2190,7 @@ public final class SatelliteManager {
                        }
                    }
                };
                telephony.requestNtnSignalStrength(mSubId, receiver);
                telephony.requestNtnSignalStrength(receiver);
            } else {
                loge("requestNtnSignalStrength() invalid telephony");
                executor.execute(() -> Binder.withCleanCallingIdentity(() -> callback.onError(
@@ -2244,7 +2241,7 @@ public final class SatelliteManager {
                                                ntnSignalStrength)));
                            }
                        };
                telephony.registerForNtnSignalStrengthChanged(mSubId, internalCallback);
                telephony.registerForNtnSignalStrengthChanged(internalCallback);
                sNtnSignalStrengthCallbackMap.put(callback, internalCallback);
            } else {
                throw new IllegalStateException("Telephony service is null.");
@@ -2284,7 +2281,7 @@ public final class SatelliteManager {
            ITelephony telephony = getITelephony();
            if (telephony != null) {
                if (internalCallback != null) {
                    telephony.unregisterForNtnSignalStrengthChanged(mSubId, internalCallback);
                    telephony.unregisterForNtnSignalStrengthChanged(internalCallback);
                } else {
                    loge("unregisterForNtnSignalStrengthChanged: No internal callback.");
                    throw new IllegalArgumentException("callback is not valid");
@@ -2329,7 +2326,7 @@ public final class SatelliteManager {
                            }
                        };
                sSatelliteCapabilitiesCallbackMap.put(callback, internalCallback);
                return telephony.registerForCapabilitiesChanged(mSubId, internalCallback);
                return telephony.registerForCapabilitiesChanged(internalCallback);
            } else {
                throw new IllegalStateException("Telephony service is null.");
            }
@@ -2362,7 +2359,7 @@ public final class SatelliteManager {
            ITelephony telephony = getITelephony();
            if (telephony != null) {
                if (internalCallback != null) {
                    telephony.unregisterForCapabilitiesChanged(mSubId, internalCallback);
                    telephony.unregisterForCapabilitiesChanged(internalCallback);
                } else {
                    loge("unregisterForCapabilitiesChanged: No internal callback.");
                }
@@ -2438,7 +2435,7 @@ public final class SatelliteManager {
                        };
                sSatelliteSupportedStateCallbackMap.put(callback, internalCallback);
                return telephony.registerForSatelliteSupportedStateChanged(
                        mSubId, internalCallback);
                        internalCallback);
            } else {
                throw new IllegalStateException("telephony service is null.");
            }
@@ -2473,7 +2470,7 @@ public final class SatelliteManager {
            ITelephony telephony = getITelephony();
            if (telephony != null) {
                if (internalCallback != null) {
                    telephony.unregisterForSatelliteSupportedStateChanged(mSubId, internalCallback);
                    telephony.unregisterForSatelliteSupportedStateChanged(internalCallback);
                } else {
                    loge("unregisterForSupportedStateChanged: No internal callback.");
                }
+28 −59

File changed.

Preview size limit exceeded, changes collapsed.