summaryrefslogtreecommitdiffstats
path: root/src/com/android/bluetooth/map/BluetoothMapAuthenticator.java
diff options
context:
space:
mode:
authorCasper Bonde <c.bonde@samsung.com>2014-07-24 13:47:23 +0200
committerMatthew Xie <mattx@google.com>2014-08-06 00:06:12 -0700
commit326b5e610063ac24c0ba467ac585bd4c7f618a67 (patch)
tree863e6fa83714e668d7fc9eeab1c693942763b219 /src/com/android/bluetooth/map/BluetoothMapAuthenticator.java
parentf021c4ee6ba53c8512807c1469b2432278cf6cca (diff)
downloadandroid_packages_apps_Bluetooth-326b5e610063ac24c0ba467ac585bd4c7f618a67.tar.gz
android_packages_apps_Bluetooth-326b5e610063ac24c0ba467ac585bd4c7f618a67.tar.bz2
android_packages_apps_Bluetooth-326b5e610063ac24c0ba467ac585bd4c7f618a67.zip
BT MAP: added support for email sharing over BT
- added support for Emails - added activity to do setup of the email accounts to share - added improved handling of MMS, SMS and Email - Many optimizations to speed (especially getMessageListing) - fixed wakelock problem - fixed user timeout problem when user do not react to msg access request - added missing privileges - support for Quoted Printable format - added accountId in test case URIs - fixed problem with service numbers being strings - fixed problem with read flag in getMessage - added support for transparent flag in Email Push - added missing send-event for non-imap accounts - set attachment size to 0 if text-only message - fixed double send for sms messages with retry - removed secondary phone numbers from recipient/originator - removed insert-address-token in MMS messages - fixed null-pointer exception in settings (missing extra in intent) - send text-only mms as sms (workaround to make it cheaper) - fixed rejection of native and fraction requests - better handling of unknown message types in push - fixed problem with possible illigal xml chars in message listing - added missing WRITE_APN_SETTINGS permission to manifest - fixed problem with notifications when pushing to folders other than OUTBOX - removed debugging code - added support for threadId - fixed permission problems - changed to use ContentProviderClients for Email app access - fixed names for member vars UPDATE: Moved the MAP E-mail API to the bluetooth package. UPDATE: Added check for the presense of MMS parts. This is needed due to a change in the MMS app/subsystem, where deleted messages gets corrupted. Signed-off-by: Casper Bonde <c.bonde@samsung.com> Change-Id: Ib5dbe7c2d5c0ba8d978ae843d840028592e3cab4
Diffstat (limited to 'src/com/android/bluetooth/map/BluetoothMapAuthenticator.java')
-rw-r--r--src/com/android/bluetooth/map/BluetoothMapAuthenticator.java88
1 files changed, 0 insertions, 88 deletions
diff --git a/src/com/android/bluetooth/map/BluetoothMapAuthenticator.java b/src/com/android/bluetooth/map/BluetoothMapAuthenticator.java
deleted file mode 100644
index 2d345a133..000000000
--- a/src/com/android/bluetooth/map/BluetoothMapAuthenticator.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
-* Copyright (C) 2013 Samsung System LSI
-* 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.
-*/
-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 = BluetoothMapService.MSG_OBEX_AUTH_CHALL;
- msg.sendToTarget();
- synchronized (this) {
- while (!mChallenged && !mAuthCancelled) {
- try {
- wait();
- } catch (InterruptedException e) {
- Log.e(TAG, "Interrupted while waiting on isChallenged");
- }
- }
- }
- }
-
- 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 MSE challenge MCE
- public byte[] onAuthenticationResponse(final byte[] userName) {
- byte[] b = null;
- return b;
- }
-}