From: a5206c Date: Wed, 22 Sep 2010 19:47:06 +0000 (+0800) Subject: For PBAP, Limit the number of call log to CALLLOG_NUM_LIMIT X-Git-Tag: android-7.1.2_r17~1342^2^2~19 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=77b122f551ae37811c75ae76fa2029f7b3f2f404;p=android-x86%2Fpackages-apps-Bluetooth.git For PBAP, Limit the number of call log to CALLLOG_NUM_LIMIT --- diff --git a/src/com/android/bluetooth/pbap/BluetoothPbapObexServer.java b/src/com/android/bluetooth/pbap/BluetoothPbapObexServer.java index ff014b9f..3ce324cf 100644 --- a/src/com/android/bluetooth/pbap/BluetoothPbapObexServer.java +++ b/src/com/android/bluetooth/pbap/BluetoothPbapObexServer.java @@ -148,6 +148,8 @@ public class BluetoothPbapObexServer extends ServerRequestHandler { private int mOrderBy = ORDER_BY_INDEXED; + private static int CALLLOG_NUM_LIMIT = 50; + public static int ORDER_BY_INDEXED = 0; public static int ORDER_BY_ALPHABETICAL = 1; @@ -942,6 +944,13 @@ public class BluetoothPbapObexServer extends ServerRequestHandler { return ResponseCodes.OBEX_HTTP_OK; } + // Limit the number of call log to CALLLOG_NUM_LIMIT + if (appParamValue.needTag != BluetoothPbapObexServer.ContentType.PHONEBOOK) { + if (requestSize > CALLLOG_NUM_LIMIT) { + requestSize = CALLLOG_NUM_LIMIT; + } + } + int endPoint = startPoint + requestSize - 1; if (endPoint > pbSize - 1) { endPoint = pbSize - 1;