am 541939ff: am 77b122f5: For PBAP, Limit the number of call log to CALLLOG_NUM_LIMIT

Merge commit '541939ff48867b2a8656503d29f29eb6bf6f1a30'

* commit '541939ff48867b2a8656503d29f29eb6bf6f1a30':
  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 58ced0c..cc14634 100644
--- a/src/com/android/bluetooth/pbap/BluetoothPbapObexServer.java
+++ b/src/com/android/bluetooth/pbap/BluetoothPbapObexServer.java
@@ -148,6 +148,8 @@
 
     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;
@@ -903,6 +905,13 @@
             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;