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

Commit 052535ef authored by Roland Levillain's avatar Roland Levillain
Browse files

Revert "TelephonyManager: cache service handles"

Revert "Disable Telephony service handle caching while testing."

Revert submission 9592007-telephony-handle-caching

Reason for revert: Breaks tests
(com.android.cellbroadcastreceiver.unit.CellBroadcastConfigServiceTest,
com.android.bluetooth.hfp.HeadsetPhoneStateTest).

Reverted Changes:
If9bb6840c: TelephonyManager: cache service handles
I3b525c504: Disable Telephony service handle caching while tes...

Bug: 147656950
Bug: 147655973
Bug: 147658833
Bug: 147658836
Bug: 147658970
Bug: 140788621
Change-Id: Id4eb23c237c514c86af92a85c8637404eca1c357
parent d597b9b2
Loading
Loading
Loading
Loading
+16 −4
Original line number Diff line number Diff line
@@ -744,7 +744,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);
@@ -1567,7 +1571,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");
        }
@@ -1575,7 +1579,11 @@ public final class SmsManager {
    }

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

    /**
@@ -2009,7 +2017,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.