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

Commit 518945ec authored by Amit Mahajan's avatar Amit Mahajan Committed by android-build-merger
Browse files

Merge changes from topic "Correct subId in divideMessage()" into qt-dev am:...

Merge changes from topic "Correct subId in divideMessage()" into qt-dev am: 3aa54b1f am: af200cc0
am: 53e0d91f

Change-Id: I4d9388f1a7ade3ed2b1e5b6fa1a65d07ee52f914
parents 14dc7175 53e0d91f
Loading
Loading
Loading
Loading
+12 −6
Original line number Diff line number Diff line
@@ -1962,16 +1962,22 @@ public final class SmsManager {
    }

    /**
     * Get default sms subscription id
     * Get default sms subscription id.
     *
     * @return the user-defined default SMS subscription id or
     * {@link SubscriptionManager#INVALID_SUBSCRIPTION_ID} if no default is set.
     * <p class="note"><strong>Note:</strong>This returns a value different from
     * {@link SubscriptionManager#getDefaultSmsSubscriptionId} if the user has not chosen a default.
     * In this case it returns the active subscription id if there's only one active subscription
     * available.
     *
     * @return the user-defined default SMS subscription id, or the active subscription id if
     * there's only one active subscription available, otherwise
     * {@link SubscriptionManager#INVALID_SUBSCRIPTION_ID}.
     */
    public static int getDefaultSmsSubscriptionId() {
        try {
            return SubscriptionManager.getDefaultSmsSubscriptionId();
        } catch (NullPointerException ex) {
            return -1;
            return getISmsServiceOrThrow().getPreferredSmsSubscription();
        } catch (RemoteException e) {
            return SubscriptionManager.INVALID_SUBSCRIPTION_ID;
        }
    }