[GUIDE] UPDATED!!! [MOD] How to make Call Log Limit practically Unlimited

Search This thread

pollob666

Senior Member
Mar 4, 2011
106
92
38
Dhaka
OnePlus 3T
OnePlus 5

For Developers: If you are planning to compile your ROM, and want to use this mod, then read This Post


Background Story:

I was missing the CyberShot Camera too much and found Google Camera has been ported to JB :D And I also wanted to try the Moded LifeLog app, which somehow was not working on my Pacman Rom.
These were the reasons I Decided to come back to JB Stock Base. I had a previous Nandroid Backup of Lovin's Z2 ROM for XV. I took all my Call-Log and SMS Backups and also took backup of some apps that I used. Then I restored the NAND Backup today.
after that I started restoring the apps+data. Everything was fine.

After few hours of using, As I always do, I took the periodic backup of my Call Logs again. That's when I noticed, the previous Logs were 700+ and now after making some calls, it came down to 500. after Some test, I found out, this is not problem of Backup software.
A little Google search revealed Android has a default call log limit set to 500 Calls.

I searched for Xposed Mod for this, found TrimNot. But it showed error. Most probably, it is only for KK. Then I thought why not MOD it myself?

That's how it all started...

The research & work procedure:

I first thought, OK, I need to find where the Calls are stored. After passing some time with Google, I found, the Logs are stored in a SQlite3 Database, in
Code:
/data/data/com.android.providers.contacts/databases/contacts2.db
There is no limit in this database storage. So, the limit must be in the code.

After another couple of hours, I found that Android checks if the contacts has reached 500 then removes the older. Searching with


in android API reference, where I found some leads on my research.

"public class CallLog" which is under "android.provider.CallLog"

Something told me, to look for this class, in the actual source code. But that's almost 30 GB and I don't have time. from some prior Java knowledge I knew, all class have their own source file, with the same name, So the name would be "CallLog.java"
Now I searched Google, with it and found exactly what I was looking for. The search took me to a Git page android/platform_frameworks_base

And here I found this code.

Java:
private static void removeExpiredEntries(Context context) {
            final ContentResolver resolver = context.getContentResolver();
            resolver.delete(CONTENT_URI, "_id IN " +
                    "(SELECT _id FROM calls ORDER BY " + DEFAULT_SORT_ORDER
                    + " LIMIT -1 OFFSET 500)", null);
        }

The file is located in
Code:
platform_frameworks_base/core/java/android/provider/CallLog.java

and from the name I guessed, this should be inside framework files. Then I went into action. I first tried to de-compile the framework-res.apk file. I used Advanced APKTool by BDFreak
Using the windows search tool, I searched for "call log". I found nothing. Then I tried to de-compile "framework.jar". For this, I followed guide by Rizal Lovins - [Share Latest Apktool 4.2.2/Guide/Tutorial/] How to Decompile/Compile/Sign Apk/Jar

after the de-compiling was Done, I found there is a "android/provider" folder. Yes, it look similar to "platform_frameworks_base/core/java/android/provider/CallLog.java"
So, here should be the files. And I found Two files

Code:
CallLog$Calls.smali
CallLog.smali

I opened both with Notepad++,

CallLog.smali gave me noting. :(

But after a careful search, I found the exact query inside the ]CallLog$Calls.smali file.
I found this line -
Code:
const-string v2, "_id IN (SELECT _id FROM calls ORDER BY date DESC LIMIT -1 OFFSET 500)"

I just changed 500 to 100000 and I knew my task was done.

I then recompiled the framework.jar and took backup of my original framework.jar (took Nandroid backup ;) ), replaced the original with my modified JAR file. Set the permission rw-r-r or 644. Then rebooted my phone.


Testing:
After the phone started, I made a call, then took backup of the Call Log with Call Log Backup Restore it showed 501. :D :D :D

This means my task is done.

Then I thought, why not share the whole experience today in XDA. So I started Writing this Guide. :D:D:D

