Merge "Update satellite APIs from feedback" into udc-dev

This commit is contained in:
Sarah Chin
2023-03-14 06:11:14 +00:00
committed by Android (Google) Code Review
17 changed files with 351 additions and 758 deletions

View File

@@ -21,13 +21,6 @@ package android.telephony.satellite;
* @hide * @hide
*/ */
oneway interface ISatelliteStateCallback { oneway interface ISatelliteStateCallback {
/**
* Indicates that the satellite has pending datagrams for the device to be pulled.
*
* @param count Number of pending datagrams.
*/
void onPendingDatagramCount(in int count);
/** /**
* Indicates that the satellite modem state has changed. * Indicates that the satellite modem state has changed.
* *

View File

@@ -22,7 +22,7 @@ import android.telephony.satellite.PointingInfo;
* Interface for position update and datagram transfer state change callback. * Interface for position update and datagram transfer state change callback.
* @hide * @hide
*/ */
oneway interface ISatellitePositionUpdateCallback { oneway interface ISatelliteTransmissionUpdateCallback {
/** /**
* Called when satellite datagram transfer state changed. * Called when satellite datagram transfer state changed.
* *

View File

@@ -30,31 +30,12 @@ public final class PointingInfo implements Parcelable {
/** Satellite elevation in degrees */ /** Satellite elevation in degrees */
private float mSatelliteElevationDegrees; private float mSatelliteElevationDegrees;
/** Antenna azimuth in degrees */
private float mAntennaAzimuthDegrees;
/**
* Angle of rotation about the x axis. This value represents the angle between a plane
* parallel to the device's screen and a plane parallel to the ground.
*/
private float mAntennaPitchDegrees;
/**
* Angle of rotation about the y axis. This value represents the angle between a plane
* perpendicular to the device's screen and a plane parallel to the ground.
*/
private float mAntennaRollDegrees;
/** /**
* @hide * @hide
*/ */
public PointingInfo(float satelliteAzimuthDegrees, float satelliteElevationDegrees, public PointingInfo(float satelliteAzimuthDegrees, float satelliteElevationDegrees) {
float antennaAzimuthDegrees, float antennaPitchDegrees, float antennaRollDegrees) {
mSatelliteAzimuthDegrees = satelliteAzimuthDegrees; mSatelliteAzimuthDegrees = satelliteAzimuthDegrees;
mSatelliteElevationDegrees = satelliteElevationDegrees; mSatelliteElevationDegrees = satelliteElevationDegrees;
mAntennaAzimuthDegrees = antennaAzimuthDegrees;
mAntennaPitchDegrees = antennaPitchDegrees;
mAntennaRollDegrees = antennaRollDegrees;
} }
private PointingInfo(Parcel in) { private PointingInfo(Parcel in) {
@@ -70,9 +51,6 @@ public final class PointingInfo implements Parcelable {
public void writeToParcel(@NonNull Parcel out, int flags) { public void writeToParcel(@NonNull Parcel out, int flags) {
out.writeFloat(mSatelliteAzimuthDegrees); out.writeFloat(mSatelliteAzimuthDegrees);
out.writeFloat(mSatelliteElevationDegrees); out.writeFloat(mSatelliteElevationDegrees);
out.writeFloat(mAntennaAzimuthDegrees);
out.writeFloat(mAntennaPitchDegrees);
out.writeFloat(mAntennaRollDegrees);
} }
public static final @android.annotation.NonNull Creator<PointingInfo> CREATOR = public static final @android.annotation.NonNull Creator<PointingInfo> CREATOR =
@@ -99,18 +77,6 @@ public final class PointingInfo implements Parcelable {
sb.append("SatelliteElevationDegrees:"); sb.append("SatelliteElevationDegrees:");
sb.append(mSatelliteElevationDegrees); sb.append(mSatelliteElevationDegrees);
sb.append(",");
sb.append("AntennaAzimuthDegrees:");
sb.append(mAntennaAzimuthDegrees);
sb.append(",");
sb.append("AntennaPitchDegrees:");
sb.append(mAntennaPitchDegrees);
sb.append(",");
sb.append("AntennaRollDegrees:");
sb.append(mAntennaRollDegrees);
return sb.toString(); return sb.toString();
} }
@@ -122,23 +88,8 @@ public final class PointingInfo implements Parcelable {
return mSatelliteElevationDegrees; return mSatelliteElevationDegrees;
} }
public float getAntennaAzimuthDegrees() {
return mAntennaAzimuthDegrees;
}
public float getAntennaPitchDegrees() {
return mAntennaPitchDegrees;
}
public float getAntennaRollDegrees() {
return mAntennaRollDegrees;
}
private void readFromParcel(Parcel in) { private void readFromParcel(Parcel in) {
mSatelliteAzimuthDegrees = in.readFloat(); mSatelliteAzimuthDegrees = in.readFloat();
mSatelliteElevationDegrees = in.readFloat(); mSatelliteElevationDegrees = in.readFloat();
mAntennaAzimuthDegrees = in.readFloat();
mAntennaPitchDegrees = in.readFloat();
mAntennaRollDegrees = in.readFloat();
} }
} }

View File

@@ -32,32 +32,25 @@ public final class SatelliteCapabilities implements Parcelable {
*/ */
@NonNull @SatelliteManager.NTRadioTechnology private Set<Integer> mSupportedRadioTechnologies; @NonNull @SatelliteManager.NTRadioTechnology private Set<Integer> mSupportedRadioTechnologies;
/**
* Whether satellite modem is always on.
* This indicates the power impact of keeping it on is very minimal.
*/
private boolean mIsAlwaysOn;
/** /**
* Whether UE needs to point to a satellite to send and receive data. * Whether UE needs to point to a satellite to send and receive data.
*/ */
private boolean mNeedsPointingToSatellite; private boolean mIsPointingRequired;
/** /**
* Whether UE needs a separate SIM profile to communicate with the satellite network. * The maximum number of bytes per datagram that can be sent over satellite.
*/ */
private boolean mNeedsSeparateSimProfile; private int mMaxBytesPerOutgoingDatagram;
/** /**
* @hide * @hide
*/ */
public SatelliteCapabilities(Set<Integer> supportedRadioTechnologies, boolean isAlwaysOn, public SatelliteCapabilities(Set<Integer> supportedRadioTechnologies,
boolean needsPointingToSatellite, boolean needsSeparateSimProfile) { boolean isPointingRequired, int maxBytesPerOutgoingDatagram) {
mSupportedRadioTechnologies = supportedRadioTechnologies == null mSupportedRadioTechnologies = supportedRadioTechnologies == null
? new HashSet<>() : supportedRadioTechnologies; ? new HashSet<>() : supportedRadioTechnologies;
mIsAlwaysOn = isAlwaysOn; mIsPointingRequired = isPointingRequired;
mNeedsPointingToSatellite = needsPointingToSatellite; mMaxBytesPerOutgoingDatagram = maxBytesPerOutgoingDatagram;
mNeedsSeparateSimProfile = needsSeparateSimProfile;
} }
private SatelliteCapabilities(Parcel in) { private SatelliteCapabilities(Parcel in) {
@@ -80,9 +73,8 @@ public final class SatelliteCapabilities implements Parcelable {
out.writeInt(0); out.writeInt(0);
} }
out.writeBoolean(mIsAlwaysOn); out.writeBoolean(mIsPointingRequired);
out.writeBoolean(mNeedsPointingToSatellite); out.writeInt(mMaxBytesPerOutgoingDatagram);
out.writeBoolean(mNeedsSeparateSimProfile);
} }
@NonNull public static final Creator<SatelliteCapabilities> CREATOR = new Creator<>() { @NonNull public static final Creator<SatelliteCapabilities> CREATOR = new Creator<>() {
@@ -111,16 +103,12 @@ public final class SatelliteCapabilities implements Parcelable {
sb.append("none,"); sb.append("none,");
} }
sb.append("isAlwaysOn:"); sb.append("isPointingRequired:");
sb.append(mIsAlwaysOn); sb.append(mIsPointingRequired);
sb.append(","); sb.append(",");
sb.append("needsPointingToSatellite:"); sb.append("maxBytesPerOutgoingDatagram");
sb.append(mNeedsPointingToSatellite); sb.append(mMaxBytesPerOutgoingDatagram);
sb.append(",");
sb.append("needsSeparateSimProfile:");
sb.append(mNeedsSeparateSimProfile);
return sb.toString(); return sb.toString();
} }
@@ -132,34 +120,23 @@ public final class SatelliteCapabilities implements Parcelable {
return mSupportedRadioTechnologies; return mSupportedRadioTechnologies;
} }
/**
* Get whether the satellite modem is always on.
* This indicates the power impact of keeping it on is very minimal.
*
* @return {@code true} if the satellite modem is always on and {@code false} otherwise.
*/
public boolean isAlwaysOn() {
return mIsAlwaysOn;
}
/** /**
* Get whether UE needs to point to a satellite to send and receive data. * Get whether UE needs to point to a satellite to send and receive data.
* *
* @return {@code true} if UE needs to pointing to a satellite to send and receive data and * @return {@code true} if UE needs to point to a satellite to send and receive data and
* {@code false} otherwise. * {@code false} otherwise.
*/ */
public boolean needsPointingToSatellite() { public boolean isPointingRequired() {
return mNeedsPointingToSatellite; return mIsPointingRequired;
} }
/** /**
* Get whether UE needs a separate SIM profile to communicate with the satellite network. * The maximum number of bytes per datagram that can be sent over satellite.
* *
* @return {@code true} if UE needs a separate SIM profile to comunicate with the satellite * @return The maximum number of bytes per datagram that can be sent over satellite.
* network and {@code false} otherwise.
*/ */
public boolean needsSeparateSimProfile() { public int getMaxBytesPerOutgoingDatagram() {
return mNeedsSeparateSimProfile; return mMaxBytesPerOutgoingDatagram;
} }
private void readFromParcel(Parcel in) { private void readFromParcel(Parcel in) {
@@ -171,8 +148,7 @@ public final class SatelliteCapabilities implements Parcelable {
} }
} }
mIsAlwaysOn = in.readBoolean(); mIsPointingRequired = in.readBoolean();
mNeedsPointingToSatellite = in.readBoolean(); mMaxBytesPerOutgoingDatagram = in.readInt();
mNeedsSeparateSimProfile = in.readBoolean();
} }
} }

View File

