summaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
authorDivya Sharma <c_shard@codeaurora.org>2015-02-26 02:10:10 -0800
committerSudhir Sharma <sudhshar@codeaurora.org>2015-03-10 15:29:28 -0700
commit490414ca1197017ccc3b4bf9dc75f673e49c6787 (patch)
tree30305740d7998a1a39b021942023cc6d21876f3b /src/com
parent9d81dc62517d86b1fccc65bcf87193819ce7c66d (diff)
downloadandroid_packages_apps_Bluetooth-490414ca1197017ccc3b4bf9dc75f673e49c6787.tar.gz
android_packages_apps_Bluetooth-490414ca1197017ccc3b4bf9dc75f673e49c6787.tar.bz2
android_packages_apps_Bluetooth-490414ca1197017ccc3b4bf9dc75f673e49c6787.zip
Compilation fix for bluetooth
Change-Id: I4fb839a8b2c8444ff3c3fcb5b1305ff65b7455f8
Diffstat (limited to 'src/com')
-rw-r--r--src/com/android/bluetooth/map/BluetoothMapContent.java15
-rw-r--r--src/com/android/bluetooth/map/BluetoothMapContentObserver.java14
-rwxr-xr-xsrc/com/android/bluetooth/map/BluetoothMapObexServer.java19
-rw-r--r--src/com/android/bluetooth/map/BluetoothMapService.java21
-rw-r--r--src/com/android/bluetooth/map/BluetoothMapSmsPdu.java2
5 files changed, 20 insertions, 51 deletions
diff --git a/src/com/android/bluetooth/map/BluetoothMapContent.java b/src/com/android/bluetooth/map/BluetoothMapContent.java
index df15f66d8..3b871f41c 100644
--- a/src/com/android/bluetooth/map/BluetoothMapContent.java
+++ b/src/com/android/bluetooth/map/BluetoothMapContent.java
@@ -2233,8 +2233,18 @@ public class BluetoothMapContent {
fi.msgType = FilterInfo.TYPE_EMAIL;
String where = setWhereFilter(folder, fi, ap);
+ where+= " AND "+ Message.FLAG_LOADED_SELECTION;
Log.d(TAG, "where clause is = " + where);
- try {
+ where+= " order by timeStamp desc ";
+ //Fetch only maxListCount emails from startOffset
+ if(ap.getMaxListCount() > 0 && ap.getMaxListCount() < 65536) {
+ where+=" LIMIT "+ap.getMaxListCount();
+ }
+ if(ap.getStartOffset() > 0 && ap.getStartOffset() < 65536) {
+ where+=" OFFSET "+ap.getStartOffset();
+ }
+ if (V) Log.d(TAG, "where clause is = " + where);
+ try {
Cursor c = mResolver.query(uriEmail,
EMAIL_PROJECTION, where + " AND " + Message.FLAG_LOADED_SELECTION, null, "timeStamp desc");
if(c == null) {
@@ -2259,7 +2269,8 @@ public class BluetoothMapContent {
/* Enable this if post sorting and segmenting needed */
bmList.sort();
- bmList.segment(ap.getMaxListCount(), ap.getStartOffset());
+ //Handle OFFSET and MAXLISTCOUNT from DB query
+// bmList.segment(ap.getMaxListCount(), ap.getStartOffset());
return bmList;
}
diff --git a/src/com/android/bluetooth/map/BluetoothMapContentObserver.java b/src/com/android/bluetooth/map/BluetoothMapContentObserver.java
index e746ce927..f8f1c2bbf 100644
--- a/src/com/android/bluetooth/map/BluetoothMapContentObserver.java
+++ b/src/com/android/bluetooth/map/BluetoothMapContentObserver.java
@@ -383,7 +383,6 @@ public class BluetoothMapContentObserver {
while (c != null && c.moveToNext()) {
long id = c.getLong(c.getColumnIndex(Sms._ID));
int type = c.getInt(c.getColumnIndex(Sms.TYPE));
-
Msg msg = new Msg(id, type);
msgListSms.put(id, msg);
@@ -557,9 +556,9 @@ public class BluetoothMapContentObserver {
mResolver.update(uri, contentValues, null, null);
} else {
/* Delete from observer message list to avoid delete notifications */
- synchronized(mMsgListMms) {
+ synchronized(mMsgListMms) {
mMsgListMms.remove(handle);
- }
+ }
/* Delete message */
mResolver.delete(uri, null, null);
}
@@ -628,9 +627,9 @@ public class BluetoothMapContentObserver {
mResolver.update(uri, contentValues, null, null);
} else {
/* Delete from observer message list to avoid delete notifications */
- synchronized(mMsgListSms) {
+ synchronized(mMsgListSms) {
mMsgListSms.remove(handle);
- }
+ }
/* Delete message */
mResolver.delete(uri, null, null);
}
@@ -904,7 +903,7 @@ public class BluetoothMapContentObserver {
contentResolver.update(uri, data, whereClause, null);
Log.d(TAG, "moved draft MMS to outbox");
}
-
+
addMceInitiatedOperation(Long.toString(handle));
} else {
Log.d(TAG, "Could not move draft to outbox ");
@@ -968,7 +967,6 @@ public class BluetoothMapContentObserver {
if (c != null && c.moveToFirst()) {
long id = c.getLong(c.getColumnIndex(Mms._ID));
int type = c.getInt(c.getColumnIndex(Mms.MESSAGE_BOX));
-
/* We must filter out any actions made by the MCE. Add the new message to
* the list of known messages. */
@@ -1045,7 +1043,7 @@ public class BluetoothMapContentObserver {
}
}
addMceInitiatedOperation("+");
- }
+ }
}
catch (UnsupportedEncodingException e) {
Log.w(TAG, e);
diff --git a/src/com/android/bluetooth/map/BluetoothMapObexServer.java b/src/com/android/bluetooth/map/BluetoothMapObexServer.java
index bcb3bcc0a..53fedd9da 100755
--- a/src/com/android/bluetooth/map/BluetoothMapObexServer.java
+++ b/src/com/android/bluetooth/map/BluetoothMapObexServer.java
@@ -148,25 +148,6 @@ public class BluetoothMapObexServer extends ServerRequestHandler {
tmpFolder.addFolder("drafts");
}
- private void addEmailFolders(BluetoothMapFolderElement parentFolder) throws RemoteException {
- // Select all parent folders
- BluetoothMapFolderElement newFolder;
-
- String where = BluetoothMapContract.FolderColumns.PARENT_FOLDER_ID +
- " = " + parentFolder.getEmailFolderId();
- Cursor c = mProviderClient.query(mEmailFolderUri,
- BluetoothMapContract.BT_FOLDER_PROJECTION, where, null, null);
- try {
- while (c != null && c.moveToNext()) {
- String name = c.getString(c.getColumnIndex(BluetoothMapContract.FolderColumns.NAME));
- long id = c.getLong(c.getColumnIndex(BluetoothMapContract.FolderColumns._ID));
- newFolder = parentFolder.addEmailFolder(name, id);
- addEmailFolders(newFolder); // Use recursion to add any sub folders
- }
- } finally {
- if (c != null) c.close();
- }
- }
@Override
public int onConnect(final HeaderSet request, HeaderSet reply) {
diff --git a/src/com/android/bluetooth/map/BluetoothMapService.java b/src/com/android/bluetooth/map/BluetoothMapService.java
index 672079822..d7d6a6178 100644
--- a/src/com/android/bluetooth/map/BluetoothMapService.java
+++ b/src/com/android/bluetooth/map/BluetoothMapService.java
@@ -1206,25 +1206,4 @@ public class BluetoothMapService extends ProfileService {
}
};
- @Override
- public void dump(StringBuilder sb) {
- super.dump(sb);
- println(sb, "mRemoteDevice: " + mRemoteDevice);
- println(sb, "sRemoteDeviceName: " + sRemoteDeviceName);
- println(sb, "mState: " + mState);
- println(sb, "mAppObserver: " + mAppObserver);
- println(sb, "mIsWaitingAuthorization: " + mIsWaitingAuthorization);
- println(sb, "mRemoveTimeoutMsg: " + mRemoveTimeoutMsg);
- println(sb, "mPermission: " + mPermission);
- println(sb, "mAccountChanged: " + mAccountChanged);
- println(sb, "mBluetoothMnsObexClient: " + mBluetoothMnsObexClient);
- println(sb, "mMasInstanceMap:");
- for (BluetoothMapEmailSettingsItem key : mMasInstanceMap.keySet()) {
- println(sb, " " + key + " : " + mMasInstanceMap.get(key));
- }
- println(sb, "mEnabledAccounts:");
- for (BluetoothMapEmailSettingsItem account : mEnabledAccounts) {
- println(sb, " " + account);
- }
- }
}
diff --git a/src/com/android/bluetooth/map/BluetoothMapSmsPdu.java b/src/com/android/bluetooth/map/BluetoothMapSmsPdu.java
index bf91a56de..caf8b02e3 100644
--- a/src/com/android/bluetooth/map/BluetoothMapSmsPdu.java
+++ b/src/com/android/bluetooth/map/BluetoothMapSmsPdu.java
@@ -471,7 +471,7 @@ public class BluetoothMapSmsPdu {
int activePhone = TelephonyManager.getDefault().getCurrentPhoneType(); // TODO: Change to use: ((TelephonyManager)myContext.getSystemService(Context.TELEPHONY_SERVICE))
int phoneType;
GsmAlphabet.TextEncodingDetails ted = (PHONE_TYPE_CDMA == activePhone) ?
- com.android.internal.telephony.cdma.SmsMessage.calculateLength((CharSequence)messageText, false, true) :
+ com.android.internal.telephony.cdma.SmsMessage.calculateLength((CharSequence)messageText, false) :
com.android.internal.telephony.gsm.SmsMessage.calculateLength((CharSequence)messageText, false);
SmsPdu newPdu;