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

Commit d6158fd8 authored by Hall Liu's avatar Hall Liu
Browse files

Use default methods for MBMS group call callbacks

Use default methods so that they get picked up by CTS coverage
Also this lets clients ignore certain methods easier.

Bug: 122619617
Test: CTS
Change-Id: I1f5fcdbce9548d3b4e59af7e648f29959a22774e
parent c9d834e3
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -43597,9 +43597,9 @@ package android.telephony.mbms {
  }
  public interface GroupCallCallback {
    method public void onBroadcastSignalStrengthUpdated(@IntRange(from=0xffffffff, to=4) int);
    method public void onError(int, @Nullable String);
    method public void onGroupCallStateChanged(int, int);
    method public default void onBroadcastSignalStrengthUpdated(@IntRange(from=0xffffffff, to=4) int);
    method public default void onError(int, @Nullable String);
    method public default void onGroupCallStateChanged(int, int);
    field public static final int SIGNAL_STRENGTH_UNAVAILABLE = -1; // 0xffffffff
  }
@@ -43657,10 +43657,10 @@ package android.telephony.mbms {
  }
  public interface MbmsGroupCallSessionCallback {
    method public void onAvailableSaisUpdated(@NonNull java.util.List<java.lang.Integer>, @NonNull java.util.List<java.util.List<java.lang.Integer>>);
    method public void onError(int, @Nullable String);
    method public void onMiddlewareReady();
    method public void onServiceInterfaceAvailable(@NonNull String, int);
    method public default void onAvailableSaisUpdated(@NonNull java.util.List<java.lang.Integer>, @NonNull java.util.List<java.util.List<java.lang.Integer>>);
    method public default void onError(int, @Nullable String);
    method public default void onMiddlewareReady();
    method public default void onServiceInterfaceAvailable(@NonNull String, int);
  }
  public class MbmsStreamingSessionCallback {
+5 −4
Original line number Diff line number Diff line
@@ -57,7 +57,7 @@ public interface GroupCallCallback {
     * @param errorCode The error code.
     * @param message A human-readable message generated by the middleware for debugging purposes.
     */
    void onError(@GroupCallError int errorCode, @Nullable String message);
    default void onError(@GroupCallError int errorCode, @Nullable String message) {}

    /**
     * Called to indicate this call has changed state.
@@ -65,8 +65,8 @@ public interface GroupCallCallback {
     * See {@link GroupCall#STATE_STOPPED}, {@link GroupCall#STATE_STARTED}
     * and {@link GroupCall#STATE_STALLED}.
     */
    void onGroupCallStateChanged(@GroupCall.GroupCallState int state,
            @GroupCall.GroupCallStateChangeReason int reason);
    default void onGroupCallStateChanged(@GroupCall.GroupCallState int state,
            @GroupCall.GroupCallStateChangeReason int reason) {}

    /**
     * Broadcast Signal Strength updated.
@@ -78,5 +78,6 @@ public interface GroupCallCallback {
     * {@link #SIGNAL_STRENGTH_UNAVAILABLE} if broadcast is not available
     * for this call due to timing, geography or popularity.
     */
    void onBroadcastSignalStrengthUpdated(@IntRange(from = -1, to = 4) int signalStrength);
    default void onBroadcastSignalStrengthUpdated(
            @IntRange(from = -1, to = 4) int signalStrength) {}
}
+5 −5
Original line number Diff line number Diff line
@@ -57,7 +57,7 @@ public interface MbmsGroupCallSessionCallback {
     * @param errorCode The error code.
     * @param message A human-readable message generated by the middleware for debugging purposes.
     */
    void onError(@GroupCallError int errorCode, @Nullable String message);
    default void onError(@GroupCallError int errorCode, @Nullable String message) {}

    /**
     * Indicates that the list of currently available SAIs has been updated. The app may use this
@@ -70,8 +70,8 @@ public interface MbmsGroupCallSessionCallback {
     * @param availableSais A list of lists of available SAIS in neighboring cells, where each list
     *                      contains the available SAIs in an individual cell.
     */
    void onAvailableSaisUpdated(@NonNull List<Integer> currentSais,
            @NonNull List<List<Integer>> availableSais);
    default void onAvailableSaisUpdated(@NonNull List<Integer> currentSais,
            @NonNull List<List<Integer>> availableSais) {}

    /**
     * Called soon after the app calls {@link MbmsGroupCallSession#create}. The information supplied
@@ -85,7 +85,7 @@ public interface MbmsGroupCallSessionCallback {
     * @param interfaceName The interface name for the data link.
     * @param index The index for the data link.
     */
    void onServiceInterfaceAvailable(@NonNull String interfaceName, int index);
    default void onServiceInterfaceAvailable(@NonNull String interfaceName, int index) {}

    /**
     * Called to indicate that the middleware has been initialized and is ready.
@@ -95,5 +95,5 @@ public interface MbmsGroupCallSessionCallback {
     * delivered via {@link #onError(int, String)} with error code
     * {@link MbmsErrors.GeneralErrors#ERROR_MIDDLEWARE_NOT_YET_READY}.
     */
    void onMiddlewareReady();
    default void onMiddlewareReady() {}
}