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

Commit 2b514e44 authored by Hansong Zhang's avatar Hansong Zhang Committed by Kevin F. Haggerty
Browse files

DO NOT MERGE Fix unexpected behavior in Bluetooth pairing

* Set default PBAP permission to false
* Remove all newline and tab characters in Bluetooth device name

Bug: 72872376
Bug: 73173182
Test: manual
Change-Id: Ib3b99017c8da01446ce6302d43dcfb1ef8fba02c
(cherry picked from commit 4f58c19a)
parent 8540158f
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@ import android.text.InputFilter;
import android.text.InputFilter.LengthFilter;
import android.text.InputType;
import android.text.TextWatcher;
import android.util.EventLog;
import android.util.Log;
import android.view.KeyEvent;
import android.view.View;
@@ -293,8 +294,9 @@ public final class BluetoothPairingDialog extends AlertActivity implements
        } else {
            if (mDevice.getBluetoothClass().getDeviceClass()
                    == BluetoothClass.Device.AUDIO_VIDEO_HANDSFREE) {
                contactSharing.setChecked(true);
                mDevice.setPhonebookAccessPermission(BluetoothDevice.ACCESS_ALLOWED);
                contactSharing.setChecked(false);
                mDevice.setPhonebookAccessPermission(BluetoothDevice.ACCESS_REJECTED);
                EventLog.writeEvent(0x534e4554, "73173182", -1, "");
            } else {
                contactSharing.setChecked(false);
                mDevice.setPhonebookAccessPermission(BluetoothDevice.ACCESS_REJECTED);
+6 −1
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import android.support.v7.preference.Preference;
import android.util.EventLog;
import android.util.Log;
import android.view.View;
import android.widget.Button;
@@ -154,7 +155,11 @@ public class BluetoothPermissionActivity extends AlertActivity implements
        String mRemoteName = mDevice != null ? mDevice.getAliasName() : null;

        if (mRemoteName == null) mRemoteName = getString(R.string.unknown);
        return mRemoteName;
        String nameNoNewline = mRemoteName.replaceAll("[\\t\\n\\r]+", " ");
        if (!mRemoteName.equals(nameNoNewline)) {
            EventLog.writeEvent(0x534e4554, "72872376", -1, "");
        }
        return nameNoNewline;
    }

    // TODO(edjee): createConnectionDialogView, createPhonebookDialogView and createMapDialogView