F.A.Q.
  1. Why I need more than 500 Call Log ?
    - Well I work in Billing Department of a GSM Phone Exchange/Gateway. I periodically cross check my phone Call Logs with the Exchange SoftSwitch Data. Except for that, It's just fun to try something new.
  2. Why this guide has no steps or required steps?
    - Because, if anything I missed, those will be added later in the FAQ, from the comments.
  3. Is this tested on any device?
    -Yes,
    My # Xperia V with LOVINS X™ Z2 ROM 9.2.A.2.5
    # Xperia V NeoWave™ ROM
    # Xperia TX OmniRom
    # Xperia TX (unknown ROM :( )
    # Xperia Z2 (unknown ROM :( )
    # Xperia P Stock ROM
    #Xperia P JB based Enigma v7.2 ROM
    #CyanogenMod 11 M11 and M12
  4. Can this work on my T/TX/TL/Z/Z1 etc. etc.
    - Theoretically it should work on any Device and any ROM. But, practically, I don't know, why don't you try yourself and let me know ;)
  5. I'm newbie, can you provide me more simple guide?
    - Well I'm a Newbie myself :) Just take a Nandroid Backup and start the process. What can go wrong? At most you'll have to restore the backup.
    Go to every link and read those too. And Don't forget to Thank those people who provided the Tools and Guides.

    Still If you don't understand my guide, read it twice, if it doesn't work read again.

    Ha Ha Ha kidding. :D:D:D:D Here you go A Simple guide

Update:

If you are planning to compile your ROM, and want to use this mod, then read This Post

I switched to NeoWave™ ROM and just as usual applied my MOD. Restored 800+ Call Log from Backup. Now I find another limitation. It's in the Dialer. In the KitKat Call History, there is a Statistics option. Here it always shows
TOTAL: 500 Calls,....
So Now I'm digging the sources again to make the stats go higher. :D

Update: The issue was caused because, after sometimes (any call), the call history automatically turned to 500. Because the framework.jar was odexed and i guess, odex file had the old value set again. And for the NeoWave I used android MultiTool, it showed one error while compiling, Unsigned Short value exceeds, I didn't notice that. My bad. :eek: Now I have done the Mod again with Apktool (Lovins shared one) and removed the odex file and then Everything seems fine. Even the Statistics Shows, TOATAL: 1203 Calls, .... :D
 

Attachments

  • Portal-Focus.jpg
    Portal-Focus.jpg
    221 KB · Views: 540
Last edited:

Antiga Prime

Senior Member
Sep 25, 2012
994
637
Tested on OmniRom and works as expected. I've used an Xposed module before which does the same thing, but it's always nice to find new ways to implement things without having to use Xposed.
 

Antiga Prime

Senior Member
Sep 25, 2012
994
637
Thanks for the Confirmation. I am updating the Tasted Device & ROM. Your device is TX, Right? I guessed from the signeture :D

Yes, I have a TX.

Would you like to share the Xposed module you used before?

It's the same one linked in the OP, except it's named TrimNot, not TimNot. I thought it might be a different one given that the one linked above didn't work for @pollob666, but I guess it's because I'm on a 4.4 ROM.
 

acb123

Senior Member
Apr 15, 2011
98
36
This is great and I will try it out.

But there is also another ridiculous limitation, that is the maximum of 20 alarms you can have in the clock :mad:
 

pollob666

Senior Member
Mar 4, 2011
106
92
38
Dhaka
OnePlus 3T
OnePlus 5
  • Like
Reactions: prasadkumar013

jamoen

Senior Member
Nov 7, 2012
93
4
Thrissur
www.facebook.com
Please make the steps simple for a newbie

Well, I was looking for this feature since Google invented Android!:good:
I was using MIUI because of they're giving unlimited Call log. Then some one invented TrimNot on Aug 15, 201, I came again to OzcanRom (My Fav). Trim not doesn't work at all.
My question is, Can you make this step more simple. I'm a new bie. :fingers-crossed::)


Background Story:

I was missing the CyberShot Camera too much and found Google Camera has been ported to JB :D And I also wanted to try the Moded LifeLog app, which somehow was not working on my Pacman Rom.
These were the reasons I Decided to come back to JB Stock Base. I had a previous Nandroid Backup of Lovin's Z2 ROM for XV. I took all my Call-Log and SMS Backups and also took backup of some apps that I used. Then I restored the NAND Backup today.
after that I started restoring the apps+data. Everything was fine.

After few hours of using, As I always do, I took the periodic backup of my Call Logs again. That's when I noticed, the previous Logs were 700+ and now after making some calls, it came down to 500. after Some test, I found out, this is not problem of Backup software.
A little Google search revealed Android has a default call log limit set to 500 Calls.

I searched for Xposed Mod for this, found TrimNot. But it showed error. Most probably, it is only for KK. Then I thought why not MOD it myself?

