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

Commit 50b12192 authored by Roland Levillain's avatar Roland Levillain Committed by Android (Google) Code Review
Browse files

Merge "Revert "TelephonyManager: cache service handles""

parents 886d9763 052535ef
Loading
Loading
Loading
Loading
+16 −4
Original line number Diff line number Diff line
@@ -780,7 +780,11 @@ public final class SmsManager {
                    "Invalid pdu format. format must be either 3gpp or 3gpp2");
        }
        try {
            ISms iSms = TelephonyManager.getSmsService();
            ISms iSms = ISms.Stub.asInterface(
                    TelephonyFrameworkInitializer
                            .getTelephonyServiceManager()
                            .getSmsServiceRegisterer()
                            .get());
            if (iSms != null) {
                iSms.injectSmsPduForSubscriber(
                        getSubscriptionId(), pdu, format, receivedIntent);
@@ -1603,7 +1607,7 @@ public final class SmsManager {
     * the service does not exist.
     */
    private static ISms getISmsServiceOrThrow() {
        ISms iSms = TelephonyManager.getSmsService();
        ISms iSms = getISmsService();
        if (iSms == null) {
            throw new UnsupportedOperationException("Sms is not supported");
        }
@@ -1611,7 +1615,11 @@ public final class SmsManager {
    }

    private static ISms getISmsService() {
        return TelephonyManager.getSmsService();
        return ISms.Stub.asInterface(
                TelephonyFrameworkInitializer
                        .getTelephonyServiceManager()
                        .getSmsServiceRegisterer()
                        .get());
    }

    /**
@@ -2045,7 +2053,11 @@ public final class SmsManager {
    public boolean isSMSPromptEnabled() {
        ISms iSms = null;
        try {
            iSms = TelephonyManager.getSmsService();
            iSms = ISms.Stub.asInterface(
                    TelephonyFrameworkInitializer
                            .getTelephonyServiceManager()
                            .getSmsServiceRegisterer()
                            .get());
            return iSms.isSMSPromptEnabled();
        } catch (RemoteException ex) {
            return false;
+210 −42

File changed.

Preview size limit exceeded, changes collapsed.

+33 −185

File changed.

Preview size limit exceeded, changes collapsed.