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

Commit e7f60fef authored by Corey Garst's avatar Corey Garst Committed by invisiblek
Browse files

Bluetooth MAP (Message Access Profile) Upstream Changes (1/3)

PORTED FROM CM10: http://review.cyanogenmod.org/#/c/26392/

Incorporates updates to the Bluetooth MAP profile from Code Aurora's
Android Enablement Project since we initially pulled in from their
gingerbread to CM7 last year. This patch addresses bugs with the
current MAP profile, adds a UI request for message access approval
when pairing, and adds additional error checking and logging.
Confirmed to fix date and "Download" function of Ford SYNC Gen1.
Pulled in from the codeaurora jb branch.

Change-Id: I8e6d793e16c36b77212927e94e8c96d1cf651dcb

Conflicts:
	AndroidManifest.xml
parent 0f920893
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -12,7 +12,7 @@ LOCAL_CERTIFICATE := platform
LOCAL_JNI_SHARED_LIBRARIES := libbluetooth_jni
LOCAL_JAVA_LIBRARIES := javax.obex

LOCAL_JAVA_LIBRARIES += telephony-common
LOCAL_JAVA_LIBRARIES += telephony-common mms-common

LOCAL_STATIC_JAVA_LIBRARIES := com.android.vcard

+1 −0
Original line number Diff line number Diff line
@@ -60,6 +60,7 @@

    <!-- For PBAP Owner Vcard Info -->
    <uses-permission android:name="android.permission.READ_PROFILE"/>
    <uses-permission android:name="android.permission.MMS_PUSH"></uses-permission>
    <application
        android:name=".btservice.AdapterApp"
        android:icon="@drawable/bt_share"
+44 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
 * Copyright (c) 2011-2012, Code Aurora Forum. All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *        * Redistributions of source code must retain the above copyright
 *            notice, this list of conditions and the following disclaimer.
 *        * Redistributions in binary form must reproduce the above copyright
 *            notice, this list of conditions and the following disclaimer in the
 *            documentation and/or other materials provided with the distribution.
 *        * Neither the name of Code Aurora nor
 *            the names of its contributors may be used to endorse or promote
 *            products derived from this software without specific prior written
 *            permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 * NON-INFRINGEMENT ARE DISCLAIMED.    IN NO EVENT SHALL THE COPYRIGHT OWNER OR
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
-->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
    <string name="map_acceptance_dialog_title">%1$s would like to access your phone folders. Give access to %2$s?</string>
    <string name="map_acceptance_dialog_header">Phone Folder Access</string>
    <string name="map_session_key_dialog_title">Type session key for %1$s</string>
    <string name="map_session_key_dialog_header">Bluetooth session key required</string>
    <string name="map_acceptance_timeout_message">There was time out to accept connection with %1$s</string>
    <string name="map_authentication_timeout_message">There was time out to input session key with %1$s</string>
    <string name="map_notif_ticker">Obex authentication request</string>
    <!-- Notification title when a Bluetooth device wants to pair with us -->
    <string name="map_notif_title">Session Key Request for MAP</string>
    <!-- Notification message when a Bluetooth device wants to pair with us -->
    <string name="map_notif_message">Allow root folder access by %1$s</string>
    <string name="map_alert_conn_failed_message">Bluetooth MAP connection failed.</string>
</resources>
+4 −3
Original line number Diff line number Diff line
/*
 * Copyright (c) 2008-2009, Motorola, Inc.
 * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
@@ -32,7 +33,8 @@ import android.os.Handler;
import android.os.Message;
import android.util.Log;

import javax.obex.*;
import javax.obex.Authenticator;
import javax.obex.PasswordAuthentication;

/**
 * BluetoothMapAuthenticator is a used by BluetoothObexServer for obex
@@ -95,8 +97,7 @@ public class BluetoothMapAuthenticator implements Authenticator {

    // TODO: Reserved for future use only, in case PSE challenge PCE
    public byte[] onAuthenticationResponse(final byte[] userName) {
        byte[] b = null;
        return b;
        return null;
    }
}
+4 −4
Original line number Diff line number Diff line
/*
 * Copyright (c) 2008-2009, Motorola, Inc.
 * Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
@@ -28,16 +29,15 @@

package com.android.bluetooth.map;

import android.bluetooth.BluetoothSocket;

import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;


import javax.obex.*;

import android.bluetooth.BluetoothSocket;
import javax.obex.ObexTransport;

public class BluetoothMapRfcommTransport implements ObexTransport {
    private BluetoothSocket mSocket = null;
Loading