charging, battery, performance, caches and battery calibration myths busted

  1. Smolda
    Eclair Sep 9, 2020

    Smolda , Sep 9, 2020 :
    Sorry, ADB method
    cmd package bg-dexopt-job

  2. Smolda
    Eclair Sep 9, 2020

    Smolda , Sep 9, 2020 :
    So, if I will do that "extreme stuff" ADB command (cmd package compile -m everything -f -a) it will convert everything to Aot and with the Android 10/11 I will have better battery life and less drain?

  3. palc001
    Ice Cream Sandwich Sep 10, 2020

    palc001 , via OnePlus Nord , Sep 10, 2020 :
    Yes you will have battery life but lose a lot of storage as mentioned in the OP. I haven't tried it personally but the whole point OP tries to explain is that the apps drain battery coz they're not optimised. And hence poor battery life. Which shows from the posts of numerous users here that confirm charging overnight for a week reduces their drain a lot. The only voodoo that happens on overnight charging is app optimization. So, Yes, doing the ADB command should lead to a similar result at the cost of your useful storage.

    Smolda likes this.
  4. Smolda
    Eclair Sep 10, 2020

    Smolda , Sep 10, 2020 :
    And (mabie) last question, i have all apps set optimize and set dont use background data (i do not mind drawbacks) is it good to have, or is it contraproductive? Thank you.
    ps: How much more storage it will consume (estimate) ? i have ocupied 33% of storage, i dont have much apps. Thanks

  5. palc001
    Ice Cream Sandwich Sep 10, 2020

    palc001 , Sep 10, 2020 :
    1. Having all apps set to optimize is counterproductive. Apps set to optimize are not generally stored in memory for more than 10 mins of no use. So basically your RAM management for apps will suffer. Your apps will reload everytime you launch them. Also your conversation apps will suffer, you'll not receive messages on time (even sms along with WhatsApp, Insta, etc.). Necessary background processes suffer which may lead to a hampering of the smooth experience OnePlus touts.
    And the battery life gain is not much. On an average you gain about 1.5-2 hours standby but at what cost. Optimising apps to use ART instead of JIT should already give that much and more.
    The Optimization OP talks about is different from the Optimize option present in settings. OP talks about app optimization in the sense of pre-compilation of apps that helps with loading times and battery consumed by the app. The settings option is for the OS to close the app and not let it run in background so as to prevent background wake cycles, etc. Totally unrelated and nothing to do with compilers. It's all mentioned in the OP. All you need to do is read.

    2. Again, answering based on the OP. OP recommends to do it if you have about 50% of your storage lying around without use. So you should think of doing it only if you are sure you're not going to go above 50% storage use in the near future.
    It can get counter productive to do it in case your phone storage level gets low after using the command to compile all apps. Android tends to lag a lot when 90% storage is filled.
    Also, remember that you're going to have to repeat it after every new update.

    All in all, I believe letting Android decide what apps to run using AOT and what to run with JIT is the best. OP mentions the pros and cons of both and maybe in some situation JIT runs better than AOT. What this overnight charging (keeping phone on) does is it compiles, for AOT, only those apps that OS chooses. Other apps keep running on JIT. That list is formed as and when needed and apps get optimized accordingly. By force compiling all apps so as to use AOT (by using the adb command) can lead to a counter productive outcome based on the apps you have.

  6. G1598478413893
    Cupcake Sep 11, 2020

  7. anupritaisno1
    KitKat Sep 15, 2020

    anupritaisno1 , Sep 15, 2020 :
    ROMs like glassrom and grapheneos that focus on security cannot allow dynamic code generation and execution that JIT does. These ROMs will force all apps to use speed/everything as a compilation filter. This is because there are serious security concerns with JIT. Observe how I have edited the post to include the order of security

    Also these ROMs will NOT use JIT even by accident. JIT is turned off in ART configs as well as selinux. Any attempt to execute JIT code will be rejected by selinux even if ART tries to. This command is a way to test those flags on AOSP before applying it to hardened ROMs. Running this command on a non hardened ROM does not guarantee security as neither selinux nor ART stop generating JIT code. There is no way to disable JIT unless you're building the ROM yourself

    palc and G_plusone like this.
  8. DinethIrusha
    Honeycomb Sep 18, 2020

    DinethIrusha , Sep 18, 2020 :
    Hi Sir,
    Good explanation on the thread, Thanks for the thread aswell, But I have this issue I tried to run the "Extreme stuff" commands but It gave me this.

    what should I do?

  9. dpbasu
    Eclair Sep 21, 2020

    dpbasu , Sep 21, 2020 :
    Hi @anupritaisno1 ,
    Thanks a lot for clearing a lot of my misconceptions. Can you clear just one more? I want to know exactly what happens when an app is cleared from the recent apps menu. I have read from Google devs that clearing recent apps is not good. I'm more concerned about saving battery life than letting the apps run their background processes. What should I use while exiting from an app - the Home button(swipe up gesture) or the back button(swipe on the edges)? I have Googled and found out that home button pauses the app, and back button exits the app. Which one is better in terms of getting maximum battery life out of my device?
    I'm using a Oneplus 8 running Android 10 for your reference.

    G_plusone likes this.
  10. G1598478413893
    Cupcake Sep 24, 2020

    G1598478413893 , via OnePlus 8 , Sep 24, 2020 :
    I optimized battery with adb, im not cleaning cache, i use only couple apps and my battery is draining so fast. Percentages disappear in the eyes. I tried charging overnight. I dont see that any app or system app is draining im the stats but its draining.

  11. U1600538844939
    Cupcake Sep 27, 2020

    U1600538844939 , Sep 27, 2020 :
    If I was going to deal with so many technical terms, why did I pay so much for this phone? Why does the phone compile with JIT or AOT interest me? I am an end user. After 30 minutes of WhatsApp use, the phone's charge decreases by 10-15%. Stop blaming the users. OP8 Pro is a very nice phone, but the battery is disgrace. I regret. My old phone (Xiaomi Mi Note 10 Pro) has 12 hours system on time. Now? Only 4 hours :) Same apps, same usage habits, but very different battery values .. My first Oneplus phone but regret it.

  12. ChaitanOneplus
    Eclair Sep 29, 2020

    ChaitanOneplus , via OnePlus 7 Pro , Sep 29, 2020 :
    I don't clear cache & do nothing with my phone unnecessary, but after this new update OOS 10.3.4 in my OP7PRO , my device is heating while charging & OnePlus claims that their phones don't heat while charging , remember my temperature goes upto 43° .
    If I post a bug report , but no improvements [e]1f61e[/e] so sad to see mid range bugs in a flagship one even my phone is new.
    And if I make a call to OnePlus for this kind of bugs , they tell us to clear cache always & nothing else.......

    But I didn't get one thing ...- (DOES CHARGING OVERNIGHT IMPROVE BATTERY )...Im a but confused after reading your thread , bcoz youtubers say that don't charge over night & charge only till 80-90 % ....so please make it clear over here ...

  13. anupritaisno1
    KitKat Oct 11, 2020

    anupritaisno1 , Oct 11, 2020 :
    Many apps with native code cannot be fully optimized this way. It is normal

  14. anupritaisno1
    KitKat Oct 11, 2020

    anupritaisno1 , Oct 11, 2020 :
    The answer is that it depends on the app, at least on AOSP. Apps can keep running in the background even when you swipe them away

    Oxygenos is a mess. See https://dontkillmyapp.com

  15. anupritaisno1
    KitKat Oct 11, 2020

    anupritaisno1 , Oct 11, 2020 :
    Optimizing all apps will save a lot of ram that is otherwise required to run them and should improve RAM management. In almost all cases performance is improved as well

    While most developers would agree with your last point, empirical evidence shows otherwise

  16. anupritaisno1
    KitKat Oct 11, 2020

    anupritaisno1 , Oct 11, 2020 :
    This is not a customer support thread nor a post by a oneplus employee

    Please go somewhere else instead of ranting here. It isn't doing you any good either

  17. Sky4fin
    Cupcake Oct 26, 2020

    Sky4fin , via OnePlus 8 Pro , Oct 26, 2020 :
    Can you please explain this in a simple tearms because I am new to this things.

    And what is the use of this amd will if extend the battery life?
    I currently get 8hr of SoT with QHD and 120hz.

  18. DinethIrusha
    Honeycomb Oct 30, 2020

  19. Omer Farah
    Cupcake Nov 11, 2020