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

Commit 7c49c7ee authored by Sooraj Sasindran's avatar Sooraj Sasindran Committed by android-build-merger
Browse files

Merge "Send error if ONS is not available" into qt-r1-dev

am: b5bf60eb

Change-Id: I7a8b346d5db3a7a10cfe045036c0685e954ac6c6
parents ccd72002 b5bf60eb
Loading
Loading
Loading
Loading
+16 −4
Original line number Original line Diff line number Diff line
@@ -10788,7 +10788,6 @@ public class TelephonyManager {
     * @param callback Callback will be triggered once it succeeds or failed.
     * @param callback Callback will be triggered once it succeeds or failed.
     *                 See {@link TelephonyManager.SetOpportunisticSubscriptionResult}
     *                 See {@link TelephonyManager.SetOpportunisticSubscriptionResult}
     *                 for more details. Pass null if don't care about the result.
     *                 for more details. Pass null if don't care about the result.
     *
     */
     */
    public void setPreferredOpportunisticDataSubscription(int subId, boolean needValidation,
    public void setPreferredOpportunisticDataSubscription(int subId, boolean needValidation,
            @Nullable @CallbackExecutor Executor executor, @Nullable Consumer<Integer> callback) {
            @Nullable @CallbackExecutor Executor executor, @Nullable Consumer<Integer> callback) {
@@ -10796,6 +10795,12 @@ public class TelephonyManager {
        try {
        try {
            IOns iOpportunisticNetworkService = getIOns();
            IOns iOpportunisticNetworkService = getIOns();
            if (iOpportunisticNetworkService == null) {
            if (iOpportunisticNetworkService == null) {
                if (executor == null || callback == null) {
                    return;
                }
                Binder.withCleanCallingIdentity(() -> executor.execute(() -> {
                    callback.accept(SET_OPPORTUNISTIC_SUB_INACTIVE_SUBSCRIPTION);
                }));
                return;
                return;
            }
            }
            ISetOpportunisticDataCallback callbackStub = new ISetOpportunisticDataCallback.Stub() {
            ISetOpportunisticDataCallback callbackStub = new ISetOpportunisticDataCallback.Stub() {
@@ -10877,9 +10882,16 @@ public class TelephonyManager {
                if (executor == null || callback == null) {
                if (executor == null || callback == null) {
                    return;
                    return;
                }
                }
                if (iOpportunisticNetworkService == null) {
                    /* Todo<b/130595455> passing unknown due to lack of good error codes */
                    Binder.withCleanCallingIdentity(() -> executor.execute(() -> {
                        callback.accept(UPDATE_AVAILABLE_NETWORKS_UNKNOWN_FAILURE);
                    }));
                } else {
                    Binder.withCleanCallingIdentity(() -> executor.execute(() -> {
                    Binder.withCleanCallingIdentity(() -> executor.execute(() -> {
                        callback.accept(UPDATE_AVAILABLE_NETWORKS_INVALID_ARGUMENTS);
                        callback.accept(UPDATE_AVAILABLE_NETWORKS_INVALID_ARGUMENTS);
                    }));
                    }));
                }
                return;
                return;
            }
            }
            IUpdateAvailableNetworksCallback callbackStub =
            IUpdateAvailableNetworksCallback callbackStub =