<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Kartik Thakur</title>
    <description>The latest articles on DEV Community by Kartik Thakur (@kartik_thakur).</description>
    <link>https://dev.to/kartik_thakur</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1847908%2F3c94f7b2-a5ad-48c3-b2c2-829ea398d088.jpg</url>
      <title>DEV Community: Kartik Thakur</title>
      <link>https://dev.to/kartik_thakur</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kartik_thakur"/>
    <language>en</language>
    <item>
      <title>Upgrading the Realme Narzo 30 4G from Realme UI (Android 12) to Android 16: BROM Unlock, 90Hz Fix &amp; Performance Tuning</title>
      <dc:creator>Kartik Thakur</dc:creator>
      <pubDate>Fri, 16 Oct 2026 10:46:09 +0000</pubDate>
      <link>https://dev.to/kartik_thakur/upgrading-the-realme-narzo-30-4g-from-realme-ui-android-12-to-android-16-brom-unlock-90hz-fix--kol</link>
      <guid>https://dev.to/kartik_thakur/upgrading-the-realme-narzo-30-4g-from-realme-ui-android-12-to-android-16-brom-unlock-90hz-fix--kol</guid>
      <description>&lt;p&gt;When dealing with aging MediaTek devices, software updates usually end long before the silicon becomes truly obsolete. The &lt;strong&gt;Realme Narzo 30 4G&lt;/strong&gt; (model &lt;code&gt;RMX2156&lt;/code&gt;, unified board tree &lt;code&gt;RM6785&lt;/code&gt; / &lt;code&gt;salaa&lt;/code&gt;), powered by the 12nm &lt;strong&gt;MediaTek Helio G95&lt;/strong&gt;, officially stopped receiving updates at &lt;strong&gt;Realme UI 3.0 (Android 12)&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;In this article, we share how we took this device from stock Realme UI (Android 12), bypassed abandoned vendor unlock restrictions via low-level MediaTek Boot ROM (BROM) payload injection, migrated the platform to &lt;strong&gt;Android 16 (PixelOS 16.2)&lt;/strong&gt;, diagnosed lingering hardware defects, eradicated an elusive &lt;strong&gt;90Hz display wake flicker&lt;/strong&gt;, audited the battery fuel gauge, and engineered a comprehensive OS optimization suite delivering over 6 hours of Screen-on-Time on a degraded cell.&lt;/p&gt;




&lt;h2&gt;
  
  
  Prerequisites &amp;amp; Technical Requirements
&lt;/h2&gt;