@@ -17,7 +17,6 @@
package android.telephony.satellite; package android.telephony.satellite;
import android.annotation.NonNull; import android.annotation.NonNull;
import android.annotation.Nullable;
import android.os.Parcel; import android.os.Parcel;
import android.os.Parcelable; import android.os.Parcelable;
@@ -28,7 +27,7 @@ public final class SatelliteDatagram implements Parcelable {
/** /**
* Datagram to be sent or received over satellite. * Datagram to be sent or received over satellite.
*/ */
private byte[] mData; @NonNull private byte[] mData;
/** /**
* @hide * @hide
@@ -51,8 +50,8 @@ public final class SatelliteDatagram implements Parcelable {
out.writeByteArray(mData); out.writeByteArray(mData);
} }
public static final @android.annotation.NonNull Creator<SatelliteDatagram> CREATOR = @NonNull public static final Creator<SatelliteDatagram> CREATOR =
new Creator<SatelliteDatagram>() { new Creator<>() {
@Override @Override
public SatelliteDatagram createFromParcel(Parcel in) { public SatelliteDatagram createFromParcel(Parcel in) {
return new SatelliteDatagram(in); return new SatelliteDatagram(in);
@@ -64,8 +63,7 @@ public final class SatelliteDatagram implements Parcelable {
} }
}; };
@Nullable @NonNull public byte[] getSatelliteDatagram() {
public byte[] getSatelliteDatagram() {
return mData; return mData;
} }

View File

@@ -17,48 +17,18 @@
package android.telephony.satellite; package android.telephony.satellite;
import android.annotation.NonNull; import android.annotation.NonNull;
import android.os.Binder;
import com.android.internal.telephony.ILongConsumer; import com.android.internal.telephony.ILongConsumer;
import java.util.concurrent.Executor;
/** /**
* A callback class for listening to satellite datagrams. * A callback class for listening to satellite datagrams.
* *
* @hide * @hide
*/ */
public class SatelliteDatagramCallback { public interface SatelliteDatagramCallback {
private final CallbackBinder mBinder = new CallbackBinder(this);
private static class CallbackBinder extends ISatelliteDatagramCallback.Stub {
private final SatelliteDatagramCallback mLocalCallback;
private Executor mExecutor;
private CallbackBinder(SatelliteDatagramCallback localCallback) {
mLocalCallback = localCallback;
}
@Override
public void onSatelliteDatagramReceived(long datagramId,
@NonNull SatelliteDatagram datagram, int pendingCount,
@NonNull ILongConsumer callback) {
final long callingIdentity = Binder.clearCallingIdentity();
try {
mExecutor.execute(() -> mLocalCallback.onSatelliteDatagramReceived(datagramId,
datagram, pendingCount, callback));
} finally {
restoreCallingIdentity(callingIdentity);
}
}
private void setExecutor(Executor executor) {
mExecutor = executor;
}
}
/** /**
* Called when there is an incoming datagram to be received. * Called when there is an incoming datagram to be received.
*
* @param datagramId An id that uniquely identifies incoming datagram. * @param datagramId An id that uniquely identifies incoming datagram.
* @param datagram Datagram to be received over satellite. * @param datagram Datagram to be received over satellite.
* @param pendingCount Number of datagrams yet to be received by the app. * @param pendingCount Number of datagrams yet to be received by the app.
@@ -66,19 +36,6 @@ public class SatelliteDatagramCallback {
* datagramId to Telephony. If the callback is not received within five minutes, * datagramId to Telephony. If the callback is not received within five minutes,
* Telephony will resend the datagram. * Telephony will resend the datagram.
*/ */
public void onSatelliteDatagramReceived(long datagramId, @NonNull SatelliteDatagram datagram, void onSatelliteDatagramReceived(long datagramId, @NonNull SatelliteDatagram datagram,
int pendingCount, @NonNull ILongConsumer callback) { int pendingCount, @NonNull ILongConsumer callback);
// Base Implementation
}
/** @hide */
@NonNull
final ISatelliteDatagramCallback getBinder() {
return mBinder;
}
/** @hide */
public void setExecutor(@NonNull Executor executor) {
mBinder.setExecutor(executor);
}
} }

View File

@@ -36,12 +36,15 @@ import android.telephony.SubscriptionManager;
import android.telephony.TelephonyFrameworkInitializer; import android.telephony.TelephonyFrameworkInitializer;
import com.android.internal.telephony.IIntegerConsumer; import com.android.internal.telephony.IIntegerConsumer;
import com.android.internal.telephony.ILongConsumer;
import com.android.internal.telephony.ITelephony; import com.android.internal.telephony.ITelephony;
import com.android.telephony.Rlog; import com.android.telephony.Rlog;
import java.lang.annotation.Retention; import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy; import java.lang.annotation.RetentionPolicy;
import java.time.Duration;
import java.util.Objects; import java.util.Objects;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.Executor; import java.util.concurrent.Executor;
import java.util.function.Consumer; import java.util.function.Consumer;
@@ -55,6 +58,17 @@ import java.util.function.Consumer;
public class SatelliteManager { public class SatelliteManager {
private static final String TAG = "SatelliteManager"; private static final String TAG = "SatelliteManager";
private static final ConcurrentHashMap<SatelliteDatagramCallback, ISatelliteDatagramCallback>
sSatelliteDatagramCallbackMap = new ConcurrentHashMap<>();
private static final ConcurrentHashMap<SatelliteProvisionStateCallback,
ISatelliteProvisionStateCallback> sSatelliteProvisionStateCallbackMap =
new ConcurrentHashMap<>();
private static final ConcurrentHashMap<SatelliteStateCallback, ISatelliteStateCallback>
sSatelliteStateCallbackMap = new ConcurrentHashMap<>();
private static final ConcurrentHashMap<SatelliteTransmissionUpdateCallback,
ISatelliteTransmissionUpdateCallback> sSatelliteTransmissionUpdateCallbackMap =
new ConcurrentHashMap<>();
private final int mSubId; private final int mSubId;
/** /**
@@ -66,6 +80,7 @@ public class SatelliteManager {
* Create an instance of the SatelliteManager. * Create an instance of the SatelliteManager.
* *
* @param context The context the SatelliteManager belongs to. * @param context The context the SatelliteManager belongs to.
* @hide
*/ */
public SatelliteManager(@Nullable Context context) { public SatelliteManager(@Nullable Context context) {
this(context, SubscriptionManager.DEFAULT_SUBSCRIPTION_ID); this(context, SubscriptionManager.DEFAULT_SUBSCRIPTION_ID);
@@ -116,7 +131,7 @@ public class SatelliteManager {
/** /**
* Bundle key to get the response from * Bundle key to get the response from
* {@link #requestIsSatelliteDemoModeEnabled(Executor, OutcomeReceiver)}. * {@link #requestIsDemoModeEnabled(Executor, OutcomeReceiver)}.
* @hide * @hide
*/ */
public static final String KEY_DEMO_MODE_ENABLED = "demo_mode_enabled"; public static final String KEY_DEMO_MODE_ENABLED = "demo_mode_enabled";
@@ -135,14 +150,6 @@ public class SatelliteManager {
*/ */
public static final String KEY_SATELLITE_CAPABILITIES = "satellite_capabilities"; public static final String KEY_SATELLITE_CAPABILITIES = "satellite_capabilities";
/**
* Bundle key to get the response from
* {@link #requestMaxSizePerSendingDatagram(Executor, OutcomeReceiver)} .
* @hide
*/
public static final String KEY_MAX_CHARACTERS_PER_SATELLITE_TEXT =
"max_characters_per_satellite_text";
/** /**
* Bundle key to get the response from * Bundle key to get the response from
* {@link #requestIsSatelliteProvisioned(Executor, OutcomeReceiver)}. * {@link #requestIsSatelliteProvisioned(Executor, OutcomeReceiver)}.
@@ -319,23 +326,25 @@ public class SatelliteManager {
public @interface NTRadioTechnology {} public @interface NTRadioTechnology {}
/** /**
* Request to enable or disable the satellite modem. If the satellite modem is enabled, this * Request to enable or disable the satellite modem and demo mode. If the satellite modem is
* will also disable the cellular modem, and if the satellite modem is disabled, this will also * enabled, this may also disable the cellular modem, and if the satellite modem is disabled,
* re-enable the cellular modem. * this may also re-enable the cellular modem.
* *
* @param enable {@code true} to enable the satellite modem and {@code false} to disable. * @param enableSatellite {@code true} to enable the satellite modem and
* {@code false} to disable.
* @param enableDemoMode {@code true} to enable demo mode and {@code false} to disable.
* @param executor The executor on which the error code listener will be called. * @param executor The executor on which the error code listener will be called.
* @param errorCodeListener Listener for the {@link SatelliteError} result of the operation. * @param resultListener Listener for the {@link SatelliteError} result of the operation.
* *
* @throws SecurityException if the caller doesn't have required permission. * @throws SecurityException if the caller doesn't have required permission.
* @throws IllegalStateException if the Telephony process is not currently available. * @throws IllegalStateException if the Telephony process is not currently available.
*/ */
@RequiresPermission(Manifest.permission.SATELLITE_COMMUNICATION) @RequiresPermission(Manifest.permission.SATELLITE_COMMUNICATION)
public void requestSatelliteEnabled( public void requestSatelliteEnabled(boolean enableSatellite, boolean enableDemoMode,
boolean enable, @NonNull @CallbackExecutor Executor executor, @NonNull @CallbackExecutor Executor executor,
@NonNull Consumer<Integer> errorCodeListener) { @SatelliteError @NonNull Consumer<Integer> resultListener) {
Objects.requireNonNull(executor); Objects.requireNonNull(executor);
Objects.requireNonNull(errorCodeListener); Objects.requireNonNull(resultListener);
try { try {
ITelephony telephony = getITelephony(); ITelephony telephony = getITelephony();
@@ -344,10 +353,11 @@ public class SatelliteManager {
@Override @Override
public void accept(int result) { public void accept(int result) {
executor.execute(() -> Binder.withCleanCallingIdentity( executor.execute(() -> Binder.withCleanCallingIdentity(
() -> errorCodeListener.accept(result))); () -> resultListener.accept(result)));
} }
}; };
telephony.requestSatelliteEnabled(mSubId, enable, errorCallback); telephony.requestSatelliteEnabled(mSubId, enableSatellite, enableDemoMode,
errorCallback);
} else { } else {
throw new IllegalStateException("telephony service is null."); throw new IllegalStateException("telephony service is null.");
} }
@@ -411,51 +421,14 @@ public class SatelliteManager {
} }
} }
/**
* Request to enable or disable the satellite service demo mode.
*
* @param enable {@code true} to enable the satellite demo mode and {@code false} to disable.
* @param executor The executor on which the error code listener will be called.
* @param errorCodeListener Listener for the {@link SatelliteError} result of the operation.
*
* @throws SecurityException if the caller doesn't have required permission.
* @throws IllegalStateException if the Telephony process is not currently available.
*/
@RequiresPermission(Manifest.permission.SATELLITE_COMMUNICATION)
public void requestSatelliteDemoModeEnabled(boolean enable,
@NonNull @CallbackExecutor Executor executor,
@NonNull Consumer<Integer> errorCodeListener) {
Objects.requireNonNull(executor);
Objects.requireNonNull(errorCodeListener);
try {
ITelephony telephony = getITelephony();
if (telephony != null) {
IIntegerConsumer errorCallback = new IIntegerConsumer.Stub() {
@Override
public void accept(int result) {
executor.execute(() -> Binder.withCleanCallingIdentity(
() -> errorCodeListener.accept(result)));
}
};
telephony.requestSatelliteDemoModeEnabled(mSubId, enable, errorCallback);
} else {
throw new IllegalStateException("telephony service is null.");
}
} catch (RemoteException ex) {
Rlog.e(TAG, "requestSatelliteDemoModeEnabled() RemoteException: ", ex);
ex.rethrowFromSystemServer();
}
}
/** /**
* Request to get whether the satellite service demo mode is enabled. * Request to get whether the satellite service demo mode is enabled.
* *
* @param executor The executor on which the callback will be called. * @param executor The executor on which the callback will be called.
* @param callback The callback object to which the result will be delivered. * @param callback The callback object to which the result will be delivered.
* If the request is successful, {@link OutcomeReceiver#onResult(Object)} * If the request is successful, {@link OutcomeReceiver#onResult(Object)}
* will return a {@code boolean} with value {@code true} if the satellite * will return a {@code boolean} with value {@code true} if demo mode is enabled
* demo mode is enabled and {@code false} otherwise. * and {@code false} otherwise.
* If the request is not successful, {@link OutcomeReceiver#onError(Throwable)} * If the request is not successful, {@link OutcomeReceiver#onError(Throwable)}
* will return a {@link SatelliteException} with the {@link SatelliteError}. * will return a {@link SatelliteException} with the {@link SatelliteError}.
* *
@@ -463,7 +436,7 @@ public class SatelliteManager {
* @throws IllegalStateException if the Telephony process is not currently available. * @throws IllegalStateException if the Telephony process is not currently available.
*/ */
@RequiresPermission(Manifest.permission.SATELLITE_COMMUNICATION) @RequiresPermission(Manifest.permission.SATELLITE_COMMUNICATION)
public void requestIsSatelliteDemoModeEnabled(@NonNull @CallbackExecutor Executor executor, public void requestIsDemoModeEnabled(@NonNull @CallbackExecutor Executor executor,
@NonNull OutcomeReceiver<Boolean, SatelliteException> callback) { @NonNull OutcomeReceiver<Boolean, SatelliteException> callback) {
Objects.requireNonNull(executor); Objects.requireNonNull(executor);
Objects.requireNonNull(callback); Objects.requireNonNull(callback);
@@ -492,12 +465,12 @@ public class SatelliteManager {
} }
} }
}; };
telephony.requestIsSatelliteDemoModeEnabled(mSubId, receiver); telephony.requestIsDemoModeEnabled(mSubId, receiver);
} else { } else {
throw new IllegalStateException("telephony service is null."); throw new IllegalStateException("telephony service is null.");
} }
} catch (RemoteException ex) { } catch (RemoteException ex) {
loge("requestIsSatelliteDemoModeEnabled() RemoteException: " + ex); loge("requestIsDemoModeEnabled() RemoteException: " + ex);
ex.rethrowFromSystemServer(); ex.rethrowFromSystemServer();
} }
} }
@@ -742,145 +715,117 @@ public class SatelliteManager {
public @interface DatagramType {} public @interface DatagramType {}
/** /**
* Start receiving satellite position updates. * Start receiving satellite transmission updates.
* This can be called by the pointing UI when the user starts pointing to the satellite. * This can be called by the pointing UI when the user starts pointing to the satellite.
* Modem should continue to report the pointing input as the device or satellite moves. * Modem should continue to report the pointing input as the device or satellite moves.
* Satellite position updates are started only on {@link #SATELLITE_ERROR_NONE}. * Satellite transmission updates are started only on {@link #SATELLITE_ERROR_NONE}.
* All other results indicate that this operation failed. * All other results indicate that this operation failed.
* Once satellite position updates begin, datagram transfer state updates will be sent * Once satellite transmission updates begin, position and datagram transfer state updates
* through {@link SatellitePositionUpdateCallback}. * will be sent through {@link SatelliteTransmissionUpdateCallback}.
* *
* @param executor The executor on which the callback and error code listener will be called. * @param executor The executor on which the callback and error code listener will be called.
* @param errorCodeListener Listener for the {@link SatelliteError} result of the operation. * @param resultListener Listener for the {@link SatelliteError} result of the operation.
* @param callback The callback to notify of changes in satellite position. * @param callback The callback to notify of satellite transmission updates.
* *
* @throws SecurityException if the caller doesn't have required permission. * @throws SecurityException if the caller doesn't have required permission.
* @throws IllegalStateException if the Telephony process is not currently available. * @throws IllegalStateException if the Telephony process is not currently available.
*/ */
@RequiresPermission(Manifest.permission.SATELLITE_COMMUNICATION) @RequiresPermission(Manifest.permission.SATELLITE_COMMUNICATION)
public void startSatellitePositionUpdates(@NonNull @CallbackExecutor Executor executor, public void startSatelliteTransmissionUpdates(@NonNull @CallbackExecutor Executor executor,
@NonNull Consumer<Integer> errorCodeListener, @SatelliteError @NonNull Consumer<Integer> resultListener,
@NonNull SatellitePositionUpdateCallback callback) { @NonNull SatelliteTransmissionUpdateCallback callback) {
Objects.requireNonNull(executor); Objects.requireNonNull(executor);
Objects.requireNonNull(errorCodeListener); Objects.requireNonNull(resultListener);
Objects.requireNonNull(callback); Objects.requireNonNull(callback);
try { try {
ITelephony telephony = getITelephony(); ITelephony telephony = getITelephony();
if (telephony != null) { if (telephony != null) {
callback.setExecutor(executor);
IIntegerConsumer errorCallback = new IIntegerConsumer.Stub() { IIntegerConsumer errorCallback = new IIntegerConsumer.Stub() {
@Override @Override
public void accept(int result) { public void accept(int result) {
executor.execute(() -> Binder.withCleanCallingIdentity( executor.execute(() -> Binder.withCleanCallingIdentity(
() -> errorCodeListener.accept(result))); () -> resultListener.accept(result)));
} }
}; };
telephony.startSatellitePositionUpdates( ISatelliteTransmissionUpdateCallback internalCallback =
mSubId, errorCallback, callback.getBinder()); new ISatelliteTransmissionUpdateCallback.Stub() {
@Override
public void onDatagramTransferStateChanged(int state,
int sendPendingCount, int receivePendingCount, int errorCode) {
executor.execute(() -> Binder.withCleanCallingIdentity(
() -> callback.onDatagramTransferStateChanged(
state, sendPendingCount, receivePendingCount,
errorCode)));
}
@Override
public void onSatellitePositionChanged(PointingInfo pointingInfo) {
executor.execute(() -> Binder.withCleanCallingIdentity(
() -> callback.onSatellitePositionChanged(pointingInfo)));
}
};
sSatelliteTransmissionUpdateCallbackMap.put(callback, internalCallback);
telephony.startSatelliteTransmissionUpdates(mSubId, errorCallback,
internalCallback);
} else { } else {
throw new IllegalStateException("telephony service is null."); throw new IllegalStateException("telephony service is null.");
} }
} catch (RemoteException ex) { } catch (RemoteException ex) {
loge("startSatellitePositionUpdates() RemoteException: " + ex); loge("startSatelliteTransmissionUpdates() RemoteException: " + ex);
ex.rethrowFromSystemServer(); ex.rethrowFromSystemServer();
} }
} }
/** /**
* Stop receiving satellite position updates. * Stop receiving satellite transmission updates.
* This can be called by the pointing UI when the user stops pointing to the satellite. * This can be called by the pointing UI when the user stops pointing to the satellite.
* Satellite position updates are stopped and the callback is unregistered only on * Satellite transmission updates are stopped and the callback is unregistered only on
* {@link #SATELLITE_ERROR_NONE}. All other results that this operation failed. * {@link #SATELLITE_ERROR_NONE}. All other results that this operation failed.
* *
* @param callback The callback that was passed to * @param callback The callback that was passed to {@link
* {@link #startSatellitePositionUpdates(Executor, Consumer, SatellitePositionUpdateCallback)}. * #startSatelliteTransmissionUpdates(Executor, Consumer, SatelliteTransmissionUpdateCallback)}.
* @param executor The executor on which the error code listener will be called. * @param executor The executor on which the error code listener will be called.
* @param errorCodeListener Listener for the {@link SatelliteError} result of the operation. * @param resultListener Listener for the {@link SatelliteError} result of the operation.
* *
* @throws SecurityException if the caller doesn't have required permission. * @throws SecurityException if the caller doesn't have required permission.
* @throws IllegalStateException if the Telephony process is not currently available. * @throws IllegalStateException if the Telephony process is not currently available.
*/ */
@RequiresPermission(Manifest.permission.SATELLITE_COMMUNICATION) @RequiresPermission(Manifest.permission.SATELLITE_COMMUNICATION)
public void stopSatellitePositionUpdates(@NonNull SatellitePositionUpdateCallback callback, public void stopSatelliteTransmissionUpdates(
@NonNull SatelliteTransmissionUpdateCallback callback,
@NonNull @CallbackExecutor Executor executor, @NonNull @CallbackExecutor Executor executor,
@NonNull Consumer<Integer> errorCodeListener) { @SatelliteError @NonNull Consumer<Integer> resultListener) {
Objects.requireNonNull(callback); Objects.requireNonNull(callback);
Objects.requireNonNull(executor); Objects.requireNonNull(executor);
Objects.requireNonNull(errorCodeListener); Objects.requireNonNull(resultListener);
ISatelliteTransmissionUpdateCallback internalCallback =
sSatelliteTransmissionUpdateCallbackMap.remove(callback);
try { try {
ITelephony telephony = getITelephony(); ITelephony telephony = getITelephony();
if (telephony != null) { if (telephony != null) {
IIntegerConsumer errorCallback = new IIntegerConsumer.Stub() { if (internalCallback != null) {
@Override IIntegerConsumer errorCallback = new IIntegerConsumer.Stub() {
public void accept(int result) { @Override
executor.execute(() -> Binder.withCleanCallingIdentity( public void accept(int result) {
() -> errorCodeListener.accept(result))); executor.execute(() -> Binder.withCleanCallingIdentity(
} () -> resultListener.accept(result)));
};
telephony.stopSatellitePositionUpdates(mSubId, errorCallback,
callback.getBinder());
// TODO: Notify SmsHandler that pointing UI stopped
} else {
throw new IllegalStateException("telephony service is null.");
}
} catch (RemoteException ex) {
loge("stopSatellitePositionUpdates() RemoteException: " + ex);
ex.rethrowFromSystemServer();
}
}
/**
* Request to get the maximum number of bytes per datagram that can be sent to satellite.
*
* @param executor The executor on which the callback will be called.
* @param callback The callback object to which the result will be delivered.
* If the request is successful, {@link OutcomeReceiver#onResult(Object)}
* will return the maximum number of bytes per datagram that can be sent to
* satellite.
* If the request is not successful, {@link OutcomeReceiver#onError(Throwable)}
*
* @throws SecurityException if the caller doesn't have required permission.
* @throws IllegalStateException if the Telephony process is not currently available.
*/
@RequiresPermission(Manifest.permission.SATELLITE_COMMUNICATION)
public void requestMaxSizePerSendingDatagram(
@NonNull @CallbackExecutor Executor executor,
@NonNull OutcomeReceiver<Integer, SatelliteException> callback) {
Objects.requireNonNull(executor);
Objects.requireNonNull(callback);
try {
ITelephony telephony = getITelephony();
if (telephony != null) {
ResultReceiver receiver = new ResultReceiver(null) {
@Override
protected void onReceiveResult(int resultCode, Bundle resultData) {
if (resultCode == SATELLITE_ERROR_NONE) {
if (resultData.containsKey(KEY_MAX_CHARACTERS_PER_SATELLITE_TEXT)) {
int maxCharacters =
resultData.getInt(KEY_MAX_CHARACTERS_PER_SATELLITE_TEXT);
executor.execute(() -> Binder.withCleanCallingIdentity(() ->
callback.onResult(maxCharacters)));
} else {
loge("KEY_MAX_CHARACTERS_PER_SATELLITE_TEXT does not exist.");
executor.execute(() -> Binder.withCleanCallingIdentity(() ->
callback.onError(
new SatelliteException(SATELLITE_REQUEST_FAILED))));
}
} else {
executor.execute(() -> Binder.withCleanCallingIdentity(() ->
callback.onError(new SatelliteException(resultCode))));
} }
} };
}; telephony.stopSatelliteTransmissionUpdates(mSubId, errorCallback,
telephony.requestMaxSizePerSendingDatagram(mSubId, receiver); internalCallback);
// TODO: Notify SmsHandler that pointing UI stopped
} else {
loge("stopSatelliteTransmissionUpdates: No internal callback.");
executor.execute(() -> Binder.withCleanCallingIdentity(
() -> resultListener.accept(SATELLITE_INVALID_ARGUMENTS)));
}
} else { } else {
throw new IllegalStateException("telephony service is null."); throw new IllegalStateException("telephony service is null.");
} }
} catch (RemoteException ex) { } catch (RemoteException ex) {
loge("requestMaxCharactersPerSatelliteTextMessage() RemoteException: " + ex); loge("stopSatelliteTransmissionUpdates() RemoteException: " + ex);
ex.rethrowFromSystemServer(); ex.rethrowFromSystemServer();
} }
} }
@@ -891,23 +836,24 @@ public class SatelliteManager {
* *
* @param token The token to be used as a unique identifier for provisioning with satellite * @param token The token to be used as a unique identifier for provisioning with satellite
* gateway. * gateway.
* @param regionId The region ID for the device's current location.
* @param cancellationSignal The optional signal used by the caller to cancel the provision * @param cancellationSignal The optional signal used by the caller to cancel the provision
* request. Even when the cancellation is signaled, Telephony will * request. Even when the cancellation is signaled, Telephony will
* still trigger the callback to return the result of this request. * still trigger the callback to return the result of this request.
* @param executor The executor on which the error code listener will be called. * @param executor The executor on which the error code listener will be called.
* @param errorCodeListener Listener for the {@link SatelliteError} result of the operation. * @param resultListener Listener for the {@link SatelliteError} result of the operation.
* *
* @throws SecurityException if the caller doesn't have required permission. * @throws SecurityException if the caller doesn't have required permission.
* @throws IllegalStateException if the Telephony process is not currently available. * @throws IllegalStateException if the Telephony process is not currently available.
*/ */
@RequiresPermission(Manifest.permission.SATELLITE_COMMUNICATION) @RequiresPermission(Manifest.permission.SATELLITE_COMMUNICATION)
public void provisionSatelliteService(@NonNull String token, public void provisionSatelliteService(@NonNull String token, @NonNull String regionId,
@Nullable CancellationSignal cancellationSignal, @Nullable CancellationSignal cancellationSignal,
@NonNull @CallbackExecutor Executor executor, @NonNull @CallbackExecutor Executor executor,
@SatelliteError @NonNull Consumer<Integer> errorCodeListener) { @SatelliteError @NonNull Consumer<Integer> resultListener) {
Objects.requireNonNull(token); Objects.requireNonNull(token);
Objects.requireNonNull(executor); Objects.requireNonNull(executor);
Objects.requireNonNull(errorCodeListener); Objects.requireNonNull(resultListener);
ICancellationSignal cancelRemote = null; ICancellationSignal cancelRemote = null;
try { try {
@@ -917,10 +863,11 @@ public class SatelliteManager {
@Override @Override
public void accept(int result) { public void accept(int result) {
executor.execute(() -> Binder.withCleanCallingIdentity( executor.execute(() -> Binder.withCleanCallingIdentity(
() -> errorCodeListener.accept(result))); () -> resultListener.accept(result)));
} }
}; };
cancelRemote = telephony.provisionSatelliteService(mSubId, token, errorCallback); cancelRemote = telephony.provisionSatelliteService(mSubId, token, regionId,
errorCallback);
} else { } else {
throw new IllegalStateException("telephony service is null."); throw new IllegalStateException("telephony service is null.");
} }
@@ -942,7 +889,7 @@ public class SatelliteManager {
* {@link #provisionSatelliteService(String, CancellationSignal, Executor, Consumer)}. * {@link #provisionSatelliteService(String, CancellationSignal, Executor, Consumer)}.
* *
* @param token The token of the device/subscription to be deprovisioned. * @param token The token of the device/subscription to be deprovisioned.
* @param errorCodeListener Listener for the {@link SatelliteError} result of the operation. * @param resultListener Listener for the {@link SatelliteError} result of the operation.
* *
* @throws SecurityException if the caller doesn't have required permission. * @throws SecurityException if the caller doesn't have required permission.
* @throws IllegalStateException if the Telephony process is not currently available. * @throws IllegalStateException if the Telephony process is not currently available.
@@ -950,10 +897,10 @@ public class SatelliteManager {
@RequiresPermission(Manifest.permission.SATELLITE_COMMUNICATION) @RequiresPermission(Manifest.permission.SATELLITE_COMMUNICATION)
public void deprovisionSatelliteService(@NonNull String token, public void deprovisionSatelliteService(@NonNull String token,
@NonNull @CallbackExecutor Executor executor, @NonNull @CallbackExecutor Executor executor,
@SatelliteError @NonNull Consumer<Integer> errorCodeListener) { @SatelliteError @NonNull Consumer<Integer> resultListener) {
Objects.requireNonNull(token); Objects.requireNonNull(token);
Objects.requireNonNull(executor); Objects.requireNonNull(executor);
Objects.requireNonNull(errorCodeListener); Objects.requireNonNull(resultListener);
try { try {
ITelephony telephony = getITelephony(); ITelephony telephony = getITelephony();
@@ -962,7 +909,7 @@ public class SatelliteManager {
@Override @Override
public void accept(int result) { public void accept(int result) {
executor.execute(() -> Binder.withCleanCallingIdentity( executor.execute(() -> Binder.withCleanCallingIdentity(
() -> errorCodeListener.accept(result))); () -> resultListener.accept(result)));
} }
}; };
telephony.deprovisionSatelliteService(mSubId, token, errorCallback); telephony.deprovisionSatelliteService(mSubId, token, errorCallback);
@@ -996,9 +943,18 @@ public class SatelliteManager {
try { try {
ITelephony telephony = getITelephony(); ITelephony telephony = getITelephony();
if (telephony != null) { if (telephony != null) {
callback.setExecutor(executor); ISatelliteProvisionStateCallback internalCallback =
new ISatelliteProvisionStateCallback.Stub() {
@Override
public void onSatelliteProvisionStateChanged(boolean provisioned) {
executor.execute(() -> Binder.withCleanCallingIdentity(
() -> callback.onSatelliteProvisionStateChanged(
provisioned)));
}
};
sSatelliteProvisionStateCallbackMap.put(callback, internalCallback);
return telephony.registerForSatelliteProvisionStateChanged( return telephony.registerForSatelliteProvisionStateChanged(
mSubId, callback.getBinder()); mSubId, internalCallback);
} else { } else {
throw new IllegalStateException("telephony service is null."); throw new IllegalStateException("telephony service is null.");
} }
@@ -1023,11 +979,17 @@ public class SatelliteManager {
public void unregisterForSatelliteProvisionStateChanged( public void unregisterForSatelliteProvisionStateChanged(
@NonNull SatelliteProvisionStateCallback callback) { @NonNull SatelliteProvisionStateCallback callback) {
Objects.requireNonNull(callback); Objects.requireNonNull(callback);
ISatelliteProvisionStateCallback internalCallback =
sSatelliteProvisionStateCallbackMap.remove(callback);
try { try {
ITelephony telephony = getITelephony(); ITelephony telephony = getITelephony();
if (telephony != null) { if (telephony != null) {
telephony.unregisterForSatelliteProvisionStateChanged(mSubId, callback.getBinder()); if (internalCallback != null) {
telephony.unregisterForSatelliteProvisionStateChanged(mSubId, internalCallback);
} else {
loge("unregisterForSatelliteProvisionStateChanged: No internal callback.");
}
} else { } else {
throw new IllegalStateException("telephony service is null."); throw new IllegalStateException("telephony service is null.");
} }
@@ -1112,9 +1074,15 @@ public class SatelliteManager {
try { try {
ITelephony telephony = getITelephony(); ITelephony telephony = getITelephony();
if (telephony != null) { if (telephony != null) {
callback.setExecutor(executor); ISatelliteStateCallback internalCallback = new ISatelliteStateCallback.Stub() {
return telephony.registerForSatelliteModemStateChanged(mSubId, @Override
callback.getBinder()); public void onSatelliteModemStateChanged(int state) {
executor.execute(() -> Binder.withCleanCallingIdentity(() ->
callback.onSatelliteModemStateChanged(state)));
}
};
sSatelliteStateCallbackMap.put(callback, internalCallback);
return telephony.registerForSatelliteModemStateChanged(mSubId, internalCallback);
} else { } else {
throw new IllegalStateException("telephony service is null."); throw new IllegalStateException("telephony service is null.");
} }
@@ -1138,11 +1106,16 @@ public class SatelliteManager {
@RequiresPermission(Manifest.permission.SATELLITE_COMMUNICATION) @RequiresPermission(Manifest.permission.SATELLITE_COMMUNICATION)
public void unregisterForSatelliteModemStateChanged(@NonNull SatelliteStateCallback callback) { public void unregisterForSatelliteModemStateChanged(@NonNull SatelliteStateCallback callback) {
Objects.requireNonNull(callback); Objects.requireNonNull(callback);
ISatelliteStateCallback internalCallback = sSatelliteStateCallbackMap.remove(callback);
try { try {
ITelephony telephony = getITelephony(); ITelephony telephony = getITelephony();
if (telephony != null) { if (telephony != null) {
telephony.unregisterForSatelliteModemStateChanged(mSubId, callback.getBinder()); if (internalCallback != null) {
telephony.unregisterForSatelliteModemStateChanged(mSubId, internalCallback);
} else {
loge("unregisterForSatelliteModemStateChanged: No internal callback.");
}
} else { } else {
throw new IllegalStateException("telephony service is null."); throw new IllegalStateException("telephony service is null.");
} }
@@ -1155,8 +1128,6 @@ public class SatelliteManager {
/** /**
* Register to receive incoming datagrams over satellite. * Register to receive incoming datagrams over satellite.
* *
* @param datagramType datagram type indicating whether the datagram is of type
* SOS_SMS or LOCATION_SHARING.
* @param executor The executor on which the callback will be called. * @param executor The executor on which the callback will be called.
* @param callback The callback to handle incoming datagrams over satellite. * @param callback The callback to handle incoming datagrams over satellite.
* This callback with be invoked when a new datagram is received from satellite. * This callback with be invoked when a new datagram is received from satellite.
@@ -1167,7 +1138,7 @@ public class SatelliteManager {
* @throws IllegalStateException if the Telephony process is not currently available. * @throws IllegalStateException if the Telephony process is not currently available.
*/ */
@RequiresPermission(Manifest.permission.SATELLITE_COMMUNICATION) @RequiresPermission(Manifest.permission.SATELLITE_COMMUNICATION)
@SatelliteError public int registerForSatelliteDatagram(@DatagramType int datagramType, @SatelliteError public int registerForSatelliteDatagram(
@NonNull @CallbackExecutor Executor executor, @NonNull @CallbackExecutor Executor executor,
@NonNull SatelliteDatagramCallback callback) { @NonNull SatelliteDatagramCallback callback) {
Objects.requireNonNull(executor); Objects.requireNonNull(executor);
@@ -1176,9 +1147,19 @@ public class SatelliteManager {
try { try {
ITelephony telephony = getITelephony(); ITelephony telephony = getITelephony();
if (telephony != null) { if (telephony != null) {
callback.setExecutor(executor); ISatelliteDatagramCallback internalCallback =
return telephony.registerForSatelliteDatagram(mSubId, datagramType, new ISatelliteDatagramCallback.Stub() {
callback.getBinder()); @Override
public void onSatelliteDatagramReceived(long datagramId,
@NonNull SatelliteDatagram datagram, int pendingCount,
@NonNull ILongConsumer ack) {
executor.execute(() -> Binder.withCleanCallingIdentity(
() -> callback.onSatelliteDatagramReceived(
datagramId, datagram, pendingCount, ack)));
}
};
sSatelliteDatagramCallbackMap.put(callback, internalCallback);
return telephony.registerForSatelliteDatagram(mSubId, internalCallback);
} else { } else {
throw new IllegalStateException("telephony service is null."); throw new IllegalStateException("telephony service is null.");
} }
@@ -1194,7 +1175,7 @@ public class SatelliteManager {
* If callback was not registered before, the request will be ignored. * If callback was not registered before, the request will be ignored.
* *
* @param callback The callback that was passed to * @param callback The callback that was passed to
* {@link #registerForSatelliteDatagram(int, Executor, SatelliteDatagramCallback)}. * {@link #registerForSatelliteDatagram(Executor, SatelliteDatagramCallback)}.
* *
* @throws SecurityException if the caller doesn't have required permission. * @throws SecurityException if the caller doesn't have required permission.
* @throws IllegalStateException if the Telephony process is not currently available. * @throws IllegalStateException if the Telephony process is not currently available.
@@ -1202,11 +1183,17 @@ public class SatelliteManager {
@RequiresPermission(Manifest.permission.SATELLITE_COMMUNICATION) @RequiresPermission(Manifest.permission.SATELLITE_COMMUNICATION)
public void unregisterForSatelliteDatagram(@NonNull SatelliteDatagramCallback callback) { public void unregisterForSatelliteDatagram(@NonNull SatelliteDatagramCallback callback) {
Objects.requireNonNull(callback); Objects.requireNonNull(callback);
ISatelliteDatagramCallback internalCallback =
sSatelliteDatagramCallbackMap.remove(callback);
try { try {
ITelephony telephony = getITelephony(); ITelephony telephony = getITelephony();
if (telephony != null) { if (telephony != null) {
telephony.unregisterForSatelliteDatagram(mSubId, callback.getBinder()); if (internalCallback != null) {
telephony.unregisterForSatelliteDatagram(mSubId, internalCallback);
} else {
loge("unregisterForSatelliteDatagram: No internal callback.");
}
} else { } else {
throw new IllegalStateException("telephony service is null."); throw new IllegalStateException("telephony service is null.");
} }
@@ -1222,7 +1209,7 @@ public class SatelliteManager {
* This method requests modem to check if there are any pending datagrams to be received over * This method requests modem to check if there are any pending datagrams to be received over
* satellite. If there are any incoming datagrams, they will be received via * satellite. If there are any incoming datagrams, they will be received via
* {@link SatelliteDatagramCallback#onSatelliteDatagramReceived(long, SatelliteDatagram, int, * {@link SatelliteDatagramCallback#onSatelliteDatagramReceived(long, SatelliteDatagram, int,
* ISatelliteDatagramReceiverAck)} * ILongConsumer)}
* *
* @param executor The executor on which the result listener will be called. * @param executor The executor on which the result listener will be called.
* @param resultListener Listener for the {@link SatelliteError} result of the operation. * @param resultListener Listener for the {@link SatelliteError} result of the operation.
@@ -1371,9 +1358,8 @@ public class SatelliteManager {
} }
/** /**
* Request to get the time after which the satellite will be visible. This is an * Request to get the duration in seconds after which the satellite will be visible.
* {@code int} representing the duration in seconds after which the satellite will be visible. * This will be {@link Duration#ZERO} if the satellite is currently visible.
* This will return {@code 0} if the satellite is currently visible.
* *
* @param executor The executor on which the callback will be called. * @param executor The executor on which the callback will be called.
* @param callback The callback object to which the result will be delivered. * @param callback The callback object to which the result will be delivered.
@@ -1387,7 +1373,7 @@ public class SatelliteManager {
*/ */
@RequiresPermission(Manifest.permission.SATELLITE_COMMUNICATION) @RequiresPermission(Manifest.permission.SATELLITE_COMMUNICATION)
public void requestTimeForNextSatelliteVisibility(@NonNull @CallbackExecutor Executor executor, public void requestTimeForNextSatelliteVisibility(@NonNull @CallbackExecutor Executor executor,
@NonNull OutcomeReceiver<Integer, SatelliteException> callback) { @NonNull OutcomeReceiver<Duration, SatelliteException> callback) {
Objects.requireNonNull(executor); Objects.requireNonNull(executor);
Objects.requireNonNull(callback); Objects.requireNonNull(callback);
@@ -1402,7 +1388,8 @@ public class SatelliteManager {
int nextVisibilityDuration = int nextVisibilityDuration =
resultData.getInt(KEY_SATELLITE_NEXT_VISIBILITY); resultData.getInt(KEY_SATELLITE_NEXT_VISIBILITY);
executor.execute(() -> Binder.withCleanCallingIdentity(() -> executor.execute(() -> Binder.withCleanCallingIdentity(() ->
callback.onResult(nextVisibilityDuration))); callback.onResult(
Duration.ofSeconds(nextVisibilityDuration))));
} else { } else {
loge("KEY_SATELLITE_NEXT_VISIBILITY does not exist."); loge("KEY_SATELLITE_NEXT_VISIBILITY does not exist.");
executor.execute(() -> Binder.withCleanCallingIdentity(() -> executor.execute(() -> Binder.withCleanCallingIdentity(() ->

View File

@@ -1,104 +0,0 @@
/*
* Copyright (C) 2023 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package android.telephony.satellite;
import android.annotation.NonNull;
import android.os.Binder;
import java.util.concurrent.Executor;
/**
* A callback class for monitoring satellite position update and datagram transfer state change
* events.
*
* @hide
*/
public class SatellitePositionUpdateCallback {
private final CallbackBinder mBinder = new CallbackBinder(this);
private static class CallbackBinder extends ISatellitePositionUpdateCallback.Stub {
private final SatellitePositionUpdateCallback mLocalCallback;
private Executor mExecutor;
private CallbackBinder(SatellitePositionUpdateCallback localCallback) {
mLocalCallback = localCallback;
}
@Override
public void onSatellitePositionChanged(@NonNull PointingInfo pointingInfo) {
final long callingIdentity = Binder.clearCallingIdentity();
try {
mExecutor.execute(() ->
mLocalCallback.onSatellitePositionChanged(pointingInfo));
} finally {
restoreCallingIdentity(callingIdentity);
}
}
@Override
public void onDatagramTransferStateChanged(
@SatelliteManager.SatelliteDatagramTransferState int state, int sendPendingCount,
int receivePendingCount, @SatelliteManager.SatelliteError int errorCode) {
final long callingIdentity = Binder.clearCallingIdentity();
try {
mExecutor.execute(() ->
mLocalCallback.onDatagramTransferStateChanged(
state, sendPendingCount, receivePendingCount, errorCode));
} finally {
restoreCallingIdentity(callingIdentity);
}
}
private void setExecutor(Executor executor) {
mExecutor = executor;
}
}
/**
* Called when the satellite position changed.
*
* @param pointingInfo The pointing info containing the satellite location.
*/
public void onSatellitePositionChanged(@NonNull PointingInfo pointingInfo) {
// Base Implementation
}
/**
* Called when satellite datagram transfer state changed.
*
* @param state The new datagram transfer state.
* @param sendPendingCount The number of datagrams that are currently being sent.
* @param receivePendingCount The number of datagrams that are currently being received.
* @param errorCode If datagram transfer failed, the reason for failure.
*/
public void onDatagramTransferStateChanged(
@SatelliteManager.SatelliteDatagramTransferState int state, int sendPendingCount,
int receivePendingCount, @SatelliteManager.SatelliteError int errorCode) {
// Base Implementation
}
/**@hide*/
@NonNull
final ISatellitePositionUpdateCallback getBinder() {
return mBinder;
}
/**@hide*/
public void setExecutor(@NonNull Executor executor) {
mBinder.setExecutor(executor);
}
}

View File

@@ -16,61 +16,17 @@
package android.telephony.satellite; package android.telephony.satellite;
import android.annotation.NonNull;
import android.os.Binder;
import java.util.concurrent.Executor;
/** /**
* A callback class for monitoring satellite provision state change events. * A callback class for monitoring satellite provision state change events.
* *
* @hide * @hide
*/ */
public class SatelliteProvisionStateCallback { public interface SatelliteProvisionStateCallback {
private final CallbackBinder mBinder = new CallbackBinder(this);
private static class CallbackBinder extends ISatelliteProvisionStateCallback.Stub {
private final SatelliteProvisionStateCallback mLocalCallback;
private Executor mExecutor;
private CallbackBinder(SatelliteProvisionStateCallback localCallback) {
mLocalCallback = localCallback;
}
@Override
public void onSatelliteProvisionStateChanged(boolean provisioned) {
final long callingIdentity = Binder.clearCallingIdentity();
try {
mExecutor.execute(() ->
mLocalCallback.onSatelliteProvisionStateChanged(provisioned));
} finally {
restoreCallingIdentity(callingIdentity);
}
}
private void setExecutor(Executor executor) {
mExecutor = executor;
}
}
/** /**
* Called when satellite provision state changes. * Called when satellite provision state changes.
* *
* @param provisioned The new provision state. {@code true} means satellite is provisioned * @param provisioned The new provision state. {@code true} means satellite is provisioned
* {@code false} means satellite is not provisioned. * {@code false} means satellite is not provisioned.
*/ */
public void onSatelliteProvisionStateChanged(boolean provisioned) { void onSatelliteProvisionStateChanged(boolean provisioned);
// Base Implementation
}
/**@hide*/
@NonNull
final ISatelliteProvisionStateCallback getBinder() {
return mBinder;
}
/**@hide*/
public void setExecutor(@NonNull Executor executor) {
mBinder.setExecutor(executor);
}
} }

View File

@@ -16,80 +16,15 @@
package android.telephony.satellite; package android.telephony.satellite;
import android.annotation.NonNull;
import android.os.Binder;
import java.util.concurrent.Executor;
/** /**
* A callback class for monitoring satellite modem state change events. * A callback class for monitoring satellite modem state change events.
* *
* @hide * @hide
*/ */
public class SatelliteStateCallback { public interface SatelliteStateCallback {
private final CallbackBinder mBinder = new CallbackBinder(this);
private static class CallbackBinder extends ISatelliteStateCallback.Stub {
private final SatelliteStateCallback mLocalCallback;
private Executor mExecutor;
private CallbackBinder(SatelliteStateCallback localCallback) {
mLocalCallback = localCallback;
}
@Override
public void onSatelliteModemStateChanged(@SatelliteManager.SatelliteModemState int state) {
final long callingIdentity = Binder.clearCallingIdentity();
try {
mExecutor.execute(() ->
mLocalCallback.onSatelliteModemStateChanged(state));
} finally {
restoreCallingIdentity(callingIdentity);
}
}
@Override
public void onPendingDatagramCount(int count) {
final long callingIdentity = Binder.clearCallingIdentity();
try {
mExecutor.execute(() ->
mLocalCallback.onPendingDatagramCount(count));
} finally {
restoreCallingIdentity(callingIdentity);
}
}
private void setExecutor(Executor executor) {
mExecutor = executor;
}
}
/** /**
* Called when satellite modem state changes. * Called when satellite modem state changes.
* @param state The new satellite modem state. * @param state The new satellite modem state.
*/ */
public void onSatelliteModemStateChanged(@SatelliteManager.SatelliteModemState int state) { void onSatelliteModemStateChanged(@SatelliteManager.SatelliteModemState int state);
// Base Implementation
}
/**
* Called when there are pending datagrams to be received from satellite.
* @param count Pending datagram count.
*/
public void onPendingDatagramCount(int count) {
// Base Implementation
}
//TODO: Add an API for datagram transfer state update here.
/**@hide*/
@NonNull
final ISatelliteStateCallback getBinder() {
return mBinder;
}
/**@hide*/
public void setExecutor(@NonNull Executor executor) {
mBinder.setExecutor(executor);
}
} }

View File

@@ -0,0 +1,46 @@
/*
* Copyright (C) 2023 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package android.telephony.satellite;
import android.annotation.NonNull;
/**
* A callback class for monitoring satellite position update and datagram transfer state change
* events.
*
* @hide
*/
public interface SatelliteTransmissionUpdateCallback {
/**
* Called when the satellite position changed.
*
* @param pointingInfo The pointing info containing the satellite location.
*/
void onSatellitePositionChanged(@NonNull PointingInfo pointingInfo);
/**
* Called when satellite datagram transfer state changed.
*
* @param state The new datagram transfer state.
* @param sendPendingCount The number of datagrams that are currently being sent.
* @param receivePendingCount The number of datagrams that are currently being received.
* @param errorCode If datagram transfer failed, the reason for failure.
*/
void onDatagramTransferStateChanged(@SatelliteManager.SatelliteDatagramTransferState int state,
int sendPendingCount, int receivePendingCount,
@SatelliteManager.SatelliteError int errorCode);
}

View File

@@ -49,10 +49,9 @@ oneway interface ISatellite {
* Listening mode allows the satellite service to listen for incoming pages. * Listening mode allows the satellite service to listen for incoming pages.
* *
* @param enable True to enable satellite listening mode and false to disable. * @param enable True to enable satellite listening mode and false to disable.
* @param isDemoMode Whether demo mode is enabled.
* @param timeout How long the satellite modem should wait for the next incoming page before * @param timeout How long the satellite modem should wait for the next incoming page before
* disabling listening mode. * disabling listening mode.
* @param errorCallback The callback to receive the error code result of the operation. * @param resultCallback The callback to receive the error code result of the operation.
* *
* Valid error codes returned: * Valid error codes returned:
* SatelliteError:ERROR_NONE * SatelliteError:ERROR_NONE
@@ -64,16 +63,17 @@ oneway interface ISatellite {
* SatelliteError:REQUEST_NOT_SUPPORTED * SatelliteError:REQUEST_NOT_SUPPORTED
* SatelliteError:NO_RESOURCES * SatelliteError:NO_RESOURCES
*/ */
void requestSatelliteListeningEnabled(in boolean enable, in boolean isDemoMode, in int timeout, void requestSatelliteListeningEnabled(in boolean enable, in int timeout,
in IIntegerConsumer errorCallback); in IIntegerConsumer resultCallback);
/** /**
* Request to enable or disable the satellite modem. If the satellite modem is enabled, * Request to enable or disable the satellite modem and demo mode. If the satellite modem
* this will also disable the cellular modem, and if the satellite modem is disabled, * is enabled, this may also disable the cellular modem, and if the satellite modem is disabled,
* this will also re-enable the cellular modem. * this may also re-enable the cellular modem.
* *
* @param enable True to enable the satellite modem and false to disable. * @param enableSatellite True to enable the satellite modem and false to disable.
* @param errorCallback The callback to receive the error code result of the operation. * @param enableDemoMode True to enable demo mode and false to disable.
* @param resultCallback The callback to receive the error code result of the operation.
* *
* Valid error codes returned: * Valid error codes returned:
* SatelliteError:ERROR_NONE * SatelliteError:ERROR_NONE
@@ -85,13 +85,14 @@ oneway interface ISatellite {
* SatelliteError:REQUEST_NOT_SUPPORTED * SatelliteError:REQUEST_NOT_SUPPORTED
* SatelliteError:NO_RESOURCES * SatelliteError:NO_RESOURCES
*/ */
void requestSatelliteEnabled(in boolean enabled, in IIntegerConsumer errorCallback); void requestSatelliteEnabled(in boolean enableSatellite, in boolean enableDemoMode,
in IIntegerConsumer resultCallback);
/** /**
* Request to get whether the satellite modem is enabled. * Request to get whether the satellite modem is enabled.
* *
* @param errorCallback The callback to receive the error code result of the operation. * @param resultCallback The callback to receive the error code result of the operation.
* This must only be sent when the result is not SatelliteError#ERROR_NONE. * This must only be sent when the error is not SatelliteError#ERROR_NONE.
* @param callback If the result is SatelliteError#ERROR_NONE, the callback to receive * @param callback If the result is SatelliteError#ERROR_NONE, the callback to receive
* whether the satellite modem is enabled. * whether the satellite modem is enabled.
* *
@@ -105,13 +106,13 @@ oneway interface ISatellite {
* SatelliteError:REQUEST_NOT_SUPPORTED * SatelliteError:REQUEST_NOT_SUPPORTED
* SatelliteError:NO_RESOURCES * SatelliteError:NO_RESOURCES
*/ */
void requestIsSatelliteEnabled(in IIntegerConsumer errorCallback, in IBooleanConsumer callback); void requestIsSatelliteEnabled(in IIntegerConsumer resultCallback, in IBooleanConsumer callback);
/** /**
* Request to get whether the satellite service is supported on the device. * Request to get whether the satellite service is supported on the device.
* *
* @param errorCallback The callback to receive the error code result of the operation. * @param resultCallback The callback to receive the error code result of the operation.
* This must only be sent when the result is not SatelliteError#ERROR_NONE. * This must only be sent when the error is not SatelliteError#ERROR_NONE.
* @param callback If the result is SatelliteError#ERROR_NONE, the callback to receive * @param callback If the result is SatelliteError#ERROR_NONE, the callback to receive
* whether the satellite service is supported on the device. * whether the satellite service is supported on the device.
* *
@@ -125,14 +126,14 @@ oneway interface ISatellite {
* SatelliteError:REQUEST_NOT_SUPPORTED * SatelliteError:REQUEST_NOT_SUPPORTED
* SatelliteError:NO_RESOURCES * SatelliteError:NO_RESOURCES
*/ */
void requestIsSatelliteSupported(in IIntegerConsumer errorCallback, void requestIsSatelliteSupported(in IIntegerConsumer resultCallback,
in IBooleanConsumer callback); in IBooleanConsumer callback);
/** /**
* Request to get the SatelliteCapabilities of the satellite service. * Request to get the SatelliteCapabilities of the satellite service.
* *
* @param errorCallback The callback to receive the error code result of the operation. * @param resultCallback The callback to receive the error code result of the operation.
* This must only be sent when the result is not SatelliteError#ERROR_NONE. * This must only be sent when the error is not SatelliteError#ERROR_NONE.
* @param callback If the result is SatelliteError#ERROR_NONE, the callback to receive * @param callback If the result is SatelliteError#ERROR_NONE, the callback to receive
* the SatelliteCapabilities of the satellite service. * the SatelliteCapabilities of the satellite service.
* *
@@ -146,7 +147,7 @@ oneway interface ISatellite {
* SatelliteError:REQUEST_NOT_SUPPORTED * SatelliteError:REQUEST_NOT_SUPPORTED
* SatelliteError:NO_RESOURCES * SatelliteError:NO_RESOURCES
*/ */
void requestSatelliteCapabilities(in IIntegerConsumer errorCallback, void requestSatelliteCapabilities(in IIntegerConsumer resultCallback,
in ISatelliteCapabilitiesConsumer callback); in ISatelliteCapabilitiesConsumer callback);
/** /**
@@ -154,7 +155,7 @@ oneway interface ISatellite {
* The satellite service should report the satellite pointing info via * The satellite service should report the satellite pointing info via
* ISatelliteListener#onSatellitePositionChanged as the user device/satellite moves. * ISatelliteListener#onSatellitePositionChanged as the user device/satellite moves.
* *
* @param errorCallback The callback to receive the error code result of the operation. * @param resultCallback The callback to receive the error code result of the operation.
* *
* Valid error codes returned: * Valid error codes returned:
* SatelliteError:ERROR_NONE * SatelliteError:ERROR_NONE
@@ -166,13 +167,13 @@ oneway interface ISatellite {
* SatelliteError:REQUEST_NOT_SUPPORTED * SatelliteError:REQUEST_NOT_SUPPORTED
* SatelliteError:NO_RESOURCES * SatelliteError:NO_RESOURCES
*/ */
void startSendingSatellitePointingInfo(in IIntegerConsumer errorCallback); void startSendingSatellitePointingInfo(in IIntegerConsumer resultCallback);
/** /**
* User stopped pointing to the satellite. * User stopped pointing to the satellite.
* The satellite service should stop reporting satellite pointing info to the framework. * The satellite service should stop reporting satellite pointing info to the framework.
* *
* @param errorCallback The callback to receive the error code result of the operation. * @param resultCallback The callback to receive the error code result of the operation.
* *
* Valid error codes returned: * Valid error codes returned:
* SatelliteError:ERROR_NONE * SatelliteError:ERROR_NONE
@@ -184,28 +185,7 @@ oneway interface ISatellite {
* SatelliteError:REQUEST_NOT_SUPPORTED * SatelliteError:REQUEST_NOT_SUPPORTED
* SatelliteError:NO_RESOURCES * SatelliteError:NO_RESOURCES
*/ */
void stopSendingSatellitePointingInfo(in IIntegerConsumer errorCallback); void stopSendingSatellitePointingInfo(in IIntegerConsumer resultCallback);
/**
* Request to get the maximum number of characters per MO text message on satellite.
*
* @param errorCallback The callback to receive the error code result of the operation.
* This must only be sent when the result is not SatelliteError#ERROR_NONE.
* @param callback If the result is SatelliteError#ERROR_NONE, the callback to receive
* the maximum number of characters per MO text message on satellite.
*
* Valid error codes returned:
* SatelliteError:ERROR_NONE
* SatelliteError:SERVICE_ERROR
* SatelliteError:MODEM_ERROR
* SatelliteError:INVALID_MODEM_STATE
* SatelliteError:INVALID_ARGUMENTS
* SatelliteError:RADIO_NOT_AVAILABLE
* SatelliteError:REQUEST_NOT_SUPPORTED
* SatelliteError:NO_RESOURCES
*/
void requestMaxCharactersPerMOTextMessage(in IIntegerConsumer errorCallback,
in IIntegerConsumer callback);
/** /**
* Provision the device with a satellite provider. * Provision the device with a satellite provider.
@@ -214,7 +194,8 @@ oneway interface ISatellite {
* *
* @param token The token to be used as a unique identifier for provisioning with satellite * @param token The token to be used as a unique identifier for provisioning with satellite
* gateway. * gateway.
* @param errorCallback The callback to receive the error code result of the operation. * @param regionId The region ID for the device's current location.
* @param resultCallback The callback to receive the error code result of the operation.
* *
* Valid error codes returned: * Valid error codes returned:
* SatelliteError:ERROR_NONE * SatelliteError:ERROR_NONE
@@ -229,7 +210,8 @@ oneway interface ISatellite {
* SatelliteError:REQUEST_ABORTED * SatelliteError:REQUEST_ABORTED
* SatelliteError:NETWORK_TIMEOUT * SatelliteError:NETWORK_TIMEOUT
*/ */
void provisionSatelliteService(in String token, in IIntegerConsumer errorCallback); void provisionSatelliteService(in String token, in String regionId,
in IIntegerConsumer resultCallback);
/** /**
* Deprovision the device with the satellite provider. * Deprovision the device with the satellite provider.
@@ -237,7 +219,7 @@ oneway interface ISatellite {
* Once deprovisioned, ISatelliteListener#onSatelliteProvisionStateChanged should report false. * Once deprovisioned, ISatelliteListener#onSatelliteProvisionStateChanged should report false.
* *
* @param token The token of the device/subscription to be deprovisioned. * @param token The token of the device/subscription to be deprovisioned.
* @param errorCallback The callback to receive the error code result of the operation. * @param resultCallback The callback to receive the error code result of the operation.
* *
* Valid error codes returned: * Valid error codes returned:
* SatelliteError:ERROR_NONE * SatelliteError:ERROR_NONE
@@ -252,13 +234,13 @@ oneway interface ISatellite {
* SatelliteError:REQUEST_ABORTED * SatelliteError:REQUEST_ABORTED
* SatelliteError:NETWORK_TIMEOUT * SatelliteError:NETWORK_TIMEOUT
*/ */
void deprovisionSatelliteService(in String token, in IIntegerConsumer errorCallback); void deprovisionSatelliteService(in String token, in IIntegerConsumer resultCallback);
/** /**
* Request to get whether this device is provisioned with a satellite provider. * Request to get whether this device is provisioned with a satellite provider.
* *
* @param errorCallback The callback to receive the error code result of the operation. * @param resultCallback The callback to receive the error code result of the operation.
* This must only be sent when the result is not SatelliteError#ERROR_NONE. * This must only be sent when the error is not SatelliteError#ERROR_NONE.
* @param callback If the result is SatelliteError#ERROR_NONE, the callback to receive * @param callback If the result is SatelliteError#ERROR_NONE, the callback to receive
* whether this device is provisioned with a satellite provider. * whether this device is provisioned with a satellite provider.
* *
@@ -272,7 +254,7 @@ oneway interface ISatellite {
* SatelliteError:REQUEST_NOT_SUPPORTED * SatelliteError:REQUEST_NOT_SUPPORTED
* SatelliteError:NO_RESOURCES * SatelliteError:NO_RESOURCES
*/ */
void requestIsSatelliteProvisioned(in IIntegerConsumer errorCallback, void requestIsSatelliteProvisioned(in IIntegerConsumer resultCallback,
in IBooleanConsumer callback); in IBooleanConsumer callback);
/** /**
@@ -280,7 +262,7 @@ oneway interface ISatellite {
* The satellite service should check if there are any pending datagrams to be received over * The satellite service should check if there are any pending datagrams to be received over
* satellite and report them via ISatelliteListener#onSatelliteDatagramsReceived. * satellite and report them via ISatelliteListener#onSatelliteDatagramsReceived.
* *
* @param errorCallback The callback to receive the error code result of the operation. * @param resultCallback The callback to receive the error code result of the operation.
* *
* Valid error codes returned: * Valid error codes returned:
* SatelliteError:ERROR_NONE * SatelliteError:ERROR_NONE
@@ -297,15 +279,14 @@ oneway interface ISatellite {
* SatelliteError:SATELLITE_NOT_REACHABLE * SatelliteError:SATELLITE_NOT_REACHABLE
* SatelliteError:NOT_AUTHORIZED * SatelliteError:NOT_AUTHORIZED
*/ */
void pollPendingSatelliteDatagrams(in IIntegerConsumer errorCallback); void pollPendingSatelliteDatagrams(in IIntegerConsumer resultCallback);
/** /**
* Send datagram over satellite. * Send datagram over satellite.
* *
* @param datagram Datagram to send in byte format. * @param datagram Datagram to send in byte format.
* @param isDemoMode Whether demo mode is enabled.
* @param isEmergency Whether this is an emergency datagram. * @param isEmergency Whether this is an emergency datagram.
* @param errorCallback The callback to receive the error code result of the operation. * @param resultCallback The callback to receive the error code result of the operation.
* *
* Valid error codes returned: * Valid error codes returned:
* SatelliteError:ERROR_NONE * SatelliteError:ERROR_NONE
@@ -323,16 +304,16 @@ oneway interface ISatellite {
* SatelliteError:SATELLITE_NOT_REACHABLE * SatelliteError:SATELLITE_NOT_REACHABLE
* SatelliteError:NOT_AUTHORIZED * SatelliteError:NOT_AUTHORIZED
*/ */
void sendSatelliteDatagram(in SatelliteDatagram datagram, in boolean isDemoMode, void sendSatelliteDatagram(in SatelliteDatagram datagram, in boolean isEmergency,
in boolean isEmergency, in IIntegerConsumer errorCallback); in IIntegerConsumer resultCallback);
/** /**
* Request the current satellite modem state. * Request the current satellite modem state.
* The satellite service should report the current satellite modem state via * The satellite service should report the current satellite modem state via
* ISatelliteListener#onSatelliteModemStateChanged. * ISatelliteListener#onSatelliteModemStateChanged.
* *
* @param errorCallback The callback to receive the error code result of the operation. * @param resultCallback The callback to receive the error code result of the operation.
* This must only be sent when the result is not SatelliteError#ERROR_NONE. * This must only be sent when the error is not SatelliteError#ERROR_NONE.
* @param callback If the result is SatelliteError#ERROR_NONE, the callback to receive * @param callback If the result is SatelliteError#ERROR_NONE, the callback to receive
* the current satellite modem state. * the current satellite modem state.
* *
@@ -346,14 +327,14 @@ oneway interface ISatellite {
* SatelliteError:REQUEST_NOT_SUPPORTED * SatelliteError:REQUEST_NOT_SUPPORTED
* SatelliteError:NO_RESOURCES * SatelliteError:NO_RESOURCES
*/ */
void requestSatelliteModemState(in IIntegerConsumer errorCallback, void requestSatelliteModemState(in IIntegerConsumer resultCallback,
in IIntegerConsumer callback); in IIntegerConsumer callback);
/** /**
* Request to get whether satellite communication is allowed for the current location. * Request to get whether satellite communication is allowed for the current location.
* *
* @param errorCallback The callback to receive the error code result of the operation. * @param resultCallback The callback to receive the error code result of the operation.
* This must only be sent when the result is not SatelliteError#ERROR_NONE. * This must only be sent when the error is not SatelliteError#ERROR_NONE.
* @param callback If the result is SatelliteError#ERROR_NONE, the callback to receive * @param callback If the result is SatelliteError#ERROR_NONE, the callback to receive
* whether satellite communication is allowed for the current location. * whether satellite communication is allowed for the current location.
* *
@@ -368,15 +349,15 @@ oneway interface ISatellite {
* SatelliteError:NO_RESOURCES * SatelliteError:NO_RESOURCES
*/ */
void requestIsSatelliteCommunicationAllowedForCurrentLocation( void requestIsSatelliteCommunicationAllowedForCurrentLocation(
in IIntegerConsumer errorCallback, in IBooleanConsumer callback); in IIntegerConsumer resultCallback, in IBooleanConsumer callback);
/** /**
* Request to get the time after which the satellite will be visible. This is an int * Request to get the time after which the satellite will be visible. This is an int
* representing the duration in seconds after which the satellite will be visible. * representing the duration in seconds after which the satellite will be visible.
* This will return 0 if the satellite is currently visible. * This will return 0 if the satellite is currently visible.
* *
* @param errorCallback The callback to receive the error code result of the operation. * @param resultCallback The callback to receive the error code result of the operation.
* This must only be sent when the result is not SatelliteError#ERROR_NONE. * This must only be sent when the error is not SatelliteError#ERROR_NONE.
* @param callback If the result is SatelliteError#ERROR_NONE, the callback to receive * @param callback If the result is SatelliteError#ERROR_NONE, the callback to receive
* the time after which the satellite will be visible. * the time after which the satellite will be visible.
* *
@@ -390,6 +371,6 @@ oneway interface ISatellite {
* SatelliteError:REQUEST_NOT_SUPPORTED * SatelliteError:REQUEST_NOT_SUPPORTED
* SatelliteError:NO_RESOURCES * SatelliteError:NO_RESOURCES
*/ */
void requestTimeForNextSatelliteVisibility(in IIntegerConsumer errorCallback, void requestTimeForNextSatelliteVisibility(in IIntegerConsumer resultCallback,
in IIntegerConsumer callback); in IIntegerConsumer callback);
} }

View File

@@ -43,10 +43,8 @@ oneway interface ISatelliteListener {
/** /**
* Indicates that the satellite has pending datagrams for the device to be pulled. * Indicates that the satellite has pending datagrams for the device to be pulled.
*
* @param count Number of pending datagrams.
*/ */
void onPendingDatagramCount(in int count); void onPendingDatagrams();
/** /**
* Indicates that the satellite pointing input has changed. * Indicates that the satellite pointing input has changed.
@@ -61,11 +59,4 @@ oneway interface ISatelliteListener {
* @param state The current satellite modem state. * @param state The current satellite modem state.
*/ */
void onSatelliteModemStateChanged(in SatelliteModemState state); void onSatelliteModemStateChanged(in SatelliteModemState state);
/**
* Indicates that the satellite radio technology has changed.
*
* @param technology The current satellite radio technology.
*/
void onSatelliteRadioTechnologyChanged(in NTRadioTechnology technology);
} }

View File

@@ -29,21 +29,4 @@ parcelable PointingInfo {
* Satellite elevation in degrees. * Satellite elevation in degrees.
*/ */
float satelliteElevation; float satelliteElevation;
/**
* Antenna azimuth in degrees.
*/
float antennaAzimuth;
/**
* Angle of rotation about the x axis. This value represents the angle between a plane
* parallel to the device's screen and a plane parallel to the ground.
*/
float antennaPitch;
/**
* Angle of rotation about the y axis. This value represents the angle between a plane
* perpendicular to the device's screen and a plane parallel to the ground.
*/
float antennaRoll;
} }

View File

@@ -27,19 +27,13 @@ parcelable SatelliteCapabilities {
*/ */
NTRadioTechnology[] supportedRadioTechnologies; NTRadioTechnology[] supportedRadioTechnologies;
/**
* Whether satellite modem is always on.
* This indicates the power impact of keeping it on is very minimal.
*/
boolean isAlwaysOn;
/** /**
* Whether UE needs to point to a satellite to send and receive data. * Whether UE needs to point to a satellite to send and receive data.
*/ */
boolean needsPointingToSatellite; boolean isPointingRequired;
/** /**
* Whether UE needs a separate SIM profile to communicate with the satellite network. * The maximum number of bytes per datagram that can be sent over satellite.
*/ */
boolean needsSeparateSimProfile; int maxBytesPerOutgoingDatagram;
} }

View File

@@ -70,20 +70,21 @@ public class SatelliteImplBase extends SatelliteService {
} }
@Override @Override
public void requestSatelliteListeningEnabled(boolean enable, boolean isDemoMode, public void requestSatelliteListeningEnabled(boolean enable, int timeout,
int timeout, IIntegerConsumer errorCallback) throws RemoteException { IIntegerConsumer errorCallback) throws RemoteException {
executeMethodAsync( executeMethodAsync(
() -> SatelliteImplBase.this () -> SatelliteImplBase.this
.requestSatelliteListeningEnabled( .requestSatelliteListeningEnabled(enable, timeout, errorCallback),
enable, isDemoMode, timeout, errorCallback),
"requestSatelliteListeningEnabled"); "requestSatelliteListeningEnabled");
} }
@Override @Override
public void requestSatelliteEnabled(boolean enable, IIntegerConsumer errorCallback) public void requestSatelliteEnabled(boolean enableSatellite, boolean enableDemoMode,
throws RemoteException { IIntegerConsumer errorCallback) throws RemoteException {
executeMethodAsync( executeMethodAsync(
() -> SatelliteImplBase.this.requestSatelliteEnabled(enable, errorCallback), () -> SatelliteImplBase.this
.requestSatelliteEnabled(
enableSatellite, enableDemoMode, errorCallback),
"requestSatelliteEnabled"); "requestSatelliteEnabled");
} }
@@ -131,19 +132,11 @@ public class SatelliteImplBase extends SatelliteService {
} }
@Override @Override
public void requestMaxCharactersPerMOTextMessage(IIntegerConsumer errorCallback, public void provisionSatelliteService(String token, String regionId,
IIntegerConsumer callback) throws RemoteException { IIntegerConsumer errorCallback) throws RemoteException {
executeMethodAsync( executeMethodAsync(
() -> SatelliteImplBase.this () -> SatelliteImplBase.this
.requestMaxCharactersPerMOTextMessage(errorCallback, callback), .provisionSatelliteService(token, regionId, errorCallback),
"requestMaxCharactersPerMOTextMessage");
}
@Override
public void provisionSatelliteService(String token, IIntegerConsumer errorCallback)
throws RemoteException {
executeMethodAsync(
() -> SatelliteImplBase.this.provisionSatelliteService(token, errorCallback),
"provisionSatelliteService"); "provisionSatelliteService");
} }
@@ -173,12 +166,11 @@ public class SatelliteImplBase extends SatelliteService {
} }
@Override @Override
public void sendSatelliteDatagram(SatelliteDatagram datagram, boolean isDemoMode, public void sendSatelliteDatagram(SatelliteDatagram datagram, boolean isEmergency,
boolean isEmergency, IIntegerConsumer errorCallback) throws RemoteException { IIntegerConsumer errorCallback) throws RemoteException {
executeMethodAsync( executeMethodAsync(
() -> SatelliteImplBase.this () -> SatelliteImplBase.this
.sendSatelliteDatagram( .sendSatelliteDatagram(datagram, isEmergency, errorCallback),
datagram, isDemoMode, isEmergency, errorCallback),
"sendSatelliteDatagram"); "sendSatelliteDatagram");
} }
@@ -249,7 +241,6 @@ public class SatelliteImplBase extends SatelliteService {
* Listening mode allows the satellite service to listen for incoming pages. * Listening mode allows the satellite service to listen for incoming pages.
* *
* @param enable True to enable satellite listening mode and false to disable. * @param enable True to enable satellite listening mode and false to disable.
* @param isDemoMode Whether demo mode is enabled.
* @param timeout How long the satellite modem should wait for the next incoming page before * @param timeout How long the satellite modem should wait for the next incoming page before
* disabling listening mode. * disabling listening mode.
* @param errorCallback The callback to receive the error code result of the operation. * @param errorCallback The callback to receive the error code result of the operation.
@@ -264,17 +255,18 @@ public class SatelliteImplBase extends SatelliteService {
* SatelliteError:REQUEST_NOT_SUPPORTED * SatelliteError:REQUEST_NOT_SUPPORTED
* SatelliteError:NO_RESOURCES * SatelliteError:NO_RESOURCES
*/ */
public void requestSatelliteListeningEnabled(boolean enable, boolean isDemoMode, int timeout, public void requestSatelliteListeningEnabled(boolean enable, int timeout,
@NonNull IIntegerConsumer errorCallback) { @NonNull IIntegerConsumer errorCallback) {
// stub implementation // stub implementation
} }
/** /**
* Request to enable or disable the satellite modem. If the satellite modem is enabled, * Request to enable or disable the satellite modem and demo mode. If the satellite modem is
* this will also disable the cellular modem, and if the satellite modem is disabled, * enabled, this may also disable the cellular modem, and if the satellite modem is disabled,
* this will also re-enable the cellular modem. * this may also re-enable the cellular modem.
* *
* @param enable True to enable the satellite modem and false to disable. * @param enableSatellite True to enable the satellite modem and false to disable.
* @param enableDemoMode True to enable demo mode and false to disable.
* @param errorCallback The callback to receive the error code result of the operation. * @param errorCallback The callback to receive the error code result of the operation.
* *
* Valid error codes returned: * Valid error codes returned:
@@ -287,7 +279,8 @@ public class SatelliteImplBase extends SatelliteService {
* SatelliteError:REQUEST_NOT_SUPPORTED * SatelliteError:REQUEST_NOT_SUPPORTED
* SatelliteError:NO_RESOURCES * SatelliteError:NO_RESOURCES
*/ */
public void requestSatelliteEnabled(boolean enable, @NonNull IIntegerConsumer errorCallback) { public void requestSatelliteEnabled(boolean enableSatellite, boolean enableDemoMode,
@NonNull IIntegerConsumer errorCallback) {
// stub implementation // stub implementation
} }
@@ -401,29 +394,6 @@ public class SatelliteImplBase extends SatelliteService {
// stub implementation // stub implementation
} }
/**
* Request to get the maximum number of characters per MO text message on satellite.
*
* @param errorCallback The callback to receive the error code result of the operation.
* This must only be sent when the result is not SatelliteError#ERROR_NONE.
* @param callback If the result is SatelliteError#ERROR_NONE, the callback to receive
* the maximum number of characters per MO text message on satellite.
*
* Valid error codes returned:
* SatelliteError:ERROR_NONE
* SatelliteError:SERVICE_ERROR
* SatelliteError:MODEM_ERROR
* SatelliteError:INVALID_MODEM_STATE
* SatelliteError:INVALID_ARGUMENTS
* SatelliteError:RADIO_NOT_AVAILABLE
* SatelliteError:REQUEST_NOT_SUPPORTED
* SatelliteError:NO_RESOURCES
*/
public void requestMaxCharactersPerMOTextMessage(@NonNull IIntegerConsumer errorCallback,
@NonNull IIntegerConsumer callback) {
// stub implementation
}
/** /**
* Provision the device with a satellite provider. * Provision the device with a satellite provider.
* This is needed if the provider allows dynamic registration. * This is needed if the provider allows dynamic registration.
@@ -431,6 +401,7 @@ public class SatelliteImplBase extends SatelliteService {
* *
* @param token The token to be used as a unique identifier for provisioning with satellite * @param token The token to be used as a unique identifier for provisioning with satellite
* gateway. * gateway.
* @param regionId The region ID for the device's current location.
* @param errorCallback The callback to receive the error code result of the operation. * @param errorCallback The callback to receive the error code result of the operation.
* *
* Valid error codes returned: * Valid error codes returned:
@@ -446,7 +417,7 @@ public class SatelliteImplBase extends SatelliteService {
* SatelliteError:REQUEST_ABORTED * SatelliteError:REQUEST_ABORTED
* SatelliteError:NETWORK_TIMEOUT * SatelliteError:NETWORK_TIMEOUT
*/ */
public void provisionSatelliteService(@NonNull String token, public void provisionSatelliteService(@NonNull String token, @NonNull String regionId,
@NonNull IIntegerConsumer errorCallback) { @NonNull IIntegerConsumer errorCallback) {
// stub implementation // stub implementation
} }
@@ -530,7 +501,6 @@ public class SatelliteImplBase extends SatelliteService {
* Send datagram over satellite. * Send datagram over satellite.
* *
* @param datagram Datagram to send in byte format. * @param datagram Datagram to send in byte format.
* @param isDemoMode Whether demo mode is enabled.
* @param isEmergency Whether this is an emergency datagram. * @param isEmergency Whether this is an emergency datagram.
* @param errorCallback The callback to receive the error code result of the operation. * @param errorCallback The callback to receive the error code result of the operation.
* *
@@ -550,8 +520,8 @@ public class SatelliteImplBase extends SatelliteService {
* SatelliteError:SATELLITE_NOT_REACHABLE * SatelliteError:SATELLITE_NOT_REACHABLE
* SatelliteError:NOT_AUTHORIZED * SatelliteError:NOT_AUTHORIZED
*/ */
public void sendSatelliteDatagram(@NonNull SatelliteDatagram datagram, boolean isDemoMode, public void sendSatelliteDatagram(@NonNull SatelliteDatagram datagram, boolean isEmergency,
boolean isEmergency, @NonNull IIntegerConsumer errorCallback) { @NonNull IIntegerConsumer errorCallback) {
// stub implementation // stub implementation
} }

View File

@@ -68,7 +68,7 @@ import android.telephony.ims.aidl.IImsRegistration;
import android.telephony.ims.aidl.IImsRegistrationCallback; import android.telephony.ims.aidl.IImsRegistrationCallback;
import android.telephony.ims.aidl.IRcsConfigCallback; import android.telephony.ims.aidl.IRcsConfigCallback;
import android.telephony.satellite.ISatelliteDatagramCallback; import android.telephony.satellite.ISatelliteDatagramCallback;
import android.telephony.satellite.ISatellitePositionUpdateCallback; import android.telephony.satellite.ISatelliteTransmissionUpdateCallback;
import android.telephony.satellite.ISatelliteProvisionStateCallback; import android.telephony.satellite.ISatelliteProvisionStateCallback;
import android.telephony.satellite.ISatelliteStateCallback; import android.telephony.satellite.ISatelliteStateCallback;
import android.telephony.satellite.SatelliteCapabilities; import android.telephony.satellite.SatelliteCapabilities;
@@ -2726,11 +2726,13 @@ interface ITelephony {
* *
* @param subId The subId of the subscription to enable or disable the satellite modem for. * @param subId The subId of the subscription to enable or disable the satellite modem for.
* @param enable True to enable the satellite modem and false to disable. * @param enable True to enable the satellite modem and false to disable.
* @param callback The callback to get the error code of the request. * @param isDemoModeEnabled True if demo mode is enabled and false otherwise.
* @param callback The callback to get the result of the request.
*/ */
@JavaPassthrough(annotation="@android.annotation.RequiresPermission(" @JavaPassthrough(annotation="@android.annotation.RequiresPermission("
+ "android.Manifest.permission.SATELLITE_COMMUNICATION)") + "android.Manifest.permission.SATELLITE_COMMUNICATION)")
void requestSatelliteEnabled(int subId, boolean enable, in IIntegerConsumer callback); void requestSatelliteEnabled(int subId, boolean enable, boolean isDemoModeEnabled,
in IIntegerConsumer callback);
/** /**
* Request to get whether the satellite modem is enabled. * Request to get whether the satellite modem is enabled.
@@ -2743,17 +2745,6 @@ interface ITelephony {
+ "android.Manifest.permission.SATELLITE_COMMUNICATION)") + "android.Manifest.permission.SATELLITE_COMMUNICATION)")
void requestIsSatelliteEnabled(int subId, in ResultReceiver receiver); void requestIsSatelliteEnabled(int subId, in ResultReceiver receiver);
/**
* Request to enable or disable the satellite service demo mode.
*
* @param subId The subId of the subscription to enable or disable the satellite demo mode for.
* @param enable True to enable the satellite demo mode and false to disable.
* @param callback The callback to get the error code of the request.
*/
@JavaPassthrough(annotation="@android.annotation.RequiresPermission("
+ "android.Manifest.permission.SATELLITE_COMMUNICATION)")
void requestSatelliteDemoModeEnabled(int subId, boolean enable, in IIntegerConsumer callback);
/** /**
* Request to get whether the satellite service demo mode is enabled. * Request to get whether the satellite service demo mode is enabled.
* *
@@ -2764,7 +2755,7 @@ interface ITelephony {
*/ */
@JavaPassthrough(annotation="@android.annotation.RequiresPermission(" @JavaPassthrough(annotation="@android.annotation.RequiresPermission("
+ "android.Manifest.permission.SATELLITE_COMMUNICATION)") + "android.Manifest.permission.SATELLITE_COMMUNICATION)")
void requestIsSatelliteDemoModeEnabled(int subId, in ResultReceiver receiver); void requestIsDemoModeEnabled(int subId, in ResultReceiver receiver);
/** /**
* Request to get whether the satellite service is supported on the device. * Request to get whether the satellite service is supported on the device.
@@ -2787,39 +2778,28 @@ interface ITelephony {
void requestSatelliteCapabilities(int subId, in ResultReceiver receiver); void requestSatelliteCapabilities(int subId, in ResultReceiver receiver);
/** /**
* Start receiving satellite pointing updates. * Start receiving satellite transmission updates.
* *
* @param subId The subId of the subscription to stop satellite position updates for. * @param subId The subId of the subscription to stop satellite transmission updates for.
* @param errorCallback The callback to get the error code of the request. * @param resultCallback The callback to get the result of the request.
* @param callback The callback to handle position updates. * @param callback The callback to handle transmission updates.
*/ */
@JavaPassthrough(annotation="@android.annotation.RequiresPermission(" @JavaPassthrough(annotation="@android.annotation.RequiresPermission("
+ "android.Manifest.permission.SATELLITE_COMMUNICATION)") + "android.Manifest.permission.SATELLITE_COMMUNICATION)")
void startSatellitePositionUpdates(int subId, in IIntegerConsumer errorCallback, void startSatelliteTransmissionUpdates(int subId, in IIntegerConsumer resultCallback,
in ISatellitePositionUpdateCallback callback); in ISatelliteTransmissionUpdateCallback callback);
/** /**
* Stop receiving satellite pointing updates. * Stop receiving satellite transmission updates.
* *
* @param subId The subId of the subscritpion to stop satellite position updates for. * @param subId The subId of the subscritpion to stop satellite transmission updates for.
* @param errorCallback The callback to get the error code of the request. * @param resultCallback The callback to get the result of the request.
* @param callback The callback that was passed to startSatellitePositionUpdates. * @param callback The callback that was passed to startSatelliteTransmissionUpdates.
*/ */
@JavaPassthrough(annotation="@android.annotation.RequiresPermission(" @JavaPassthrough(annotation="@android.annotation.RequiresPermission("
+ "android.Manifest.permission.SATELLITE_COMMUNICATION)") + "android.Manifest.permission.SATELLITE_COMMUNICATION)")
void stopSatellitePositionUpdates(int subId, in IIntegerConsumer errorCallback, void stopSatelliteTransmissionUpdates(int subId, in IIntegerConsumer resultCallback,
in ISatellitePositionUpdateCallback callback); in ISatelliteTransmissionUpdateCallback callback);
/**
* Request to get the maximum number of bytes per datagram that can be sent to satellite.
*
* @param subId The subId of the subscription to get the maximum number of characters for.
* @param receiver Result receiver to get the error code of the request and the requested
* maximum number of bytes per datagram that can be sent to satellite.
*/
@JavaPassthrough(annotation="@android.annotation.RequiresPermission("
+ "android.Manifest.permission.SATELLITE_COMMUNICATION)")
void requestMaxSizePerSendingDatagram(int subId, in ResultReceiver receiver);
/** /**
* Register the subscription with a satellite provider. * Register the subscription with a satellite provider.
@@ -2828,13 +2808,14 @@ interface ITelephony {
* @param subId The subId of the subscription to be provisioned. * @param subId The subId of the subscription to be provisioned.
* @param token The token to be used as a unique identifier for provisioning with satellite * @param token The token to be used as a unique identifier for provisioning with satellite
* gateway. * gateway.
* @param callback The callback to get the error code of the request. * @param regionId The region ID for the device's current location.
* @param callback The callback to get the result of the request.
* *
* @return The signal transport used by callers to cancel the provision request. * @return The signal transport used by callers to cancel the provision request.
*/ */
@JavaPassthrough(annotation="@android.annotation.RequiresPermission(" @JavaPassthrough(annotation="@android.annotation.RequiresPermission("
+ "android.Manifest.permission.SATELLITE_COMMUNICATION)") + "android.Manifest.permission.SATELLITE_COMMUNICATION)")
ICancellationSignal provisionSatelliteService(int subId, in String token, ICancellationSignal provisionSatelliteService(int subId, in String token, in String regionId,
in IIntegerConsumer callback); in IIntegerConsumer callback);
/** /**
@@ -2846,7 +2827,7 @@ interface ITelephony {
* *
* @param subId The subId of the subscription to be deprovisioned. * @param subId The subId of the subscription to be deprovisioned.
* @param token The token of the device/subscription to be deprovisioned. * @param token The token of the device/subscription to be deprovisioned.
* @param callback The callback to get the error code of the request. * @param callback The callback to get the result of the request.
*/ */
@JavaPassthrough(annotation="@android.annotation.RequiresPermission(" @JavaPassthrough(annotation="@android.annotation.RequiresPermission("
+ "android.Manifest.permission.SATELLITE_COMMUNICATION)") + "android.Manifest.permission.SATELLITE_COMMUNICATION)")
@@ -2916,15 +2897,13 @@ interface ITelephony {
* Register to receive incoming datagrams over satellite. * Register to receive incoming datagrams over satellite.
* *
* @param subId The subId of the subscription to register for incoming satellite datagrams. * @param subId The subId of the subscription to register for incoming satellite datagrams.
* @param datagramType Type of datagram.
* @param callback The callback to handle the incoming datagrams. * @param callback The callback to handle the incoming datagrams.
* *
* @return The {@link SatelliteError} result of the operation. * @return The {@link SatelliteError} result of the operation.
*/ */
@JavaPassthrough(annotation="@android.annotation.RequiresPermission(" @JavaPassthrough(annotation="@android.annotation.RequiresPermission("
+ "android.Manifest.permission.SATELLITE_COMMUNICATION)") + "android.Manifest.permission.SATELLITE_COMMUNICATION)")
int registerForSatelliteDatagram( int registerForSatelliteDatagram(int subId, ISatelliteDatagramCallback callback);
int subId, int datagramType, ISatelliteDatagramCallback callback);
/** /**
* Unregister to stop receiving incoming datagrams over satellite. * Unregister to stop receiving incoming datagrams over satellite.
@@ -2941,7 +2920,7 @@ interface ITelephony {
* Poll pending satellite datagrams over satellite. * Poll pending satellite datagrams over satellite.
* *
* @param subId The subId of the subscription used for receiving datagrams. * @param subId The subId of the subscription used for receiving datagrams.
* @param callback The callback to get the error code of the request. * @param callback The callback to get the result of the request.
*/ */
@JavaPassthrough(annotation="@android.annotation.RequiresPermission(" @JavaPassthrough(annotation="@android.annotation.RequiresPermission("
+ "android.Manifest.permission.SATELLITE_COMMUNICATION)") + "android.Manifest.permission.SATELLITE_COMMUNICATION)")
@@ -2955,7 +2934,7 @@ interface ITelephony {
* @param datagram Datagram to send over satellite. * @param datagram Datagram to send over satellite.
* @param needFullScreenPointingUI this is used to indicate pointingUI app to open in * @param needFullScreenPointingUI this is used to indicate pointingUI app to open in
* full screen mode. * full screen mode.
* @param callback The callback to get the error code of the request. * @param callback The callback to get the result of the request.
*/ */
@JavaPassthrough(annotation="@android.annotation.RequiresPermission(" @JavaPassthrough(annotation="@android.annotation.RequiresPermission("
+ "android.Manifest.permission.SATELLITE_COMMUNICATION)") + "android.Manifest.permission.SATELLITE_COMMUNICATION)")