Mishaal Rahman from Android Authority highlights a recurring theme in the Android ecosystem: Google’s ongoing efforts to restrict background processes. As each new version of Android is released, the company tightens its grip on how applications can operate when not in the foreground. This initiative stems from a fundamental concern—battery life. With finite battery resources, allowing unrestricted background activity could lead to significant power drain, prompting Google to implement various battery management strategies.
To facilitate necessary background tasks, such as file downloads or music playback, developers can create a foreground service. However, this requires displaying a notification to users. Google encourages developers to utilize APIs like JobScheduler and AlarmManager, or the more user-friendly WorkManager, to manage background tasks efficiently.
Despite these measures, the Android operating system does not effectively quantify the battery cost associated with these tasks, nor does it impose limits on the total workload. For instance, while there may be a cap of 150 jobs per app, this still allows for considerable battery consumption. In response to these challenges, Google conceptualized the Android Resource Economy (TARE), a comprehensive overhaul of background task management aimed at treating battery power as a limited resource that must be allocated judiciously.
The Android Resource Economy: A Non-Central Banker’s Retrospective
TARE proposed a virtual economy governed by a central authority dubbed the IRS, or the Internal Resource Service, cleverly echoing the U.S. tax agency. This IRS would function as both a central bank and a regulatory body, controlling the money supply, setting prices, and enforcing regulations.
Within this framework, Android introduced a virtual currency known as “Android Resource Credits” (ARCs). Applications would require a balance of ARCs to execute background tasks, with a smaller denomination called “Cakes” (1,000,000,000 Cakes equating to 1 ARC) adding a layer of humor to the system.
The Economic Model: CTP vs. Price
- Cost to Produce (CTP): This represents the estimated battery drain associated with executing a task.
- Price: This is the amount charged to the app for performing the action in ARCs.
In an ideal scenario, the Price would be equal to or exceed the CTP, allowing the system to maximize its “profit” by prioritizing tasks that deliver greater user value. Both CTP and Price are dynamic; the IRS adjusts them based on the device’s state, such as increasing costs during battery saver mode or reducing them when the device is charging. Notably, if an app is actively in use, the Price may be reduced to zero.
Earning Credits: Wages and Stimulus
Apps maintain a balance of ARCs in a Ledger overseen by the IRS and its enforcement arm, the Agent. There are two primary methods for apps to earn credits: through Regulations and Rewards. Regulations provide an initial balance upon installation, and if an app’s balance falls below a certain threshold, the IRS offers “Basic Income” when the device is charging to prevent bankruptcy. Rewards are granted based on user engagement, such as opening the app or interacting with notifications.
Spending and Enforcement
Excluding “VIPs” (Very Important Packages), which include the operating system and top-priority apps, all applications must spend ARCs for their actions. Before initiating a task, the system verifies if the app can afford the “Action Bill,” which encompasses the task’s Price and an estimated runtime. If an app’s balance drops below the required amount while a job is in progress, the Agent will halt the task.
The Consumption Limit and Regulation
TARE also introduced a global resource management aspect known as the “Consumption Limit.” This ensures that an action can only proceed if the app can cover the Price and the system’s remaining Consumption Limit can accommodate the CTP. As the battery level decreases, the available resources are proportionately reduced, aligning power consumption with battery status.
The IRS actively regulates the economy through mechanisms such as:
- Wealth Reclamation (Taxation): To deter credit hoarding, the IRS periodically reclaims a percentage of unused ARCs from apps that have not been active recently.
- Dynamic Tuning: The IRS employs an “Analyst” component to monitor historical battery drain against a target rate, adjusting the Consumption Limit accordingly.
A TARE-ible idea?
Ultimately, TARE was a short-lived initiative that Google abandoned last year with the rollout of Android 15. Although it was never fully implemented on devices, the concept raised intriguing questions about the complexities of managing a virtual economy to reflect real-world battery behavior. The intricacies involved may have posed significant challenges for developers, particularly smaller teams, who would need ample time to adapt their applications to this new system.