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

Commit 9ae8d237 authored by Steve Kondik's avatar Steve Kondik
Browse files

Revert "Update MAP code from upstream."

 * Moving to new upstream implementation in BluetoothExt

This reverts commit 638705ba.

Revert "Fix MAP SDP record generation [3/3]."

This reverts commit 9eb34d0f.

Revert "Fix MAP accept threads sometimes spinning endlessly."

This reverts commit 84df74b2.

Revert "Accidentally removed bugfix in BluetoothMasObexServer"

This reverts commit 768797c3.

Revert "Fix crash during BT shutdown"

This reverts commit 8ec41530.

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

This reverts commit cb93e652.

Change-Id: I32f15e546463ad127d1c6fb4896c5d2c22e216eb

Revert "Bluetooth MAP profile fix"

This reverts commit 249cf075.

Revert "32 bit int shifted by 36 bits at BluetoothMasObexServer.getUint32BigEndian"

This reverts commit a84419ca.

Revert "Ported: Bluetooth Message Access Profile (MAP) from CM9"

This reverts commit e3b96554.
parent 746ba58b
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -11,9 +11,6 @@ LOCAL_CERTIFICATE := platform

LOCAL_JNI_SHARED_LIBRARIES := libbluetooth_jni
LOCAL_JAVA_LIBRARIES := javax.obex

LOCAL_JAVA_LIBRARIES += telephony-common mms-common

LOCAL_STATIC_JAVA_LIBRARIES := com.android.vcard

LOCAL_REQUIRED_MODULES := libbluetooth_jni bluetooth.default
+0 −27
Original line number Diff line number Diff line
@@ -34,13 +34,6 @@
    <uses-permission android:name="android.permission.READ_CALL_LOG" />
    <uses-permission android:name="android.permission.READ_PHONE_STATE" />
    <uses-permission android:name="android.permission.WRITE_SETTINGS" />
    <uses-permission android:name="android.permission.READ_SMS"></uses-permission>
    <uses-permission android:name="android.permission.WRITE_SMS"></uses-permission>
    <uses-permission android:name="android.permission.BROADCAST_SMS"></uses-permission>
    <uses-permission android:name="android.permission.RECEIVE_SMS"></uses-permission>
    <uses-permission android:name="android.permission.SEND_SMS"></uses-permission>
    <uses-permission android:name="com.android.email.permission.ACCESS_PROVIDER"></uses-permission>
    <uses-permission android:name="com.android.email.permission.READ_ATTACHMENT"></uses-permission>
    <uses-permission android:name="com.android.permission.HANDOVER_STATUS" />
    <uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS" />
    <uses-permission android:name="android.permission.NET_ADMIN" />
@@ -60,7 +53,6 @@

    <!-- 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"
@@ -277,24 +269,5 @@
                <action android:name="android.bluetooth.IBluetoothPan" />
            </intent-filter>
        </service>
        <activity android:name=".map.BluetoothMasActivity"
            android:process="@string/process"
            android:excludeFromRecents="true"
            android:theme="@*android:style/Theme.Dialog.Alert">
            <intent-filter>
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>
        <service
            android:process="@string/process"
            android:name=".map.BluetoothMasService" >
        </service>
        <receiver
            android:process="@string/process"
            android:name=".map.BluetoothMasReceiver">
            <intent-filter>
                <action android:name="android.bluetooth.adapter.action.STATE_CHANGED"/>
            </intent-filter>
        </receiver>
    </application>
</manifest>

res/layout/access.xml

deleted100644 → 0
+0 −48
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
** Copyright 2009, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
**     http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
-->

<ScrollView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_height="match_parent"
    android:layout_width="match_parent">

    <LinearLayout
        android:layout_height="match_parent"
        android:layout_width="match_parent"
        android:orientation="vertical">

        <TextView
            android:id="@+id/message"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginLeft="20dip"
            android:layout_marginRight="20dip"
            android:gravity="center_horizontal"
            android:textAppearance="?android:attr/textAppearanceMedium" />

        <CheckBox android:id="@+id/alwaysallowed"
            style="?android:attr/textAppearanceMedium"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="2dip"
            android:text="@string/alwaysallowed" />

    </LinearLayout>

</ScrollView>
 No newline at end of file

res/values/strings_map.xml

deleted100644 → 0
+0 −44
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" translatable="false">@string/pbap_session_key_dialog_title</string>
    <string name="map_session_key_dialog_header" translatable="false">@string/pbap_session_key_dialog_header</string>
    <string name="map_acceptance_timeout_message" translatable="false">@string/pbap_acceptance_timeout_message</string>
    <string name="map_authentication_timeout_message" translatable="false">@string/pbap_authentication_timeout_message</string>
    <string name="map_notif_ticker" translatable="false">@string/auth_notif_ticker</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>
+0 −103
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
 * 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.
 */

package com.android.bluetooth.map;

import android.os.Handler;
import android.os.Message;
import android.util.Log;

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

/**
 * BluetoothMapAuthenticator is a used by BluetoothObexServer for obex
 * authentication procedure.
 */
public class BluetoothMapAuthenticator implements Authenticator {
    private static final String TAG = "BluetoothMapAuthenticator";

    private boolean mChallenged;

    private boolean mAuthCancelled;

    private String mSessionKey;

    private Handler mCallback;

    public BluetoothMapAuthenticator(final Handler callback) {
        mCallback = callback;
        mChallenged = false;
        mAuthCancelled = false;
        mSessionKey = null;
    }

    public final synchronized void setChallenged(final boolean bool) {
        mChallenged = bool;
    }

    public final synchronized void setCancelled(final boolean bool) {
        mAuthCancelled = bool;
    }

    public final synchronized void setSessionKey(final String string) {
        mSessionKey = string;
    }

    private void waitUserConfirmation() {
        Message msg = Message.obtain(mCallback);
        msg.what = BluetoothMasService.MSG_OBEX_AUTH_CHALL;
        msg.sendToTarget();
        synchronized (this) {
            while (!mChallenged && !mAuthCancelled) {
                try {
                    wait();
                } catch (InterruptedException e) {
                    Log.e(TAG, "Interrupted while waiting on isChalled");
                }
            }
        }
    }

      public PasswordAuthentication onAuthenticationChallenge(final String description,
            final boolean isUserIdRequired, final boolean isFullAccess) {
        waitUserConfirmation();
        if (mSessionKey.trim().length() != 0) {
            PasswordAuthentication pa = new PasswordAuthentication(null, mSessionKey.getBytes());
            return pa;
        }
        return null;
    }

    // TODO: Reserved for future use only, in case PSE challenge PCE
    public byte[] onAuthenticationResponse(final byte[] userName) {
        return null;
    }
}
Loading