That's how it all started...

The research :

I first thought, OK, I need to find where the Calls are stored. After passing some time with Google, I found, the Logs are stored in a SQlite3 Database, in
Code:
/data/data/com.android.providers.contacts/databases/contacts2.db
There is no limit in this database storage. So, the limit must be in the code.

After another couple of hours, I found that Android checks if the contacts has reached 500 then removes the older. Searching with



in android API reference, where I found some leads on my research.

"public class CallLog" which is under "android.provider.CallLog"

Something told me, to look for this class, in the actual source code. But that's almost 30 GB and I don't have time. from some prior Java knowledge I knew, all class have their own source file, with the same name, So the name would be "CallLog.java"
Now I searched Google, with it and found exactly what I was looking for. The search took me to a Git page android/platform_frameworks_base

And here I found this code.

Java:
private static void removeExpiredEntries(Context context) {
            final ContentResolver resolver = context.getContentResolver();
            resolver.delete(CONTENT_URI, "_id IN " +
                    "(SELECT _id FROM calls ORDER BY " + DEFAULT_SORT_ORDER
                    + " LIMIT -1 OFFSET 500)", null);
        }

The file is located in
Code:
platform_frameworks_base/core/java/android/provider/CallLog.java

and from the name I guessed, this should be inside framework files. Then I went into action. I first tried to de-compile the framework-res.apk file. I used Advanced APKTool by BDFreak
Using the windows search tool, I searched for "call log". I found nothing. Then I tried to de-compile "framework.jar". For this, I followed guide by Rizal Lovins - [Share Latest Apktool 4.2.2/Guide/Tutorial/] How to Decompile/Compile/Sign Apk/Jar

after the de-compiling was Done, I found there is a "android/provider" folder. Yes, it look similar to "platform_frameworks_base/core/java/android/provider/CallLog.java"
So, here should be the files. And I found Two files

Code:
CallLog$Calls.smali
CallLog.smali

I opened both with Notepad++,

CallLog.smali gave me noting. :(

But after a careful search, I found the exact query inside the ]CallLog$Calls.smali file.
I found this line -
Code:
const-string v2, "_id IN (SELECT _id FROM calls ORDER BY date DESC LIMIT -1 OFFSET 500)"

I just changed 500 to 100000 and I knew my task was done.

I then recompiled the framework.jar and took backup of my original framework.jar (took Nandroid backup ;) ), replaced the original with my modified JAR file. Set the permission rw-r-r or 644. Then rebooted my phone.

Testing:
After the phone started, I made a call, then took backup of the Call Log with Call Log Backup Restore it showed 501. :D :D :D

This means my task is done.

Then I thought, why not share the whole experience today in XDA. So I started Writing this Guide. :D:D:D


F.A.Q.
  1. Why I need more than 500 Call Log ?
    - Well I work in Billing Department of a GSM Phone Exchange/Gateway. I periodically cross check my phone Call Logs with the Exchange SoftSwitch Data. Except for that, It's just fun to try something new.
  2. Why this guide has no steps or required steps?
    - Because, if anything I missed, those will be added later in the FAQ, from the comments.
  3. Is this tested on any device?
    -Yes,
    My # Xperia V with LOVINS X™ Z2 ROM 9.2.A.2.5
    # Xperia TX OmniRom
    # Xperia TX (unknown ROM :( )
    # Xperia Z2 (unknown ROM :( )
    # Xperia P Stock ROM
  4. Can this work on my T/TX/TL/Z/Z1 etc. etc.
    - Theoretically it should work on any Device and any ROM. But, practically, I don't know, why don't you try yourself and let me know ;)


---------- Post added at 11:08 AM ---------- Previous post was at 10:10 AM ----------

Can you please share the framework.jar file that edited and recompiled by you? If you can make a edited framework.jar for OzcanRom 4.2, I will be very thankful. I spent almost two nights on this and failed. Please help. :confused::silly::fingers-crossed:

Tested on OmniRom and works as expected. I've used an Xposed module before which does the same thing, but
it's always nice to find new ways to implement things without having to use Xposed.
 

pollob666

Senior Member
Mar 4, 2011
106
92
38
Dhaka
OnePlus 3T
OnePlus 5
A Simpler guide

My question is, Can you make this step more simple. I'm a new bie. :fingers-crossed::)

