MCPcopy Index your code
hub / github.com/Solarphlare/BatteryTile

github.com/Solarphlare/BatteryTile @v2.0.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release v2.0.1 ↗ · + Follow
67 symbols 206 edges 13 files 8 documented · 12%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

BatteryTile

An Android Quick Settings tile that displays the current battery state and percentage, and a long-press action to open the battery settings.

Features

  • Customize the tile to display information about your battery, including voltage, current, percentage, and temperature.
  • Brings back the "long press to open battery settings" feature removed in Android 12.
  • [Experimental, Not Supported] Have the tile act as the Battery Saver tile, for those who wish to have an experience as close as possible to Android 11 and below.

Reasoning

The "Battery Saver" tile in Android 12 in below, when long-pressed, would open the battery settings page in Android Settings. With the introduction of Android 13, it no longer presents the battery settings page. Instead, it now opens the Battery Saver settings, removing this very useful shortcut. This app aims to restore said functionality with a custom Quick Settings tile.

Compatibility

This app is compatible with API 29+ devices (Android 10 or higher), as Quick Settings tile subtitles were added in that release.

Theoretically, compatibility could be extended to cover API 24+ as well (Android 7 and up) if references to Tile#setSubtitle were removed. However, this would defeat one of the purposes of the tile, but the option to do so is available to anyone who wishes to compile it on their own.

Download

The latest version can be downloaded from releases page.

Alternatively, you can get it on F-Droid via the IzzyOnDroid repo:

Get it on IzzyOnDroid

The app is also available on Google Play. Please note that the Google Play version is only localized for English and does not support the "act as Battery Saver tile" feature.

Get it on Google Play

Screenshots

The tile can be customized in various ways, such as: | | | | |:-------------------------:|:-------------------------:|:-------------------------:| | Displaying battery level and temperature while wired charging | Displaying battery level and voltage while wirelessly charging | Displaying temperature while discharging | | Displaying as the Battery Saver tile | Default when charging and no customizations are applied |

Questions? Answers.

How do I customize the tile?

You can customize the tile by tapping the "Additional settings in the app" or "In-app notification settings" button (or your device's equivalent) on the app's "App info" page within your Settings app, usually found under your Settings app's "Apps" category.

Does this app replace the existing Battery Saver tile?

No - all it does is add a new, separate tile that you can use in place of the Battery Saver tile. You can still use the standard Battery Saver tile alongside the tile provided by this app.

Why are the "Act as Battery Saver Tile" and "Tap to toggle Battery Saver" features not officially supported? Why do I need to use ADB to enable them?

Android has no official API to allow apps to control the state of the Battery Saver setting. It can only be done by manually toggling the setting through the Settings class, and changing the state of the Battery Saver setting requires the WRITE_SECURE_SETTINGS permission. This permission is only granted to specific system apps, such as your Settings app and other Android system components. The only other way to grant this permission is via ADB, which you must do before the app can be able to set the Battery Saver state.

As to why these features aren't officially supported, Android does not expect Battery Saver to be enabled or disabled via the Settings class. Because of this, these features can cause Android itself to no longer be able to control whether or not Battery Saver is on or off. This will mean that after using this app's tile to toggle Battery Saver, things like the standard Android Battery Saver tile won't work anymore, nor will the Battery Saver switches in your Settings app work, as well as any feature that automatically enables Battery Saver. However, tapping the tile from this app again to reverse the change will automatically fix this.

Why is my language missing some formatters in its description?

The translations for this app are provided by the community. This means that when a new formatter is added, I'm not able to add a translation for any language other than English, meaning that the description text will be missing some formatters. They'll still work if you type them in — they're just not in the description text. If you speak a language that's missing formatters, feel free to open a pull request with any translations.

My question isn't listed here!

Feel free to open an issue if you find a bug, or have any questions regarding this app.

Core symbols most depended-on inside this repo

setChecked
called by 15
app/src/main/java/com/cominatyou/batterytile/standalone/views/ToggleablePreferenceItemView.java
format
called by 10
app/src/main/java/com/cominatyou/batterytile/standalone/preferences/TileTextFormatter.java
setDescription
called by 9
app/src/main/java/com/cominatyou/batterytile/standalone/views/PreferenceItemView.java
setActiveLabelText
called by 7
app/src/main/java/com/cominatyou/batterytile/standalone/QuickSettingsTileService.java
setEnabled
called by 7
app/src/main/java/com/cominatyou/batterytile/standalone/views/PreferenceItemView.java
show
called by 6
app/src/main/java/com/cominatyou/batterytile/standalone/preferences/AdbDialog.java
toggle
called by 6
app/src/main/java/com/cominatyou/batterytile/standalone/views/ToggleablePreferenceItemView.java
setOnCheckedChangeListener
called by 5
app/src/main/java/com/cominatyou/batterytile/standalone/views/ToggleablePreferenceItemView.java

Shape

Method 54
Class 13

Languages

Java100%

Modules by API surface

app/src/main/java/com/cominatyou/batterytile/standalone/debug/DebugInfoCollector.java10 symbols
app/src/main/java/com/cominatyou/batterytile/standalone/views/ToggleablePreferenceItemView.java9 symbols
app/src/main/java/com/cominatyou/batterytile/standalone/QuickSettingsTileService.java9 symbols
app/src/main/java/com/cominatyou/batterytile/standalone/preferences/PreferencesBottomSheet.java8 symbols
app/src/main/java/com/cominatyou/batterytile/standalone/preferences/EditTileTextActivity.java7 symbols
app/src/main/java/com/cominatyou/batterytile/standalone/views/PreferenceItemView.java6 symbols
app/src/main/java/com/cominatyou/batterytile/standalone/preferences/PreferencesActivity.java5 symbols
app/src/main/java/com/cominatyou/batterytile/standalone/preferences/TileTextFormatter.java3 symbols
app/src/main/java/com/cominatyou/batterytile/standalone/preferences/TileTextDisambiguationDialog.java2 symbols
app/src/main/java/com/cominatyou/batterytile/standalone/preferences/TileStatePickerDialog.java2 symbols
app/src/main/java/com/cominatyou/batterytile/standalone/preferences/AdbDialog.java2 symbols
app/src/main/java/com/cominatyou/batterytile/standalone/debug/DebugDialog.java2 symbols

For agents

$ claude mcp add BatteryTile \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact