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

Commit 7b7275f9 authored by Idriss Juhoor's avatar Idriss Juhoor Committed by Cherrypicker Worker
Browse files

Fix Null Pointer crash

Fixing null pointer crash in MapClientContent. This happens when the watch
starts the MapClientController and doesn't have a telephony subscription.

aosp/2129638 already fix this but didn't added a test

Bug: 263323082
Bug: 267298837
Test: atest BluetoothInstrumentationTests
Tag: #stability
Change-Id: Icc2f8c49453744e1db36b30954867e79ef361fcf
(cherry picked from commit 1a670ca10b51642fa4a8e3a0e84a5f787a92d676)
(cherry picked from commit 25ebac43)
Merged-In: Icc2f8c49453744e1db36b30954867e79ef361fcf
parent 682be609
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -364,6 +364,17 @@ public class MapClientContentTest {
                eq(SubscriptionManager.SUBSCRIPTION_TYPE_REMOTE_SIM));
    }

    /**
     * Test to validate that cleaning content does not crash when no subscription are available.
     */
    @Test
    public void testCleanUpWithNoSubscriptions() {
        when(mMockSubscription.getSubscriptionType())
                .thenReturn(null);

        MapClientContent.clearAllContent(mMockContext);
    }

    void createTestMessages() {
        mOriginator = new VCardEntry();
        VCardProperty property = new VCardProperty();