Can you please share the framework.jar file that edited and recompiled by you? If you can make a edited framework.jar for OzcanRom 4.2, I will be very thankful. I spent almost two nights on this and failed. Please help. :confused::silly::fingers-crossed:

No need to Quote the whole OP ;) ;)

My framework.jar won't work for you. We need to modify your ROM's framework.jar if you can provide me that file, I can MOD it for you.

But, I am giving the Simple steps. I would be very happy if you can do it yourself.

I am assuming you already have Notepad++ or Similar text editing tool and know how to pull files from /system

Step 1: Download APKTool of your choice. I used Advanced APKTool by BDFreak

Step 2: Decompile your framework.jar. For this, I followed guide by Rizal Lovins - [Share Latest Apktool 4.2.2/Guide/Tutorial/] How to Decompile/Compile/Sign Apk/Jar

Step 3: Open the CallLog.smali file and any other files that starts with CallLog ( like in my case CallLog$Calls.smali ) in Notepad++ or any other Text Editor.

Step 4: search for "SELECT _id FROM calls ORDER BY" or similar lines. You will find LIMIT -1 OFFSET 500 change 500 with any number you want.

Step 5: Save the modified file smali, and recompile the jar file.

Step 6: Just to be safe, take a NANDROID backup.

Step 7: Take a backup of the original framework.jar, delete it from system and push the modified framework.jar to System and change permission to rw-r-r or 644. Reboot.

Step 8: test
 
Last edited:
  • Like
Reactions: m_zet

jamoen

Senior Member
Nov 7, 2012
93
4
Thrissur
www.facebook.com
Found the string in framework2.jar and edited. Success!!
Please help me to push it again...
Can I use esfile explorer?

---------- Post added at 02:31 PM ---------- Previous post was at 02:09 PM ----------

Found the string in framework2.jar and edited. Success!!
Please help me to push it again...
Can I use esfile explorer?

