summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2015-03-05 19:40:17 -0800
committerGerrit - the friendly Code Review server <code-review@localhost>2015-03-05 19:40:17 -0800
commit2fbd4fe394d172e15aad06dfb5f6d977102c1f0a (patch)
treedf27eb9f42055361f7b8bbfc98c279dd5b8bb0f9
parenta5e54322e140584d924b1e4ae96418f0b4ac4254 (diff)
parent2c10e9a62501786ec6fa676decdd266285ef1405 (diff)
downloadandroid_packages_apps_Bluetooth-2fbd4fe394d172e15aad06dfb5f6d977102c1f0a.tar.gz
android_packages_apps_Bluetooth-2fbd4fe394d172e15aad06dfb5f6d977102c1f0a.tar.bz2
android_packages_apps_Bluetooth-2fbd4fe394d172e15aad06dfb5f6d977102c1f0a.zip
Merge "Check previous user confirmation before auto-confirm put request"
-rw-r--r--src/com/android/bluetooth/opp/BluetoothOppObexServerSession.java2
-rw-r--r--src/com/android/bluetooth/opp/BluetoothOppService.java14
-rw-r--r--src/com/android/bluetooth/opp/BluetoothOppTransfer.java8
3 files changed, 12 insertions, 12 deletions
diff --git a/src/com/android/bluetooth/opp/BluetoothOppObexServerSession.java b/src/com/android/bluetooth/opp/BluetoothOppObexServerSession.java
index c7876409e..5adad6994 100644
--- a/src/com/android/bluetooth/opp/BluetoothOppObexServerSession.java
+++ b/src/com/android/bluetooth/opp/BluetoothOppObexServerSession.java
@@ -395,7 +395,7 @@ public class BluetoothOppObexServerSession extends ServerRequestHandler implemen
boolean needConfirm = true;
/** It's not first put if !serverBlocking, so we auto accept it */
- if (!mServerBlocking) {
+ if (!mServerBlocking && mAccepted == BluetoothShare.USER_CONFIRMATION_CONFIRMED) {
values.put(BluetoothShare.USER_CONFIRMATION,
BluetoothShare.USER_CONFIRMATION_AUTO_CONFIRMED);
needConfirm = false;
diff --git a/src/com/android/bluetooth/opp/BluetoothOppService.java b/src/com/android/bluetooth/opp/BluetoothOppService.java
index 6f88d7362..2cec3b1c4 100644
--- a/src/com/android/bluetooth/opp/BluetoothOppService.java
+++ b/src/com/android/bluetooth/opp/BluetoothOppService.java
@@ -827,7 +827,7 @@ public class BluetoothOppService extends Service {
info.mDestination = stringFromCursor(info.mDestination, cursor, BluetoothShare.DESTINATION);
int newVisibility = cursor.getInt(cursor.getColumnIndexOrThrow(BluetoothShare.VISIBILITY));
- boolean confirmed = false;
+ boolean confirmUpdated = false;
int newConfirm = cursor.getInt(cursor
.getColumnIndexOrThrow(BluetoothShare.USER_CONFIRMATION));
@@ -843,7 +843,7 @@ public class BluetoothOppService extends Service {
&& (newConfirm == BluetoothShare.USER_CONFIRMATION_CONFIRMED ||
newConfirm == BluetoothShare.USER_CONFIRMATION_AUTO_CONFIRMED ||
newConfirm == BluetoothShare.USER_CONFIRMATION_HANDOVER_CONFIRMED)) {
- confirmed = true;
+ confirmUpdated = true;
}
info.mConfirm = newConfirm;
int newStatus = cursor.getInt(statusColumn);
@@ -860,14 +860,14 @@ public class BluetoothOppService extends Service {
info.mTimestamp = cursor.getLong(cursor.getColumnIndexOrThrow(BluetoothShare.TIMESTAMP));
info.mMediaScanned = (cursor.getInt(cursor.getColumnIndexOrThrow(Constants.MEDIA_SCANNED)) != Constants.MEDIA_SCANNED_NOT_SCANNED);
- if (confirmed) {
- if (V) Log.v(TAG, "Service handle info " + info.mId + " confirmed");
- /* Inbounds transfer get user confirmation, so we start it */
+ if (confirmUpdated) {
+ if (V) Log.v(TAG, "Service handle info " + info.mId + " confirmation updated");
+ /* Inbounds transfer user confirmation status changed, update the session server */
int i = findBatchWithTimeStamp(info.mTimestamp);
if (i != -1) {
BluetoothOppBatch batch = mBatchs.get(i);
if (mServerTransfer != null && batch.mId == mServerTransfer.getBatchId()) {
- mServerTransfer.setConfirmed();
+ mServerTransfer.confirmStatusChanged();
} //TODO need to think about else
}
}
@@ -1012,7 +1012,7 @@ public class BluetoothOppService extends Service {
BluetoothOppShareInfo mPendingShare = nextBatch.getPendingShare();
if ((mPendingShare != null) && (mPendingShare.mConfirm ==
BluetoothShare.USER_CONFIRMATION_CONFIRMED)) {
- mServerTransfer.setConfirmed();
+ mServerTransfer.confirmStatusChanged();
}
return;
}
diff --git a/src/com/android/bluetooth/opp/BluetoothOppTransfer.java b/src/com/android/bluetooth/opp/BluetoothOppTransfer.java
index 9f8a71d86..9c639c72f 100644
--- a/src/com/android/bluetooth/opp/BluetoothOppTransfer.java
+++ b/src/com/android/bluetooth/opp/BluetoothOppTransfer.java
@@ -566,7 +566,7 @@ public class BluetoothOppTransfer implements BluetoothOppBatch.BluetoothOppBatch
if (V) Log.v(TAG, "processCurrentShare" + mCurrentShare.mId);
mSession.addShare(mCurrentShare);
if (mCurrentShare.mConfirm == BluetoothShare.USER_CONFIRMATION_HANDOVER_CONFIRMED) {
- setConfirmed();
+ confirmStatusChanged();
}
}
@@ -574,7 +574,7 @@ public class BluetoothOppTransfer implements BluetoothOppBatch.BluetoothOppBatch
* Set transfer confirmed status. It should only be called for inbound
* transfer
*/
- public void setConfirmed() {
+ public void confirmStatusChanged() {
/* unblock server session */
final Thread notifyThread = new Thread("Server Unblock thread") {
public void run() {
@@ -584,7 +584,7 @@ public class BluetoothOppTransfer implements BluetoothOppBatch.BluetoothOppBatch
}
}
};
- if (V) Log.v(TAG, "setConfirmed to unblock mSession" + mSession.toString());
+ if (V) Log.v(TAG, "confirmStatusChanged to unblock mSession" + mSession.toString());
notifyThread.start();
}
@@ -848,7 +848,7 @@ public class BluetoothOppTransfer implements BluetoothOppBatch.BluetoothOppBatch
if (V) Log.v(TAG, "Transfer continue session for info " + mCurrentShare.mId +
" from batch " + mBatch.mId);
processCurrentShare();
- setConfirmed();
+ confirmStatusChanged();
}
}
}