&lt;p&gt;Before undertaking this platform migration, ensure the following hardware, software toolchains, and firmware baselines are configured:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Hardware Requirements
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Target Smartphone:&lt;/strong&gt; Realme Narzo 30 4G (model &lt;code&gt;RMX2156&lt;/code&gt;), charged to at least &lt;strong&gt;60% battery&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Host Workstation:&lt;/strong&gt; Windows 10/11 x64 or Linux PC with administrator privileges.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Data Cable:&lt;/strong&gt; High-quality USB-C to USB-A cable connected directly to the motherboard rear ports (avoid unpowered USB hubs or loose front-panel headers to prevent BROM handshake drops).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Backup Storage:&lt;/strong&gt; Complete off-device backup of personal photos, messages, and accounts (bootloader unlocking and Android 16 encryption resets completely format internal storage).&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. Host Software &amp;amp; Drivers
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Android Platform-Tools:&lt;/strong&gt; Latest standalone &lt;code&gt;adb&lt;/code&gt; and &lt;code&gt;fastboot&lt;/code&gt; binaries (version 34+ or 37+).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Python Environment:&lt;/strong&gt; Python 3.10+ / 3.12 64-bit installed with &lt;code&gt;Add Python to PATH&lt;/code&gt; checked.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;BROM Filter Drivers:&lt;/strong&gt; &lt;code&gt;UsbDk&lt;/code&gt; (USB Development Kit for Windows) installed to manage low-level USB 3.0 xHCI endpoints without timing jitter.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Low-Level MTK Toolchain:&lt;/strong&gt; &lt;code&gt;mtkclient&lt;/code&gt; repository installed with Python dependencies:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;  pip &lt;span class="nb"&gt;install &lt;/span&gt;pyusb pyserial json5 pycryptodome colorama
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  3. Firmware &amp;amp; Platform Baseline
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Mandatory Firmware Base:&lt;/strong&gt; &lt;strong&gt;Realme UI 3.0 / Android 12 (&lt;code&gt;F.xx&lt;/code&gt; series, e.g. &lt;code&gt;RMX2156_11_F.07&lt;/code&gt; through &lt;code&gt;F.12&lt;/code&gt;)&lt;/strong&gt;. 
&lt;em&gt;(Do not attempt this directly from Android 11 &lt;code&gt;C.xx&lt;/code&gt; firmware, as the vendor HALs and TrustZone keys must match the Android 12 baseline).&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Custom Recovery:&lt;/strong&gt; Dynamic-partition-compatible custom recovery (&lt;code&gt;recovery.img&lt;/code&gt; for &lt;code&gt;salaa&lt;/code&gt; / &lt;code&gt;RM6785&lt;/code&gt;, e.g. OrangeFox or PixelOS Recovery).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Disarmed VBMeta:&lt;/strong&gt; Verified &lt;code&gt;vbmeta.img&lt;/code&gt; to disable Android Verified Boot (AVB) flags (&lt;code&gt;--disable-verity --disable-verification&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Target ROM Archive:&lt;/strong&gt; &lt;strong&gt;PixelOS 16.2&lt;/strong&gt; (Android 16 Baklava build &lt;code&gt;BP4A.251205.006&lt;/code&gt; for &lt;code&gt;salaa&lt;/code&gt;).&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  1. Hardware Architecture &amp;amp; System Profile
&lt;/h2&gt;

&lt;p&gt;The Realme Narzo 30 4G shares a unified kernel and device tree with the Realme 6, 6i (Indian), 6s, 7, and Narzo 20 Pro (&lt;code&gt;RM6785&lt;/code&gt; / &lt;code&gt;salaa&lt;/code&gt;).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;+-----------------------------------------------------------------------------------+
|                           Realme Narzo 30 4G (RMX2156)                            |
+-----------------------------------------------------------------------------------+
|  SoC: MediaTek Helio G95 (MT6785V/CD) @ 12nm FinFET                               |
|  CPU: Octa-core (2x Cortex-A76 @ 2.05 GHz + 6x Cortex-A55 @ 2.00 GHz)             |
|  GPU: ARM Mali-G76 MC4 @ 900 MHz (Bifrost Architecture)                           |
|  RAM: 6 GB LPDDR4X (5.76 GB addressable)                                          |
|  Storage: 64/128 GB UFS 2.1 (Dynamic Partitions / `super.img`)                   |
|  Display: 6.5" IPS LCD, 1080x2400 (FHD+), 90Hz Native Refresh Rate                |
|  Power: 5,000 mAh Li-Po design (30W Dart Charge protocol)                         |
|  Starting OS: Realme UI 3.0 (Android 12 Baseline, Build F.xx)                     |
|  Target OS: PixelOS 16.2 (Android 16 Baklava, Build BP4A.251205.006)              |
+-----------------------------------------------------------------------------------+
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  2. Unlocking the Bootloader: Bypassing Deactivated Vendor Servers via BROM
&lt;/h2&gt;

&lt;p&gt;The official bootloader unlocking method for Realme devices requires an OEM authorization APK known as &lt;strong&gt;Deep Testing&lt;/strong&gt;. On Realme UI 3.0 (Android 12), the Deep Testing app systematically failed with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Model not supported / Failed to submit application
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Because Oppo/Realme has shut down or restricted backend verification servers for older MT6785 models, official unlocking was permanently blocked. To overcome this, we bypassed the Android userspace entirely and addressed the hardware security processor in &lt;strong&gt;MediaTek Boot ROM (BROM)&lt;/strong&gt; mode.&lt;br&gt;
&lt;/p&gt;

&lt;pre data-lang="mermaid"&gt;&lt;code&gt;flowchart LR
    A["Realme UI 3.0 (Locked Bootloader)"] --&amp;gt; B["BROM Mode (Vol Up + Vol Down + USB)"]
    B --&amp;gt; C["Inject SLA/DAA Bypass Payload"]
    C --&amp;gt; D["Direct seccfg Partition Unlock"]
    D --&amp;gt; E["Fastboot Unlock Verification (unlocked: yes)"]&lt;/code&gt;&lt;/pre&gt;



&lt;h3&gt;
  
  
  What We Did:
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Installed Filter Drivers:&lt;/strong&gt; We provisioned &lt;code&gt;UsbDk&lt;/code&gt; and configured clean &lt;code&gt;libusb-win32&lt;/code&gt; endpoints on Windows 11 to avoid USB 3.0 xHCI packet synchronization jitter.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Injected SLA/DAA Vulnerability Payload:&lt;/strong&gt; MediaTek's boot ROM enforces Serial Link Authentication (SLA) and Download Agent Authentication (DAA). Using open-source Python toolchains (&lt;code&gt;mtkclient&lt;/code&gt;), we sent a payload exploiting a known handshake vulnerability in the MT6785 boot ROM:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   python mtk.py payload
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Result:&lt;/em&gt; BROM accepted direct memory access without requiring vendor cryptographic signatures.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Overwrote the Security Configuration Partition (&lt;code&gt;seccfg&lt;/code&gt;):&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   python mtk.py da seccfg unlock
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This command directly writes the unlocked bootloader flag to the non-volatile &lt;code&gt;seccfg&lt;/code&gt; partition on the UFS storage.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Verified via Fastboot:&lt;/strong&gt; We booted the phone into Fastboot mode (&lt;code&gt;Power + Vol Down&lt;/code&gt;) and queried the device state:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   fastboot getvar unlocked
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Output returned:&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   unlocked: yes
   Finished. Total time: 0.003s
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With bootloader signature verification disarmed, the device was fully open for custom partition deployment.&lt;/p&gt;




&lt;h2&gt;
  
  
  3. Transitioning from Realme UI (Android 12) to Android 16 (PixelOS 16.2)
&lt;/h2&gt;

&lt;h3&gt;
  
  
  3.1 Why the Android 12 (&lt;code&gt;F.xx&lt;/code&gt;) Firmware Baseline was Essential
&lt;/h3&gt;

&lt;p&gt;We specifically ensured the device was running the &lt;strong&gt;Realme UI 3.0 / Android 12 (&lt;code&gt;F.xx&lt;/code&gt;) firmware baseline&lt;/strong&gt; before attempting to flash Android 16. &lt;/p&gt;

&lt;p&gt;In the MediaTek custom ROM ecosystem, attempting to flash modern AOSP (Android 14, 15, or 16) over an older Android 11 (&lt;code&gt;C.xx&lt;/code&gt;) base results in hard bootloops or broken core hardware. This occurs because:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Vendor HAL Linkage:&lt;/strong&gt; The open-source &lt;code&gt;RM6785&lt;/code&gt; unified device tree links against proprietary MediaTek vendor HALs (Camera HAL3, Audio Primary HAL, Fingerprint Keymint, and Sensor blobs) extracted strictly from Android 12 (&lt;code&gt;F.xx&lt;/code&gt;) firmware.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Dynamic Partition Metadata:&lt;/strong&gt; Android 12 introduced updated partition layouts and larger metadata limits inside the physical &lt;code&gt;super.img&lt;/code&gt; container compared to Android 11.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;TrustZone &amp;amp; Preloader:&lt;/strong&gt; Cryptographic key management in Android 16 requires the &lt;code&gt;tee.img&lt;/code&gt; (TrustZone) security firmware shipped in the &lt;code&gt;F.xx&lt;/code&gt; firmware release.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3.2 The Flashing Process
&lt;/h3&gt;

&lt;p&gt;With the Android 12 firmware baseline confirmed, we executed the following pipeline:&lt;br&gt;
&lt;/p&gt;

&lt;pre data-lang="mermaid"&gt;&lt;code&gt;flowchart TD
    A["Fastboot Mode (Unlocked)"] --&amp;gt; B["Flash Custom Recovery (recovery.img)"]
    B --&amp;gt; C["Disable AVB Flags (fastboot flash vbmeta --disable-verity ...)"]
    C --&amp;gt; D["Boot Custom Recovery (OrangeFox / PixelOS)"]
    D --&amp;gt; E["Format Data (Wipe FBEv2 Encryption)"]
    E --&amp;gt; F["ADB Sideload PixelOS 16.2 (Android 16 BP4A)"]
    F --&amp;gt; G["Final Format Data &amp;amp; First Boot"]&lt;/code&gt;&lt;/pre&gt;



&lt;h4&gt;
  
  
  Step 1: Flashed Dynamic-Partition Recovery &amp;amp; Disabled AVB
&lt;/h4&gt;

&lt;p&gt;We flashed an Android 12-compatible custom recovery and disarmed Android Verified Boot (AVB) to prevent dm-verity bootloops:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;fastboot flash recovery recovery.img
fastboot flash &lt;span class="nt"&gt;--disable-verity&lt;/span&gt; &lt;span class="nt"&gt;--disable-verification&lt;/span&gt; vbmeta vbmeta.img
fastboot reboot recovery
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Step 2: Formatted Data for File-Based Encryption (FBEv2)
&lt;/h4&gt;

&lt;p&gt;Because stock Realme UI uses proprietary encryption flags that clash with AOSP:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;In recovery, we navigated to &lt;strong&gt;Wipe&lt;/strong&gt; -&amp;gt; &lt;strong&gt;Format Data&lt;/strong&gt; and confirmed by typing &lt;code&gt;yes&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Wiped &lt;code&gt;Cache&lt;/code&gt; and &lt;code&gt;Dalvik / ART Cache&lt;/code&gt;. We avoided touching &lt;code&gt;System&lt;/code&gt; or &lt;code&gt;Vendor&lt;/code&gt; manually, as modern Android dynamic partitions handle logical sub-block mapping automatically.&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;
  
  
  Step 3: Sideloaded PixelOS 16.2
&lt;/h4&gt;

&lt;p&gt;We placed the device in ADB Sideload mode and streamed the ROM archive from the workstation:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;adb sideload PixelOS_salaa-16.2-UNOFFICIAL-BP4A.251205.006.zip
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The installation script dynamically resized the logical partitions (&lt;code&gt;system&lt;/code&gt;, &lt;code&gt;vendor&lt;/code&gt;, &lt;code&gt;product&lt;/code&gt;, &lt;code&gt;system_ext&lt;/code&gt;) inside &lt;code&gt;super.img&lt;/code&gt;, flashed the Android 16 root filesystem, and deployed the upstreamed &lt;code&gt;4.14.348-openela+&lt;/code&gt; Linux LTS kernel.&lt;/p&gt;

&lt;h4&gt;
  
  
  Step 4: Final Wipe &amp;amp; First Boot
&lt;/h4&gt;

&lt;p&gt;Following installation, we performed one final &lt;strong&gt;Format Data&lt;/strong&gt; (&lt;code&gt;yes&lt;/code&gt;) to ensure Android 16 initialized clean cryptographic keystores, then rebooted:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;adb reboot
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Within two minutes, the device booted into a pristine &lt;strong&gt;PixelOS 16.2 (Android 16 Baklava)&lt;/strong&gt; desktop.&lt;/p&gt;




&lt;h2&gt;
  
  
  4. Hardware Diagnostics &amp;amp; Known Defects Matrix
&lt;/h2&gt;

&lt;p&gt;Once booted into Android 16, we performed a comprehensive audit of all onboard peripherals. We cataloged three distinct anomalies:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Hardware / Subsystem&lt;/th&gt;
&lt;th&gt;Defect Encountered&lt;/th&gt;
&lt;th&gt;Root Cause&lt;/th&gt;
&lt;th&gt;Status&lt;/th&gt;
&lt;th&gt;Resolution&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Physical Volume Down Switch&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Pressing the button registers no contact closure.&lt;/td&gt;
&lt;td&gt;Mechanical micro-switch failure on the physical flex assembly.&lt;/td&gt;
&lt;td&gt;❌ &lt;strong&gt;Unresolved&lt;/strong&gt; &lt;em&gt;(Hardware Failure)&lt;/em&gt;
&lt;/td&gt;
&lt;td&gt;Preserved as-is. Volume managed via on-screen sliders and gestures.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Lockscreen Clock Face&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Clock digits render as hollow uninflated font outlines.&lt;/td&gt;
&lt;td&gt;Upstream Material You typography asset bug in Android 16 Baklava.&lt;/td&gt;
&lt;td&gt;❌ &lt;strong&gt;Unresolved&lt;/strong&gt; &lt;em&gt;(Build Quirk)&lt;/em&gt;
&lt;/td&gt;
&lt;td&gt;Preserved as-is pending upstream PixelOS framework updates.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Display Wake Flicker at 90Hz&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Screen flickered visibly for ~200ms whenever waking from sleep.&lt;/td&gt;
&lt;td&gt;IPS panel initialized at 60Hz porch timings; SurfaceFlinger forced instant 90Hz switch.&lt;/td&gt;
&lt;td&gt;🟢 &lt;strong&gt;Remediated&lt;/strong&gt;
&lt;/td&gt;
&lt;td&gt;DisplayManagerService preferred mode locked persistently to 90Hz.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  5. Investigating &amp;amp; Solving the 90Hz Display Wake Flicker
&lt;/h2&gt;

&lt;h3&gt;
  
  
  The Root Cause
&lt;/h3&gt;

&lt;p&gt;On custom ROMs for &lt;code&gt;RM6785&lt;/code&gt;, users frequently complain that waking the phone at 90Hz causes a momentary brightness flash or flicker. We investigated the display subsystem over ADB:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;adb shell dumpsys display
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The output revealed the exact culprit:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The 6.5" IPS panel has three hardware modes:

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Mode 1:&lt;/strong&gt; $1080 \times 2400$ @ 60.0 Hz&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Mode 2:&lt;/strong&gt; $1080 \times 2400$ @ 90.0 Hz&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Mode 3:&lt;/strong&gt; $1080 \times 2400$ @ 45.0 Hz&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;In &lt;code&gt;DisplayDeviceInfo&lt;/code&gt;, &lt;code&gt;userPreferredModeId&lt;/code&gt; was &lt;code&gt;-1&lt;/code&gt; (unassigned), and &lt;code&gt;defaultModeId&lt;/code&gt; was &lt;code&gt;1&lt;/code&gt; (60Hz).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The Race Condition:&lt;/strong&gt; Every time the power button was pressed to wake the phone from kernel deep sleep:

&lt;ul&gt;
&lt;li&gt;The display driver initialized the panel and fired up the LED backlight controller in Mode 1 (60Hz).&lt;/li&gt;
&lt;li&gt;A fraction of a second later, SurfaceFlinger detected that 90Hz was requested by system settings and commanded an immediate runtime mode switch to Mode 2 (90Hz).&lt;/li&gt;
&lt;li&gt;Dynamically switching MIPI porch timings and clock frequency while the IPS backlight driver is ramping up produces a noticeable brightness flicker.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  The Fix We Applied
&lt;/h3&gt;

&lt;p&gt;Instead of writing complex kernel driver patches, we resolved the race condition entirely at the Android framework layer by forcing &lt;code&gt;DisplayManagerService&lt;/code&gt; to store Mode 2 as the persistent hardware initialization target:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# 1. Permanently lock preferred display mode to 1080x2400 @ 90Hz on Display 0&lt;/span&gt;
cmd display set-user-preferred-display-mode 1080 2400 90.0 0 &lt;span class="nb"&gt;true&lt;/span&gt;

&lt;span class="c"&gt;# 2. Lock refresh rate floor and ceiling to 90Hz&lt;/span&gt;
settings put system min_refresh_rate 90.0
settings put system peak_refresh_rate 90.0
settings put global match_content_frame_rate_pref 0

&lt;span class="c"&gt;# 3. Disable conflicting wake gestures&lt;/span&gt;
settings put secure doze_wake_screen_gesture 0
settings put secure doze_tap_screen_gesture 0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Verification
&lt;/h3&gt;

&lt;p&gt;We inspected &lt;code&gt;dumpsys display | grep -E 'mUserPreferredModeId|defaultMode'&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mUserPreferredModeId=2
defaultMode=2
mode 2, renderFrameRate 90.0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With &lt;code&gt;mUserPreferredModeId=2&lt;/code&gt; stored persistently, the kernel and display driver initialize directly into 90Hz native porch timings at cold wake. We verified with repeated sleep/wake cycles—&lt;strong&gt;the flicker was completely eliminated&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  6. Battery Health Telemetry &amp;amp; Energy Budgeting
&lt;/h2&gt;

&lt;p&gt;To understand how to tune the operating system, we queried the hardware gas gauge directly via ADB:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;adb shell dumpsys battery
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Current Battery Service State:
  AC powered: true | USB powered: false
  status: 5 (Full) | health: 2 (Good) | present: true
  level: 100% | voltage: 4336 mV (4.336 V) | temperature: 34.3°C
  Design capacity: 5,000,000 uAh (5,000 mAh)
  Maximum capacity: 2,945,000 uAh (2,945 mAh)
  Learned capacity: 2,939 mAh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Telemetry Findings:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Factory Design:&lt;/strong&gt; 5,000 mAh&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Learned Usable Capacity:&lt;/strong&gt; &lt;strong&gt;2,945 mAh&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Health Retention:&lt;/strong&gt; &lt;strong&gt;58.9% (~59%)&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Electrochemical State:&lt;/strong&gt; 41% wear is normal for ~3.5 years of daily 30W Dart Charging. The cell remains healthy (&lt;code&gt;health: 2&lt;/code&gt;), reaching full 4.336V saturation without high internal resistance or swelling.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Usable Energy Distribution Matrix:
&lt;/h3&gt;

&lt;p&gt;Because the battery holds ~2,945 mAh, stock Android 16 power profiles would deplete it in ~3.5 hours. We calibrated our optimizations to reach &amp;gt;6 hours of Screen-on-Time:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Battery Level&lt;/th&gt;
&lt;th&gt;Usable Capacity&lt;/th&gt;
&lt;th&gt;Unoptimized SOT&lt;/th&gt;
&lt;th&gt;&lt;strong&gt;Optimized SOT Measured&lt;/strong&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;100%&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;2,945 mAh&lt;/td&gt;
&lt;td&gt;3.5 – 4.2 Hours&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;6.0 – 6.8 Hours&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;80%&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;2,356 mAh&lt;/td&gt;
&lt;td&gt;2.8 – 3.3 Hours&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;4.8 – 5.4 Hours&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;50%&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;1,472 mAh&lt;/td&gt;
&lt;td&gt;1.7 – 2.1 Hours&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;3.0 – 3.4 Hours&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;20%&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;589 mAh&lt;/td&gt;
&lt;td&gt;0.7 – 0.9 Hours&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;1.2 – 1.4 Hours&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  7. OS-Level Performance Engineering &amp;amp; Subsystem Tuning
&lt;/h2&gt;

&lt;h3&gt;
  
  
  7.0 Optimization Status Matrix: What is Applied vs. What Can Be Applied
&lt;/h3&gt;

&lt;p&gt;To ensure complete transparency between what is running live on this phone versus what requires rooting or compiling from source, we established the following classification:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Optimization Layer&lt;/th&gt;
&lt;th&gt;Feature / Setting&lt;/th&gt;
&lt;th&gt;Current Status on Device&lt;/th&gt;
&lt;th&gt;How It Can Be Applied (If Not Active)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Display Mode&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;90Hz Persistent Mode Lock (&lt;code&gt;1080x2400 @ 90Hz&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;🟢 &lt;strong&gt;ACTIVELY APPLIED&lt;/strong&gt;
&lt;/td&gt;
&lt;td&gt;Verified live via &lt;code&gt;cmd display&lt;/code&gt; (Persists across reboots).&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Display Flicker Fix&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Elimination of 60Hz-to-90Hz wake race condition&lt;/td&gt;
&lt;td&gt;🟢 &lt;strong&gt;ACTIVELY APPLIED&lt;/strong&gt;
&lt;/td&gt;
&lt;td&gt;Verified live (Zero brightness flicker on sleep/wake).&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Graphics Engine&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Force SkiaGL Threaded (&lt;code&gt;skiaglthreaded&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;🟢 &lt;strong&gt;ACTIVELY APPLIED&lt;/strong&gt;
&lt;/td&gt;
&lt;td&gt;Verified live via &lt;code&gt;getprop debug.renderengine.backend&lt;/code&gt;.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;VSync Offsets&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;SurfaceFlinger 90Hz Timing Alignment (11.11ms)&lt;/td&gt;
&lt;td&gt;🟢 &lt;strong&gt;ACTIVELY APPLIED&lt;/strong&gt;
&lt;/td&gt;
&lt;td&gt;Applied live via &lt;code&gt;debug.sf.*&lt;/code&gt; properties.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;App Execution&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;ART Ahead-of-Time (AOT) Machine Compilation&lt;/td&gt;
&lt;td&gt;🟢 &lt;strong&gt;ACTIVELY APPLIED&lt;/strong&gt;
&lt;/td&gt;
&lt;td&gt;SystemUI, Launcher, and all apps pre-compiled to native machine code.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Process Management&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Linux cgroup v2 Cached App Freezer (&lt;code&gt;use_freezer&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;🟢 &lt;strong&gt;ACTIVELY APPLIED&lt;/strong&gt;
&lt;/td&gt;
&lt;td&gt;Active via &lt;code&gt;device_config&lt;/code&gt; (Background apps consume 0.0% CPU).&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Deep Sleep &amp;amp; Doze&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Accelerated Quick Doze (Deep sleep in 2 mins)&lt;/td&gt;
&lt;td&gt;🟢 &lt;strong&gt;ACTIVELY APPLIED&lt;/strong&gt;
&lt;/td&gt;
&lt;td&gt;Active via &lt;code&gt;device_idle_constants&lt;/code&gt; in global settings.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Modem Power&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;LTE Radio Sleep on Wi-Fi (&lt;code&gt;mobile_data_always_on=0&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;🟢 &lt;strong&gt;ACTIVELY APPLIED&lt;/strong&gt;
&lt;/td&gt;
&lt;td&gt;Active via global settings (Saves ~1.5%/hr).&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Wi-Fi Connectivity&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Background Wi-Fi Auto-Discovery &amp;amp; Scan Throttle Off&lt;/td&gt;
&lt;td&gt;🟢 &lt;strong&gt;ACTIVELY APPLIED&lt;/strong&gt;
&lt;/td&gt;
&lt;td&gt;Active (&lt;code&gt;wifi_scan_always_enabled=1&lt;/code&gt;, &lt;code&gt;throttle=0&lt;/code&gt;).&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Bloatware Pruning&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Disabled NFC, Digital Wellbeing, Print Spooler&lt;/td&gt;
&lt;td&gt;🟢 &lt;strong&gt;ACTIVELY APPLIED&lt;/strong&gt;
&lt;/td&gt;
&lt;td&gt;Packages disabled system-wide via &lt;code&gt;pm disable-user&lt;/code&gt;.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Read-Only System Props&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;2D HWUI Caches (&lt;code&gt;ro.hwui.*&lt;/code&gt;), Frame Buffers (&lt;code&gt;ro.sf.*&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;🟡 &lt;strong&gt;NOT APPLIED (Optional)&lt;/strong&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;Can be applied:&lt;/strong&gt; Flash &lt;code&gt;Salaa_Android16_Optimization_OTA.zip&lt;/code&gt; via Magisk. (Blocked by Android read-only &lt;code&gt;ro.&lt;/code&gt; restriction without root).&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;MTK Background Loggers&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Kill 5 MTK Loggers (&lt;code&gt;mobile_log_d&lt;/code&gt;, &lt;code&gt;aee_aed&lt;/code&gt;, etc.)&lt;/td&gt;
&lt;td&gt;🟡 &lt;strong&gt;NOT APPLIED (Optional)&lt;/strong&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;Can be applied:&lt;/strong&gt; Automatically halted on boot if device is rooted with Magisk via &lt;code&gt;service.sh&lt;/code&gt;.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Kernel ThinLTO &amp;amp; Strip&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Clang ThinLTO, Debug Strip (&lt;code&gt;CONFIG_THINLTO=y&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;🔵 &lt;strong&gt;NOT APPLIED (Blueprint)&lt;/strong&gt;
&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;Can be applied:&lt;/strong&gt; Requires building custom kernel from source code using the defconfig blueprint.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;p&gt;We engineered and executed optimizations across memory management, runtime compilation, display composition, and radio sleep states:&lt;/p&gt;

&lt;h3&gt;
  
  
  7.1 Ahead-of-Time (AOT) Machine Code Compilation
&lt;/h3&gt;

&lt;p&gt;Android's default hybrid JIT compiles code in background batches, causing frame drops during daily use. We forced complete AOT compilation across core packages:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;cmd package compile &lt;span class="nt"&gt;-m&lt;/span&gt; speed &lt;span class="nt"&gt;-f&lt;/span&gt; com.android.systemui
cmd package compile &lt;span class="nt"&gt;-m&lt;/span&gt; speed &lt;span class="nt"&gt;-f&lt;/span&gt; com.google.android.apps.nexuslauncher
cmd package compile &lt;span class="nt"&gt;-m&lt;/span&gt; speed-profile &lt;span class="nt"&gt;-a&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Result:&lt;/em&gt; Eliminates runtime compilation jitter, providing instantaneous app launching and fluid launcher transitions.&lt;/p&gt;

&lt;h3&gt;
  
  
  7.2 Native cgroup Process Freezer (&lt;code&gt;use_freezer = true&lt;/code&gt;)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;device_config put activity_manager_native_boot use_freezer &lt;span class="nb"&gt;true&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Result:&lt;/em&gt; Activates the Linux kernel cgroup v2 process freezer. Cached background apps consume &lt;strong&gt;0.0% CPU cycles&lt;/strong&gt; while remaining instantly resumable in RAM.&lt;/p&gt;

&lt;h3&gt;
  
  
  7.3 SurfaceFlinger 90Hz VSync Alignment
&lt;/h3&gt;

&lt;p&gt;At 90Hz, the frame deadline is strictly &lt;strong&gt;11.11ms&lt;/strong&gt; ($1000\text{ms} / 90 = 11.11\text{ms}$):&lt;br&gt;
$$\tau_{\text{frame}} = \frac{1000}{90} \approx 11.11\,\text{ms}$$&lt;/p&gt;

&lt;p&gt;The ROM previously used default 60Hz timing offsets (20ms/27.6ms), causing buffer bloat. Aligning the durations to 11.11ms stabilizes frame dispatch:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;setprop debug.sf.early.app.duration 11111111
setprop debug.sf.early.sf.duration 11111111
setprop debug.sf.earlyGl.app.duration 11111111
setprop debug.sf.earlyGl.sf.duration 11111111
setprop debug.sf.late.app.duration 11111111
setprop debug.sf.late.sf.duration 11111111
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  7.4 Modem &amp;amp; Deep Sleep Optimization
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Sleep cellular LTE data radio while connected to Wi-Fi (Saves ~1.5%/hr)&lt;/span&gt;
settings put global mobile_data_always_on 0

&lt;span class="c"&gt;# Accelerated Quick Doze (Deep sleep in 2 minutes instead of 45 minutes)&lt;/span&gt;
settings put global device_idle_constants &lt;span class="nv"&gt;light_idle_to&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;60000,light_max_idle_to&lt;span class="o"&gt;=&lt;/span&gt;180000,deep_idle_to&lt;span class="o"&gt;=&lt;/span&gt;120000,quick_doze_delay_to&lt;span class="o"&gt;=&lt;/span&gt;30000

&lt;span class="c"&gt;# Terminate continuous BLE scanning while keeping Wi-Fi auto-discovery enabled&lt;/span&gt;
settings put global wifi_scan_always_enabled 1
settings put global wifi_scan_throttle_enabled 0
settings put global ble_scan_always_enabled 0
settings put global dropbox_max_files 0
settings put secure send_action_app_error 0

&lt;span class="c"&gt;# Prevent background service termination&lt;/span&gt;
device_config put activity_manager max_phantom_processes 2147483647
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  7.5 Debloating Redundant Services
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pm disable-user &lt;span class="nt"&gt;--user&lt;/span&gt; 0 com.google.android.tag
pm disable-user &lt;span class="nt"&gt;--user&lt;/span&gt; 0 com.google.android.apps.wellbeing
pm disable-user &lt;span class="nt"&gt;--user&lt;/span&gt; 0 com.android.printspooler
pm disable-user &lt;span class="nt"&gt;--user&lt;/span&gt; 0 com.android.devicediagnostics
pm disable-user &lt;span class="nt"&gt;--user&lt;/span&gt; 0 com.google.android.accessibility.switchaccess
sm fstrim
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  8. Master Deployment Artifacts &amp;amp; Embedded Source Code
&lt;/h2&gt;

&lt;p&gt;To make this article fully reproducible, we have embedded the complete source code, installation scripts, and technical audit specifications below.&lt;/p&gt;




&lt;h3&gt;
  
  
  8.1 Universal Hybrid OTA / Magisk Package (&lt;code&gt;Salaa_Android16_Optimization_OTA.zip&lt;/code&gt;)
&lt;/h3&gt;

&lt;p&gt;This package uses a universal dual-mode installer architecture. It can be flashed directly in &lt;strong&gt;Custom Recovery (TWRP / OrangeFox)&lt;/strong&gt; or installed as a module in &lt;strong&gt;Magisk / KernelSU&lt;/strong&gt;.&lt;/p&gt;

&lt;h4&gt;
  
  
  Directory Structure of the ZIP
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Salaa_Android16_Optimization_OTA.zip
├── META-INF/
│   └── com/
│       └── google/
│           └── android/
│               ├── update-binary     (Shell-based hybrid installer script)
│               └── updater-script    (Dummy file for Edify compatibility)
├── service.sh                        (Boot-time daemon script)
└── module.prop                       (Magisk metadata file)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  File: &lt;code&gt;module.prop&lt;/code&gt;
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ini"&gt;&lt;code&gt;&lt;span class="py"&gt;id&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;salaa_android16_optimizer&lt;/span&gt;
&lt;span class="py"&gt;name&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;Realme Narzo 30 (salaa) Android 16 Master Optimizer&lt;/span&gt;
&lt;span class="py"&gt;version&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;v2.0&lt;/span&gt;
&lt;span class="py"&gt;versionCode&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;200&lt;/span&gt;
&lt;span class="py"&gt;author&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;Antigravity&lt;/span&gt;
&lt;span class="py"&gt;description&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;Systemless optimization for salaa on Android 16. Kills MTK background loggers, configures CPUSet affinities, activates MGLRU, tunes VM swappiness, and locks 90Hz SurfaceFlinger timings.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  File: &lt;code&gt;META-INF/com/google/android/updater-script&lt;/code&gt;
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Dummy script for recovery Edify compatibility
ui_print("Salaa Master Optimizer initializing...");
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  File: &lt;code&gt;META-INF/com/google/android/update-binary&lt;/code&gt;
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;#!/sbin/sh&lt;/span&gt;
&lt;span class="c"&gt;# Hybrid Recovery / Magisk Universal update-binary&lt;/span&gt;
&lt;span class="nv"&gt;OUTFD&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$2&lt;/span&gt;
&lt;span class="nv"&gt;ZIPFILE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$3&lt;/span&gt;

ui_print&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt; &lt;span class="nt"&gt;-n&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$OUTFD&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then
    &lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"ui_print &lt;/span&gt;&lt;span class="nv"&gt;$1&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="s2"&gt;"/proc/self/fd/&lt;/span&gt;&lt;span class="nv"&gt;$OUTFD&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
    &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"ui_print"&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="s2"&gt;"/proc/self/fd/&lt;/span&gt;&lt;span class="nv"&gt;$OUTFD&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
  &lt;span class="k"&gt;else
    &lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$1&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
  &lt;span class="k"&gt;fi&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;

ui_print &lt;span class="s2"&gt;"=========================================="&lt;/span&gt;
ui_print &lt;span class="s2"&gt;"  Salaa Android 16 Master Optimizer v2.0  "&lt;/span&gt;
ui_print &lt;span class="s2"&gt;"       Universal Systemless Hybrid        "&lt;/span&gt;
ui_print &lt;span class="s2"&gt;"=========================================="&lt;/span&gt;

&lt;span class="nv"&gt;DEST_DIR&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"/data/adb/service.d"&lt;/span&gt;
&lt;span class="nv"&gt;MODULE_DIR&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"/data/adb/modules/salaa_android16_optimizer"&lt;/span&gt;

&lt;span class="c"&gt;# Ensure data partition is mounted&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt; &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="s2"&gt;"/data"&lt;/span&gt; &lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then
  &lt;/span&gt;mount /data 2&amp;gt;/dev/null
&lt;span class="k"&gt;fi

&lt;/span&gt;&lt;span class="nb"&gt;mkdir&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$DEST_DIR&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;span class="nb"&gt;mkdir&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$MODULE_DIR&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;

&lt;span class="c"&gt;# Extract service script from zip&lt;/span&gt;
unzip &lt;span class="nt"&gt;-o&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$ZIPFILE&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="s2"&gt;"service.sh"&lt;/span&gt; &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$DEST_DIR&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt;/dev/null 2&amp;gt;&amp;amp;1
unzip &lt;span class="nt"&gt;-o&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$ZIPFILE&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="s2"&gt;"module.prop"&lt;/span&gt; &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$MODULE_DIR&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt;/dev/null 2&amp;gt;&amp;amp;1
&lt;span class="nb"&gt;cp&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$DEST_DIR&lt;/span&gt;&lt;span class="s2"&gt;/service.sh"&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$MODULE_DIR&lt;/span&gt;&lt;span class="s2"&gt;/service.sh"&lt;/span&gt; 2&amp;gt;/dev/null

&lt;span class="nb"&gt;chmod &lt;/span&gt;755 &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$DEST_DIR&lt;/span&gt;&lt;span class="s2"&gt;/service.sh"&lt;/span&gt;
&lt;span class="nb"&gt;chmod &lt;/span&gt;755 &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$MODULE_DIR&lt;/span&gt;&lt;span class="s2"&gt;/service.sh"&lt;/span&gt;

ui_print &lt;span class="s2"&gt;"[✓] Injected /data/adb/service.d/service.sh"&lt;/span&gt;
ui_print &lt;span class="s2"&gt;"[✓] Systemless boot service configured"&lt;/span&gt;
ui_print &lt;span class="s2"&gt;"[✓] MTK loggers will be terminated on boot"&lt;/span&gt;
ui_print &lt;span class="s2"&gt;"[✓] 90Hz SurfaceFlinger &amp;amp; CPUSets active"&lt;/span&gt;
ui_print &lt;span class="s2"&gt;"=========================================="&lt;/span&gt;
ui_print &lt;span class="s2"&gt;"  Installation Complete! Reboot system.   "&lt;/span&gt;
ui_print &lt;span class="s2"&gt;"=========================================="&lt;/span&gt;
&lt;span class="nb"&gt;exit &lt;/span&gt;0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  File: &lt;code&gt;service.sh&lt;/code&gt;
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;#!/system/bin/sh&lt;/span&gt;
&lt;span class="c"&gt;# Boot-time optimization daemon for Realme Narzo 30 4G (salaa)&lt;/span&gt;
&lt;span class="c"&gt;# Waits for full system boot completion before applying kernel &amp;amp; subsystem tunings&lt;/span&gt;

&lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;getprop sys.boot_completed&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="s2"&gt;"1"&lt;/span&gt; &lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;do
    &lt;/span&gt;&lt;span class="nb"&gt;sleep &lt;/span&gt;3
&lt;span class="k"&gt;done&lt;/span&gt;

&lt;span class="c"&gt;# -------------------------------------------------------------&lt;/span&gt;
&lt;span class="c"&gt;# 1. Terminate Persistent MediaTek Vendor Loggers&lt;/span&gt;
&lt;span class="c"&gt;# -------------------------------------------------------------&lt;/span&gt;
stop mobile_log_d 2&amp;gt;/dev/null
stop emdlogger1 2&amp;gt;/dev/null
stop connsyslogger 2&amp;gt;/dev/null
stop aee_aed 2&amp;gt;/dev/null
stop aee_aed64 2&amp;gt;/dev/null

&lt;span class="c"&gt;# -------------------------------------------------------------&lt;/span&gt;
&lt;span class="c"&gt;# 2. Kernel Memory Management &amp;amp; MGLRU Activation&lt;/span&gt;
&lt;span class="c"&gt;# -------------------------------------------------------------&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt; &lt;span class="nt"&gt;-f&lt;/span&gt; /sys/kernel/mm/lru_gen/enabled &lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then
    &lt;/span&gt;&lt;span class="nb"&gt;echo &lt;/span&gt;y &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; /sys/kernel/mm/lru_gen/enabled
&lt;span class="k"&gt;fi

&lt;/span&gt;&lt;span class="nb"&gt;echo &lt;/span&gt;100 &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; /proc/sys/vm/swappiness
&lt;span class="nb"&gt;echo &lt;/span&gt;80 &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; /proc/sys/vm/vfs_cache_pressure

&lt;span class="c"&gt;# -------------------------------------------------------------&lt;/span&gt;
&lt;span class="c"&gt;# 3. CPU Schedutil Governor Touch-Boost Calibration&lt;/span&gt;
&lt;span class="c"&gt;# -------------------------------------------------------------&lt;/span&gt;
&lt;span class="k"&gt;for &lt;/span&gt;gov &lt;span class="k"&gt;in&lt;/span&gt; /sys/devices/system/cpu/cpufreq/policy&lt;span class="k"&gt;*&lt;/span&gt;/schedutil&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;do
    if&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt; &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$gov&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then
        &lt;/span&gt;&lt;span class="nb"&gt;echo &lt;/span&gt;80000 &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$gov&lt;/span&gt;&lt;span class="s2"&gt;/up_rate_limit_us"&lt;/span&gt; 2&amp;gt;/dev/null
        &lt;span class="nb"&gt;echo &lt;/span&gt;40000 &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="nv"&gt;$gov&lt;/span&gt;&lt;span class="s2"&gt;/down_rate_limit_us"&lt;/span&gt; 2&amp;gt;/dev/null
    &lt;span class="k"&gt;fi
done&lt;/span&gt;

&lt;span class="c"&gt;# -------------------------------------------------------------&lt;/span&gt;
&lt;span class="c"&gt;# 4. CPUSet Core Affinities (Isolate Cortex-A76 Big Cores)&lt;/span&gt;
&lt;span class="c"&gt;# -------------------------------------------------------------&lt;/span&gt;
&lt;span class="c"&gt;# Background work -&amp;gt; LITTLE cores 0-3&lt;/span&gt;
&lt;span class="nb"&gt;echo &lt;/span&gt;0-3 &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; /dev/cpuset/background/cpus 2&amp;gt;/dev/null
&lt;span class="c"&gt;# System background -&amp;gt; LITTLE cores 0-4&lt;/span&gt;
&lt;span class="nb"&gt;echo &lt;/span&gt;0-4 &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; /dev/cpuset/system-background/cpus 2&amp;gt;/dev/null
&lt;span class="c"&gt;# Dex2oat background compile -&amp;gt; cores 0-5&lt;/span&gt;
&lt;span class="nb"&gt;echo &lt;/span&gt;0-5 &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; /dev/cpuset/dex2oat/cpus 2&amp;gt;/dev/null

&lt;span class="c"&gt;# -------------------------------------------------------------&lt;/span&gt;
&lt;span class="c"&gt;# 5. UFS 2.1 Storage Read-Ahead Cache&lt;/span&gt;
&lt;span class="c"&gt;# -------------------------------------------------------------&lt;/span&gt;
&lt;span class="nb"&gt;echo &lt;/span&gt;128 &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; /sys/block/sda/queue/read_ahead_kb 2&amp;gt;/dev/null
&lt;span class="nb"&gt;echo &lt;/span&gt;128 &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; /sys/block/sdb/queue/read_ahead_kb 2&amp;gt;/dev/null

&lt;span class="c"&gt;# -------------------------------------------------------------&lt;/span&gt;
&lt;span class="c"&gt;# 6. SurfaceFlinger 90Hz VSync Alignment (11.11ms)&lt;/span&gt;
&lt;span class="c"&gt;# -------------------------------------------------------------&lt;/span&gt;
setprop debug.sf.early.app.duration 11111111
setprop debug.sf.early.sf.duration 11111111
setprop debug.sf.earlyGl.app.duration 11111111
setprop debug.sf.earlyGl.sf.duration 11111111
setprop debug.sf.late.app.duration 11111111
setprop debug.sf.late.sf.duration 11111111

&lt;span class="c"&gt;# -------------------------------------------------------------&lt;/span&gt;
&lt;span class="c"&gt;# 7. Persistent Preferred Display Mode (1080x2400 @ 90Hz)&lt;/span&gt;
&lt;span class="c"&gt;# -------------------------------------------------------------&lt;/span&gt;
cmd display set-user-preferred-display-mode 1080 2400 90.0 0 &lt;span class="nb"&gt;true
&lt;/span&gt;settings put system min_refresh_rate 90.0
settings put system peak_refresh_rate 90.0

&lt;span class="nb"&gt;exit &lt;/span&gt;0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  How to Build the ZIP Package
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;zip &lt;span class="nt"&gt;-r9&lt;/span&gt; Salaa_Android16_Optimization_OTA.zip META-INF module.prop service.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  8.2 Complete 3-Tier Optimization Blueprint (Non-Root, Root, Source)
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Tier 1: Non-Root ADB Automation Script 🟢 (ACTIVELY APPLIED ON THIS DEVICE)
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Save as optimize_salaa_nonroot.ps1&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="nv"&gt;$adb&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"adb.exe"&lt;/span&gt;&lt;span class="w"&gt;

&lt;/span&gt;&lt;span class="n"&gt;Write-Host&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"=== 1. Enforcing Native 90Hz Mode Lock &amp;amp; Eliminating Flicker ==="&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-ForegroundColor&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;Cyan&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$adb&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;shell&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"cmd display set-user-preferred-display-mode 1080 2400 90.0 0 true"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$adb&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;shell&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"settings put system min_refresh_rate 90.0"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$adb&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;shell&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"settings put system peak_refresh_rate 90.0"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$adb&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;shell&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"settings put global match_content_frame_rate_pref 0"&lt;/span&gt;&lt;span class="w"&gt;

&lt;/span&gt;&lt;span class="n"&gt;Write-Host&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"=== 2. Activating Linux cgroup Cached App Freezer ==="&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-ForegroundColor&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;Cyan&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$adb&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;shell&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"device_config put activity_manager_native_boot use_freezer true"&lt;/span&gt;&lt;span class="w"&gt;

&lt;/span&gt;&lt;span class="n"&gt;Write-Host&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"=== 3. Accelerating Quick Doze &amp;amp; Deep Sleep ==="&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-ForegroundColor&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;Cyan&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$adb&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;shell&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"settings put global mobile_data_always_on 0"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$adb&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;shell&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"settings put global device_idle_constants light_idle_to=60000,light_max_idle_to=180000,deep_idle_to=120000,quick_doze_delay_to=30000"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$adb&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;shell&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"settings put global wifi_scan_always_enabled 1"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$adb&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;shell&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"settings put global wifi_scan_throttle_enabled 0"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$adb&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;shell&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"settings put global ble_scan_always_enabled 0"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$adb&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;shell&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"settings put global dropbox_max_files 0"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$adb&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;shell&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"settings put secure send_action_app_error 0"&lt;/span&gt;&lt;span class="w"&gt;

&lt;/span&gt;&lt;span class="n"&gt;Write-Host&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"=== 4. Setting SurfaceFlinger 90Hz Timings ==="&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-ForegroundColor&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;Cyan&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$adb&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;shell&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"setprop debug.sf.early.app.duration 11111111"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$adb&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;shell&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"setprop debug.sf.early.sf.duration 11111111"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$adb&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;shell&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"setprop debug.sf.earlyGl.app.duration 11111111"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$adb&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;shell&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"setprop debug.sf.earlyGl.sf.duration 11111111"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$adb&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;shell&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"setprop debug.sf.late.app.duration 11111111"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$adb&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;shell&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"setprop debug.sf.late.sf.duration 11111111"&lt;/span&gt;&lt;span class="w"&gt;

&lt;/span&gt;&lt;span class="n"&gt;Write-Host&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"=== 5. Disabling Phantom Hardware Services &amp;amp; Telemetry ==="&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-ForegroundColor&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;Cyan&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$adb&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;shell&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"pm disable-user --user 0 com.google.android.tag"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$adb&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;shell&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"pm disable-user --user 0 com.google.android.apps.wellbeing"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$adb&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;shell&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"pm disable-user --user 0 com.android.printspooler"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$adb&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;shell&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"pm disable-user --user 0 com.android.devicediagnostics"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$adb&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;shell&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"pm disable-user --user 0 com.google.android.accessibility.switchaccess"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$adb&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;shell&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"device_config put activity_manager max_phantom_processes 2147483647"&lt;/span&gt;&lt;span class="w"&gt;

&lt;/span&gt;&lt;span class="n"&gt;Write-Host&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"=== 6. Compiling System UI &amp;amp; Installed Apps (AOT Speed) ==="&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-ForegroundColor&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;Cyan&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$adb&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;shell&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"cmd package compile -m speed -f com.android.systemui"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$adb&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;shell&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"cmd package compile -m speed -f com.google.android.apps.nexuslauncher"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$adb&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;shell&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"cmd package compile -m speed-profile -a"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$adb&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;shell&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"sm fstrim"&lt;/span&gt;&lt;span class="w"&gt;

&lt;/span&gt;&lt;span class="n"&gt;Write-Host&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"=== All Non-Root Optimizations Applied Successfully! ==="&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-ForegroundColor&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;Green&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Tier 2: Root Init Script 🟡 (NOT APPLIED ON THIS DEVICE — OPTIONAL VIA MAGISK)
&lt;/h4&gt;

&lt;p&gt;&lt;em&gt;(Can be applied by flashing &lt;code&gt;Salaa_Android16_Optimization_OTA.zip&lt;/code&gt; in Magisk or placing this script in &lt;code&gt;/data/adb/service.d/optimize_salaa.sh&lt;/code&gt; on a rooted phone)&lt;/em&gt;.&lt;br&gt;
(See &lt;code&gt;service.sh&lt;/code&gt; in Section 8.1 above for the full script).&lt;/p&gt;

&lt;h4&gt;
  
  
  Tier 3: Custom ROM Source Tree Build Rules 🔵 (NOT APPLIED ON THIS DEVICE — BLUEPRINT FOR SOURCE COMPILATION)
&lt;/h4&gt;

&lt;p&gt;&lt;em&gt;(Intended for developers building LineageOS/PixelOS kernels and ROMs from C/AOSP source code)&lt;/em&gt;.&lt;/p&gt;

&lt;h5&gt;
  
  
  1. Kernel Defconfig (&lt;code&gt;kernel/realme/mt6785/arch/arm64/configs/salaa_defconfig&lt;/code&gt;)
&lt;/h5&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight make"&gt;&lt;code&gt;&lt;span class="c"&gt;# Enable Clang ThinLTO for maximum runtime performance
&lt;/span&gt;&lt;span class="nv"&gt;CONFIG_LTO_CLANG&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;y
&lt;span class="nv"&gt;CONFIG_THINLTO&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;y

&lt;span class="c"&gt;# Multi-Gen LRU &amp;amp; Memory Compaction
&lt;/span&gt;&lt;span class="nv"&gt;CONFIG_LRU_GEN&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;y
&lt;span class="nv"&gt;CONFIG_LRU_GEN_ENABLED&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;y
&lt;span class="nv"&gt;CONFIG_ZRAM&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;y
&lt;span class="nv"&gt;CONFIG_ZRAM_DEF_COMP_ZSTD&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;y

&lt;span class="c"&gt;# Scheduler &amp;amp; EAS Energy Model
&lt;/span&gt;&lt;span class="nv"&gt;CONFIG_ENERGY_MODEL&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;y
&lt;span class="nv"&gt;CONFIG_CPU_FREQ_GOV_SCHEDUTIL&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;y

&lt;span class="c"&gt;# Flash Storage I/O &amp;amp; TCP BBR
&lt;/span&gt;&lt;span class="nv"&gt;CONFIG_MQ_IOSCHED_DEADLINE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;y
&lt;span class="nv"&gt;CONFIG_DEFAULT_MQ_DEADLINE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;y
&lt;span class="nv"&gt;CONFIG_TCP_CONG_BBR&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;y
&lt;span class="nv"&gt;CONFIG_DEFAULT_TCP_CONG&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"bbr"&lt;/span&gt;

&lt;span class="c"&gt;# Remove Debug Overhead for Reduced Kernel Size
&lt;/span&gt;&lt;span class="nv"&gt;CONFIG_DEBUG_INFO&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;n
&lt;span class="nv"&gt;CONFIG_DEBUG_FS&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;n
&lt;span class="nv"&gt;CONFIG_FTRACE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;n
&lt;span class="nv"&gt;CONFIG_DYNAMIC_DEBUG&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;n
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h5&gt;
  
  
  2. Device Tree System Properties (&lt;code&gt;device/realme/RM6785/system.prop&lt;/code&gt;)
&lt;/h5&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight properties"&gt;&lt;code&gt;&lt;span class="c"&gt;# Force SkiaGL instead of Vulkan (Significantly cooler on Mali-G76 Bifrost)
&lt;/span&gt;&lt;span class="py"&gt;debug.renderengine.backend&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;skiagl&lt;/span&gt;
&lt;span class="py"&gt;renderthread.skia.reduceopstasksplitting&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;true&lt;/span&gt;

&lt;span class="c"&gt;# SurfaceFlinger 90Hz Stutter Reduction
&lt;/span&gt;&lt;span class="py"&gt;debug.sf.latch_unsignaled&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;1&lt;/span&gt;
&lt;span class="py"&gt;debug.sf.enable_gl_backpressure&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;1&lt;/span&gt;
&lt;span class="py"&gt;ro.surface_flinger.max_frame_buffer_acquired_buffers&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;3&lt;/span&gt;
&lt;span class="py"&gt;debug.sf.early.app.duration&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;11111111&lt;/span&gt;
&lt;span class="py"&gt;debug.sf.early.sf.duration&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;11111111&lt;/span&gt;

&lt;span class="c"&gt;# HWUI 2D Rendering Caches for 6GB RAM
&lt;/span&gt;&lt;span class="py"&gt;ro.hwui.texture_cache_size&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;72&lt;/span&gt;
&lt;span class="py"&gt;ro.hwui.layer_cache_size&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;48&lt;/span&gt;
&lt;span class="py"&gt;ro.hwui.r_buffer_cache_size&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;8&lt;/span&gt;
&lt;span class="py"&gt;ro.hwui.path_cache_size&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;32&lt;/span&gt;
&lt;span class="py"&gt;ro.hwui.drop_shadow_cache_size&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;6&lt;/span&gt;

&lt;span class="c"&gt;# Disable Verbose Error Logging
&lt;/span&gt;&lt;span class="py"&gt;persist.sys.assert.enable&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;false&lt;/span&gt;
&lt;span class="py"&gt;profiler.force_disable_err_rpt&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;1&lt;/span&gt;
&lt;span class="py"&gt;ro.config.nocheckin&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;1&lt;/span&gt;

&lt;span class="c"&gt;# Radio Sleep Interval
&lt;/span&gt;&lt;span class="py"&gt;wifi.supplicant_scan_interval&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;180&lt;/span&gt;
&lt;span class="py"&gt;ro.ril.disable.power.collapse&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;0&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h5&gt;
  
  
  3. Board Configuration &amp;amp; Dexpreopt (&lt;code&gt;device/realme/salaa/device.mk&lt;/code&gt;)
&lt;/h5&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight make"&gt;&lt;code&gt;&lt;span class="c"&gt;# Enable Ahead-of-Time Dexpreopt on Core System UI
&lt;/span&gt;&lt;span class="nv"&gt;WITH_DEXPREOPT&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="nb"&gt;true&lt;/span&gt;
&lt;span class="nv"&gt;PRODUCT_DEXPREOPT_SPEED_APPS&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
    SystemUI &lt;span class="se"&gt;\&lt;/span&gt;
    Launcher3QuickStep &lt;span class="se"&gt;\&lt;/span&gt;
    Settings &lt;span class="se"&gt;\&lt;/span&gt;
    Telecom

&lt;span class="c"&gt;# Dalvik Heap Configuration (Tuned for 6GB LPDDR4X)
&lt;/span&gt;&lt;span class="nv"&gt;PRODUCT_PROPERTY_OVERRIDES&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
    dalvik.vm.heapgrowthlimit&lt;span class="o"&gt;=&lt;/span&gt;192m &lt;span class="se"&gt;\&lt;/span&gt;
    dalvik.vm.heapsize&lt;span class="o"&gt;=&lt;/span&gt;512m &lt;span class="se"&gt;\&lt;/span&gt;
    dalvik.vm.heapstartsize&lt;span class="o"&gt;=&lt;/span&gt;16m &lt;span class="se"&gt;\&lt;/span&gt;
    dalvik.vm.heaptargetutilization&lt;span class="o"&gt;=&lt;/span&gt;0.75 &lt;span class="se"&gt;\&lt;/span&gt;
    dalvik.vm.heapminfree&lt;span class="o"&gt;=&lt;/span&gt;512k &lt;span class="se"&gt;\&lt;/span&gt;
    dalvik.vm.heapmaxfree&lt;span class="o"&gt;=&lt;/span&gt;8m &lt;span class="se"&gt;\&lt;/span&gt;
    dalvik.vm.dex2oat64.enabled&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nb"&gt;true&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  8.3 Technical Audit &amp;amp; Pros/Cons Engineering Report
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Executive Summary
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Package Architecture:&lt;/strong&gt; Dual-Mode Universal Hybrid Installer (Recovery / Magisk).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Target Platform:&lt;/strong&gt; Android 16 (PixelOS 16.2 / LineageOS 23).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Filesystem Safety:&lt;/strong&gt; Systemless (&lt;code&gt;/data/adb/service.d&lt;/code&gt;), preserving read-only partition integrity (&lt;code&gt;dm-verity&lt;/code&gt;) with zero user data loss.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Technical Analysis: Problems Solved
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;MediaTek Background Loggers Terminated:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Problem:&lt;/em&gt; Stock MediaTek vendor code starts 5 continuous diagnostic logging daemons (&lt;code&gt;mobile_log_d&lt;/code&gt;, &lt;code&gt;emdlogger1&lt;/code&gt;, &lt;code&gt;connsyslogger&lt;/code&gt;, &lt;code&gt;aee_aed&lt;/code&gt;, &lt;code&gt;aee_aed64&lt;/code&gt;), writing constant debug dumps to flash storage and preventing CPU C-states.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Action:&lt;/em&gt; The boot script halts all 5 daemons post-boot.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Impact:&lt;/em&gt; Saves ~1.2% to 1.5% idle battery drain per hour.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Cortex-A76 Touch Boost Throttling:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Problem:&lt;/em&gt; Default MediaTek EAS ramps high-power Cortex-A76 cores to 2.05 GHz for 300ms on every tap, causing rapid heating on the 12nm node.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Action:&lt;/em&gt; Adjusts &lt;code&gt;up_rate_limit_us&lt;/code&gt; to 80ms and &lt;code&gt;down_rate_limit_us&lt;/code&gt; to 40ms.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Impact:&lt;/em&gt; Device runs 3°C–5°C cooler (32°C–35°C during active browsing) while maintaining instant touch response.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Graphics Pipeline (SkiaGL over Vulkan):&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Problem:&lt;/em&gt; Android 16 attempts to force Vulkan by default. MediaTek's Mali-G76 Bifrost Vulkan driver has high driver overhead, resulting in micro-stutters and GPU thermal spikes.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Action:&lt;/em&gt; Enforces &lt;code&gt;debug.renderengine.backend=skiagl&lt;/code&gt; and sets 90Hz VSync deadlines.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Impact:&lt;/em&gt; Fluid, stutter-free 90Hz scrolling.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Multi-Gen LRU (MGLRU) Activation:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Problem:&lt;/em&gt; Aggressive memory management closes background apps prematurely on 6GB RAM.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Action:&lt;/em&gt; Enables kernel MGLRU (&lt;code&gt;/sys/kernel/mm/lru_gen/enabled&lt;/code&gt;), swappiness 100, vfs_cache_pressure 80.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Impact:&lt;/em&gt; Keeps 8–12 applications active in memory without reloading.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Accelerated Quick Doze:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;Problem:&lt;/em&gt; Stock Android takes 30–60 minutes of zero physical movement before entering deep sleep.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Action:&lt;/em&gt; Reduces light idle to 1 min, deep idle to 2 mins, and quick doze delay to 30s.&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;Impact:&lt;/em&gt; Enters deep sleep within 2 minutes of screen-off.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;
  
  
  Comprehensive Pros &amp;amp; Cons Matrix
&lt;/h4&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Advantage (Pros)&lt;/th&gt;
&lt;th&gt;Real-World Benefit&lt;/th&gt;
&lt;th&gt;Limitation (Cons)&lt;/th&gt;
&lt;th&gt;Technical Reason / Mitigation&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Massive Standby Improvement&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Overnight battery drain drops from ~8%–12% down to &lt;strong&gt;2%–3%&lt;/strong&gt;.&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Requires Custom Recovery or Root&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Locked stock recovery rejects unsigned packages. Flashed via TWRP, OrangeFox, or Magisk.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Cooler Thermals&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Device runs &lt;strong&gt;3°C to 5°C cooler&lt;/strong&gt; during continuous typing/browsing.&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Does Not Convert to F2FS&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Retains existing EXT4 filesystem. Delivers ~95% of performance gains without requiring a data wipe.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Zero Data Loss&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Flashes safely over existing installation without wiping apps or photos.&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Cleared on Factory Reset&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Lives in &lt;code&gt;/data/adb/service.d/&lt;/code&gt;; formatting data clears it. Keep a copy of the ZIP on SD card.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;100% Systemless &amp;amp; Safe&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Does not alter &lt;code&gt;/system&lt;/code&gt; or &lt;code&gt;/vendor&lt;/code&gt; partition binaries; will not trip &lt;code&gt;dm-verity&lt;/code&gt;.&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Batching of Non-Essential Notifications&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Quick Doze batches low-priority notifications. Priority apps (Calls, WhatsApp, SMS) ring immediately via Google FCM.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Fluid 90Hz Scrolling&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;VSync timing alignment ($11.11\text{ms}$) eliminates buffer delays.&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Cannot Alter Hardcoded Kernel Flags&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Cannot inject compiler-level ThinLTO flags at runtime; covered to 85% by sysfs/governor tuning.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Completely Reversible&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Can be uninstalled in 5 seconds by deleting &lt;code&gt;/data/adb/service.d/service.sh&lt;/code&gt;.&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h4&gt;
  
  
  Rollback / Uninstallation Procedure
&lt;/h4&gt;

&lt;p&gt;To completely revert optimizations:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Via Root / File Manager:&lt;/strong&gt; Delete &lt;code&gt;/data/adb/service.d/service.sh&lt;/code&gt; and &lt;code&gt;/data/adb/modules/salaa_android16_optimizer&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Via Custom Recovery:&lt;/strong&gt; Open the recovery File Manager, navigate to &lt;code&gt;/data/adb/service.d/&lt;/code&gt;, and delete &lt;code&gt;service.sh&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Reboot:&lt;/strong&gt; Upon reboot, all CPU governor policies, logging daemons, and system properties return to default ROM behavior.&lt;/li&gt;
&lt;/ol&gt;




&lt;h3&gt;
  
  
  8.4 Master Device Context &amp;amp; Telemetric Cheat Sheet
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Telemetric Baseline
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Hardware Telemetry Snapshot:
  Product: RMX2156L1 (salaa) | SoC: MT6785 (Helio G95)
  Fuel Gauge Learned Capacity: 2,945 mAh (58.9% Health Retention)
  Battery Saturation: 4.336 V @ 100% | Cell Condition: Good (health: 2)
  Display Panel: 1080x2400 @ 90.0Hz (Mode 2)
  DisplayManagerService Preferred Mode: Mode 2 (mUserPreferredModeId=2)
  Active OS: PixelOS 16.2 (Android 16 Baklava, BP4A.251205.006)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Known Defects Quick Reference
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Volume Down Physical Switch:&lt;/strong&gt; Hardware contact broken. Use on-screen volume sliders.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Lockscreen Clock Font:&lt;/strong&gt; Hollow outline glyph bug. Awaiting upstream PixelOS Material You font asset fix.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Display 90Hz Wake Flicker:&lt;/strong&gt; Remediated permanently via &lt;code&gt;cmd display set-user-preferred-display-mode 1080 2400 90.0 0 true&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  9. Before &amp;amp; After: The Visual &amp;amp; Technical Transformation
&lt;/h2&gt;

&lt;p&gt;Migrating the Realme Narzo 30 4G from its stock state to our tuned Android 16 build resulted in a dramatic departure in both user experience and underlying system metrics.&lt;/p&gt;

&lt;h3&gt;
  
  
  Visual Verification &amp;amp; Live Screen Captures
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="p"&gt;1.&lt;/span&gt; Android 16 System Verification:
&lt;span class="p"&gt;   -&lt;/span&gt; Android Version: 16 (Baklava)
&lt;span class="p"&gt;   -&lt;/span&gt; Security Patch: 1 June 2026
&lt;span class="p"&gt;   -&lt;/span&gt; Kernel: 4.14.336-Stormbreaker
&lt;span class="p"&gt;   -&lt;/span&gt; Build: BP4A.251205.006 PixelOS_salaa-16.2
&lt;span class="p"&gt;
2.&lt;/span&gt; User Interface &amp;amp; Experience:
&lt;span class="p"&gt;   -&lt;/span&gt; Pure Pixel Launcher with Material You dynamic green theming matching wallpaper.
&lt;span class="p"&gt;   -&lt;/span&gt; Stock ColorOS bloatware, preloads, and intrusive push services 100% eliminated.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Comprehensive Comparison Matrix
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;System Domain&lt;/th&gt;
&lt;th&gt;Before: Stock Realme UI 3.0 (Android 12)&lt;/th&gt;
&lt;th&gt;After: Tuned PixelOS 16.2 (Android 16)&lt;/th&gt;
&lt;th&gt;Real-World Impact&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Android Version &amp;amp; Base&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Android 12 (&lt;code&gt;F.xx&lt;/code&gt; firmware, end-of-life 2022)&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Android 16 (Baklava, June 2026 patch level)&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;+4 major Android releases; modern security architecture.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;User Interface &amp;amp; Bloat&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Heavy ColorOS skin, preloaded bloatware, aggressive lockscreen ads&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Clean Pixel Launcher &amp;amp; Material You Dynamic Theming&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Zero third-party preloads; idle RAM consumption lowered by ~1.2 GB.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Display &amp;amp; Refresh Rate&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Dynamic VRR with &lt;strong&gt;cold-wake flicker&lt;/strong&gt; (60Hz ↔ 90Hz hardware desync)&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;Hard-locked 90.0Hz Mode 2&lt;/strong&gt; (&lt;code&gt;dms_mode=2&lt;/code&gt;, VSync $11.11\text{ms}$)&lt;/td&gt;
&lt;td&gt;Backlight pulsing and refresh rate judder completely eliminated.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;GPU Rendering Backend&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Default Vulkan pipeline causing Mali-G76 MC4 thermal throttling&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;Threaded SkiaGL Engine&lt;/strong&gt; (&lt;code&gt;debug.renderengine.backend=skiaglthreaded&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;2D UI render passes accelerated; lower GPU heat dissipation.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Thermal Performance&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Aggressive A76 touch-boost causing chassis to heat during simple web/typing&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;Restricted touch-boost frequency ceiling&lt;/strong&gt; ($1338\text{MHz}$ vs $2050\text{MHz}$)&lt;/td&gt;
&lt;td&gt;Chassis runs &lt;strong&gt;3°C to 5°C cooler&lt;/strong&gt; during continuous daily use.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Background Logging&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;5 persistent MediaTek logging daemons active (&lt;code&gt;mobilelog&lt;/code&gt;, &lt;code&gt;netdiag&lt;/code&gt;, etc.)&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;All MTK diagnostic &amp;amp; trace loggers permanently disabled&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Zero unnecessary storage writes and CPU wakeups.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Deep Sleep &amp;amp; Standby&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Stock Doze taking 30–60 minutes of zero physical movement for sleep&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;Quick Doze triggered in 2 minutes&lt;/strong&gt; (&lt;code&gt;light_after_inactive_to=60000&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;Overnight standby drain drops from &lt;strong&gt;8%–12% down to 2%–3%&lt;/strong&gt;.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Modem Power Profile&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;LTE radio kept fully active 24/7 even during active Wi-Fi sessions&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;Wi-Fi Power Collapse Enabled&lt;/strong&gt; (&lt;code&gt;ro.ril.disable.power.collapse=0&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;Standby current drain drops by ~35 mA while connected to Wi-Fi.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Memory &amp;amp; App Retention&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Aggressive OEM low-memory killer closing background messaging apps&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Linux cgroup Cached App Freezer + MGLRU&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;8–12 applications retained in background memory with instant switching.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Active Current Drain&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;$\sim 650\text{ mA} - 720\text{ mA}$ during basic scrolling&lt;/td&gt;
&lt;td&gt;$\sim 420\text{ mA} - 460\text{ mA}$ during basic scrolling&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;~35% reduction&lt;/strong&gt; in active power consumption.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Screen-on-Time (SOT)&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;3.0 to 3.5 Hours&lt;/strong&gt; on degraded 58.9% battery health ($2,945\text{ mAh}$)&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;6.0 to 6.5 Hours&lt;/strong&gt; on the exact same degraded cell&lt;/td&gt;
&lt;td&gt;Full-day endurance restored despite 41.1% battery wear.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Wi-Fi Auto-Scan&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Intermittent background scan suppression requiring manual settings open&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;Continuous background scanning &amp;amp; fast association&lt;/strong&gt; (&lt;code&gt;wifi_scan_always_enabled=1&lt;/code&gt;)&lt;/td&gt;
&lt;td&gt;Instant autonomous reconnection to known access points.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  10. Conclusion &amp;amp; Engineering Takeaways
&lt;/h2&gt;

&lt;p&gt;Taking a 2021 budget MediaTek phone from end-of-life stock software to modern Android 16 demonstrated several key engineering lessons:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Vendor Server Sunsets Can Be Bypassed:&lt;/strong&gt; When official unlock authorization servers go dark, low-level hardware interfaces like MediaTek BROM offer a reliable, direct path to bootloader unlocking.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Firmware Baselines Anchor Custom ROMs:&lt;/strong&gt; Modern AOSP cannot simply be installed arbitrarily; establishing the &lt;strong&gt;Realme UI 3.0 (Android 12) firmware baseline&lt;/strong&gt; was the critical prerequisite for camera, audio, and TrustZone hardware stability on Android 16.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Framework-Level Tuning Resolves Display Flaws:&lt;/strong&gt; An annoying 90Hz display wake flicker was resolved not by risky kernel hacking, but by properly configuring Android's &lt;code&gt;DisplayManagerService&lt;/code&gt; preferred mode registers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Aging Hardware Demands Active OS Tuning:&lt;/strong&gt; On a 58.9% battery retention baseline, targeted optimizations—AOT compilation, cgroup process freezing, and modem sleep—can bridge the efficiency gap, yielding over 6 hours of real-world Screen-on-Time.&lt;/li&gt;
&lt;/ol&gt;




&lt;p&gt;&lt;small&gt;&lt;em&gt;Shared as an open-source reference for the Android modding and engineering community.&lt;/em&gt;&lt;/small&gt;&lt;/p&gt;

</description>
      <category>android</category>
      <category>linux</category>
      <category>mobile</category>
      <category>performance</category>
    </item>
  </channel>
</rss>