Unfortunately.. The method failed. Going back to MIUI in tears.. :(
 
Last edited:

pollob666

Senior Member
Mar 4, 2011
106
92
38
Dhaka
OnePlus 3T
OnePlus 5
Found the string in framework2.jar and edited. Success!!
Please help me to push it again...
Can I use esfile explorer?

---------- Post added at 02:31 PM ---------- Previous post was at 02:09 PM ----------



Unfortunately.. The method failed. Going back to MIUI in tears.. :(


WOW, you really did it. Sorry I was in training my juniors at office, didn't reply earlier.
You can use es explorer, or if you have adb, then you can use some shell commands. I can give you the commands, if you haven't done it already.

It should work. Let me check and mod a it for you.

Edit: Sorry, I don't have the framework2.jar. :( ant the ROM is too big for downloading now at office. But for Samsung device, I guess the re-compile process needs a bit working. you need to recompile the file, then open it in 7zip or WinRAR replace the AndroidManifest file with the file of the original, (then sign it then zipalign it not sure for jar file though). Then push it to the system.
 
Last edited:

jamoen

Senior Member
Nov 7, 2012
93
4
Thrissur
www.facebook.com
WOW, you really did it. Sorry I was in training my juniors at office, didn't reply earlier.
You can use es explorer, or if you have adb, then you can use some shell commands. I can give you the commands, if you haven't done it already.

It should work. Let me check and mod a it for you.

Edit: Sorry, I don't have the framework2.jar. :( ant the ROM is too big for downloading now at office. But for Samsung device, I guess the re-compile process needs a bit working. you need to recompile the file, then open it in 7zip or WinRAR replace the AndroidManifest file with the file of the original, (then sign it then zipalign it not sure for jar file though). Then push it to the system.

I double checked it. Again extracted the framework.jar and decompliled it.The string of 100000 is there. But this thing is not working. I don't know why.
Can I share you the framework2.jar with you?
 

Attachments

  • framework2.jar
    3.5 MB · Views: 12

pollob666

Senior Member
Mar 4, 2011
106
92
38
Dhaka
OnePlus 3T
OnePlus 5
I double checked it. Again extracted the framework.jar and decompliled it.The string of 100000 is there. But this thing is not working. I don't know why.
Can I share you the framework2.jar with you?


I will modify it and upload it for you. But I guess I will need the framework-res.apk with it. if there is any. But, I'm going home now, I'll update you by 11pm.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 13

    For Developers: If you are planning to compile your ROM, and want to use this mod, then read This Post


    Background Story:

    I was missing the CyberShot Camera too much and found Google Camera has been ported to JB :D And I also wanted to try the Moded LifeLog app, which somehow was not working on my Pacman Rom.
    These were the reasons I Decided to come back to JB Stock Base. I had a previous Nandroid Backup of Lovin's Z2 ROM for XV. I took all my Call-Log and SMS Backups and also took backup of some apps that I used. Then I restored the NAND Backup today.
    after that I started restoring the apps+data. Everything was fine.

    After few hours of using, As I always do, I took the periodic backup of my Call Logs again. That's when I noticed, the previous Logs were 700+ and now after making some calls, it came down to 500. after Some test, I found out, this is not problem of Backup software.
    A little Google search revealed Android has a default call log limit set to 500 Calls.

    I searched for Xposed Mod for this, found TrimNot. But it showed error. Most probably, it is only for KK. Then I thought why not MOD it myself?

    That's how it all started...

    The research & work procedure:

    I first thought, OK, I need to find where the Calls are stored. After passing some time with Google, I found, the Logs are stored in a SQlite3 Database, in
    Code:
    /data/data/com.android.providers.contacts/databases/contacts2.db
    There is no limit in this database storage. So, the limit must be in the code.

    After another couple of hours, I found that Android checks if the contacts has reached 500 then removes the older. Searching with


    in android API reference, where I found some leads on my research.

    "public class CallLog" which is under "android.provider.CallLog"

    Something told me, to look for this class, in the actual source code. But that's almost 30 GB and I don't have time. from some prior Java knowledge I knew, all class have their own source file, with the same name, So the name would be "CallLog.java"
    Now I searched Google, with it and found exactly what I was looking for. The search took me to a Git page android/platform_frameworks_base

    And here I found this code.

    Java:
    private static void removeExpiredEntries(Context context) {
                final ContentResolver resolver = context.getContentResolver();
                resolver.delete(CONTENT_URI, "_id IN " +
                        "(SELECT _id FROM calls ORDER BY " + DEFAULT_SORT_ORDER
                        + " LIMIT -1 OFFSET 500)", null);
            }

    The file is located in
    Code:
    platform_frameworks_base/core/java/android/provider/CallLog.java

    and from the name I guessed, this should be inside framework files. Then I went into action. I first tried to de-compile the framework-res.apk file. I used Advanced APKTool by BDFreak
    Using the windows search tool, I searched for "call log". I found nothing. Then I tried to de-compile "framework.jar". For this, I followed guide by Rizal Lovins - [Share Latest Apktool 4.2.2/Guide/Tutorial/] How to Decompile/Compile/Sign Apk/Jar

    after the de-compiling was Done, I found there is a "android/provider" folder. Yes, it look similar to "platform_frameworks_base/core/java/android/provider/CallLog.java"
    So, here should be the files. And I found Two files

    Code:
    CallLog$Calls.smali
    CallLog.smali

    I opened both with Notepad++,

    CallLog.smali gave me noting. :(

    But after a careful search, I found the exact query inside the ]CallLog$Calls.smali file.
    I found this line -
    Code:
    const-string v2, "_id IN (SELECT _id FROM calls ORDER BY date DESC LIMIT -1 OFFSET 500)"

    I just changed 500 to 100000 and I knew my task was done.

    I then recompiled the framework.jar and took backup of my original framework.jar (took Nandroid backup ;) ), replaced the original with my modified JAR file. Set the permission rw-r-r or 644. Then rebooted my phone.


    Testing:
    After the phone started, I made a call, then took backup of the Call Log with Call Log Backup Restore it showed 501. :D :D :D

    This means my task is done.

    Then I thought, why not share the whole experience today in XDA. So I started Writing this Guide. :D:D:D

    F.A.Q.
    1. Why I need more than 500 Call Log ?
      - Well I work in Billing Department of a GSM Phone Exchange/Gateway. I periodically cross check my phone Call Logs with the Exchange SoftSwitch Data. Except for that, It's just fun to try something new.
    2. Why this guide has no steps or required steps?
      - Because, if anything I missed, those will be added later in the FAQ, from the comments.
    3. Is this tested on any device?
      -Yes,
      My # Xperia V with LOVINS X™ Z2 ROM 9.2.A.2.5
      # Xperia V NeoWave™ ROM
      # Xperia TX OmniRom
      # Xperia TX (unknown ROM :( )
      # Xperia Z2 (unknown ROM :( )
      # Xperia P Stock ROM
      #Xperia P JB based Enigma v7.2 ROM
      #CyanogenMod 11 M11 and M12
    4. Can this work on my T/TX/TL/Z/Z1 etc. etc.
      - Theoretically it should work on any Device and any ROM. But, practically, I don't know, why don't you try yourself and let me know ;)
    5. I'm newbie, can you provide me more simple guide?
      - Well I'm a Newbie myself :) Just take a Nandroid Backup and start the process. What can go wrong? At most you'll have to restore the backup.
      Go to every link and read those too. And Don't forget to Thank those people who provided the Tools and Guides.

      Still If you don't understand my guide, read it twice, if it doesn't work read again.

      Ha Ha Ha kidding. :D:D:D:D Here you go A Simple guide

    Update:

    If you are planning to compile your ROM, and want to use this mod, then read This Post

    I switched to NeoWave™ ROM and just as usual applied my MOD. Restored 800+ Call Log from Backup. Now I find another limitation. It's in the Dialer. In the KitKat Call History, there is a Statistics option. Here it always shows
    TOTAL: 500 Calls,....
    So Now I'm digging the sources again to make the stats go higher. :D

    Update: The issue was caused because, after sometimes (any call), the call history automatically turned to 500. Because the framework.jar was odexed and i guess, odex file had the old value set again. And for the NeoWave I used android MultiTool, it showed one error while compiling, Unsigned Short value exceeds, I didn't notice that. My bad. :eek: Now I have done the Mod again with Apktool (Lovins shared one) and removed the odex file and then Everything seems fine. Even the Statistics Shows, TOATAL: 1203 Calls, .... :D
    2
    Tested on OmniRom and works as expected. I've used an Xposed module before which does the same thing, but it's always nice to find new ways to implement things without having to use Xposed.
    2
    Well, 95% of the work is done from your side. Just flash your OzcneROM. if you haven't done it already.
    Copy the modified Framework2.jar to your phones sd-card or internal storage if you have any. Open File Manager in your phone, go to /system/framework, rename the framework2.jar to something else. copy the modified jar from sd-card to /system/framework/
    then open up adb shell, and I have given how to change permission through ADB above. :)
    Then reboot, restore your calllog. then make a phone call, backup call log again. it should show something over 500. (in your case, 11000+) then it worked. Else it didn't. :(

    If he's going to flash something, he might as well just add the modified "framework2.jar" file to his ROM zip file in /system/framework and then flash that ROM. No need to be playing with permissions/ownership/ADB, etc.
    1
    This is great and I will try it out.

    But there is also another ridiculous limitation, that is the maximum of 20 alarms you can have in the clock :mad:

    for the clock there is this guide http://xdaforums.com/showpost.php?p=53591001&postcount=6 give it a look
    1
    Update for Developers

    If you are compiling your own ROM, I have some tips for you. The Call Log is updated, whenever you receive or make a call. Any update operation calls the function to remove the expired entries from the Call Log.
    The CM12 Sources defines the Function as below.
    Java:
            private static Uri addEntryAndRemoveExpiredEntries(Context context, Uri uri,
                    ContentValues values) {
                final ContentResolver resolver = context.getContentResolver();
                Uri result = resolver.insert(uri, values);
                resolver.delete(uri, "_id IN " +
                        "(SELECT _id FROM calls ORDER BY " + DEFAULT_SORT_ORDER
                        + " LIMIT -1 OFFSET 500)", null);
                return result;
            }
    Here you can make any modification to the OFFSET value. But the best part is, what happens when you remove the whole resolver.delete(....) line. It says that, Don't Delete anything. It does have one side effect though. The SQLite3 database will be huge. and the Dialer will be slow. And there will be more frequent Automatic Index Entry creation by the SQLite3. Other than that, Everything should be OK.
    So, without the Delete the above code will become something like below.
    Java:
            private static Uri addEntryAndRemoveExpiredEntries(Context context, Uri uri,
                    ContentValues values) {
                final ContentResolver resolver = context.getContentResolver();
                Uri result = resolver.insert(uri, values);
                return result;
            }
    the File, where the code is located may vary for Different ROMs. But I have checked the AOSP, CM and Omni Sources, all these ROMs have the same common file,
    Code:
    frameworks/base/core/java/android/provider/CallLog.java

    So, if you are Compiling any ROM, and you want to have the functionality of Unlimited Call Log, Just modify the file :)