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

Commit a7caae91 authored by Hemant Gupta's avatar Hemant Gupta
Browse files

MAP: Fix fatal exception due to missing looper for current thread

While creating handler for the thread, there was fatal exception getting
thrown because the present thread does not have a looper. So passing the
applications looper to be used , while creating the handler to avoid this
exception.

Change-Id: Id8c121439d7a93af7592a15df67523e96a1312ff
parent e6daab5d
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -56,6 +56,7 @@ import android.telephony.SmsMessage;
import android.telephony.TelephonyManager;
import android.util.Log;
import android.util.Xml;
import android.os.Looper;

import com.android.bluetooth.map.BluetoothMapUtils.TYPE;
import com.android.bluetooth.map.BluetoothMapbMessageMmsEmail.MimePart;
@@ -128,7 +129,7 @@ public class BluetoothMapContentObserver {
        return smsType;
    }

    private final ContentObserver mObserver = new ContentObserver(new Handler()) {
    private final ContentObserver mObserver = new ContentObserver(new Handler(Looper.getMainLooper())) {
        @Override
        public void onChange(boolean selfChange) {
            onChange(selfChange, null);
@@ -960,7 +961,7 @@ public class BluetoothMapContentObserver {
        private final Uri UPDATE_STATUS_URI = Uri.parse("content://sms/status");

        public void register() {
            Handler handler = new Handler();
            Handler handler = new Handler(Looper.getMainLooper());

            IntentFilter intentFilter = new IntentFilter();
            intentFilter.addAction(ACTION_MESSAGE_DELIVERY);