Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,11 @@ A lightweight and minimal Android app that allows Google Pixel users (starting f

```bash
adb shell pm grant de.tebbeubben.chargequicktile android.permission.WRITE_SECURE_SETTINGS
adb shell pm grant de.tebbeubben.chargequicktile android.permission.POST_NOTIFICATIONS
```

3. **Add the Quick Settings Tile**
Pull down your notification shade → Tap the pencil icon to edit tiles → Drag the Charge Optimization tile into your active area.

4. **Start the Foreground Service**
Long press the tile once after adding it to initialize the foreground service. This is required to ensure reliable background operation and must only be done once. After rebooting the service should be started automatically.

5. **(Optional) Hide the Persistent Notification**
Go to Settings → Apps → Charge Optimization → Notifications. Disable the Foreground Service notification if you want a cleaner status bar

## ⚠️ Requirements

- Google Pixel device
Expand All @@ -58,7 +51,6 @@ A lightweight and minimal Android app that allows Google Pixel users (starting f
## 🛡️ Permissions Explained

- `WRITE_SECURE_SETTINGS`: Allows the app to toggle secure system settings related to charging behavior.
- `POST_NOTIFICATIONS`: Enables the app to run reliably as a foreground service, improving performance and reliability.

## 🧠 Why This App?
Android 15 introduced granular charging controls on Pixel phones, but switching between them still involves deep-diving into menus. This app simplifies the process by exposing it through a single, intuitive tile.
Expand Down
29 changes: 1 addition & 28 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,12 @@
android:name="android.permission.WRITE_SECURE_SETTINGS"
tools:ignore="ProtectedPermissions" />

<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_SPECIAL_USE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />

<queries>
<package android:name="com.google.android.settings.intelligence" />
</queries>

<application
android:testOnly="true"
android:name=".ChargeQuickTileApp"
android:allowBackup="false"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
Expand All @@ -38,10 +32,6 @@
android:label="@string/charging_optimization"
android:permission="android.permission.BIND_QUICK_SETTINGS_TILE">

<!-- non-active mode makes a nicer implementation, however, it also introduces some weird UI lags as it needs to wait for the app process to come alive -->
<meta-data
android:name="android.service.quicksettings.ACTIVE_TILE"
android:value="true" />
<meta-data
android:name="android.service.quicksettings.TOGGLEABLE_TILE"
android:value="true" />
Expand All @@ -51,23 +41,6 @@
</intent-filter>
</service>

<service
android:name=".UpdaterService"
android:foregroundServiceType="specialUse">
<property android:name="android.app.PROPERTY_SPECIAL_USE_FGS_SUBTYPE"
android:value="This foreground service keeps the app process alive, so that the QS tile is properly updated in the background."/>
</service>

<receiver
android:name=".BootCompletedReceiver"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.MY_PACKAGE_REPLACED" />
</intent-filter>
</receiver>
</application>

</manifest>
</manifest>

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,13 @@ import android.service.quicksettings.TileService

class ChargeQuickTileService : TileService() {

private lateinit var app: ChargeQuickTileApp

override fun onCreate() {
app = application as ChargeQuickTileApp
}

override fun onTileAdded() {
updateTile()
}

override fun onStartListening() {
app.tileService = this
super.onStartListening()
updateTile()
}

override fun onStopListening() {
app.tileService = null
super.onStopListening()
}

override fun onClick() {
Expand Down Expand Up @@ -65,4 +55,4 @@ class ChargeQuickTileService : TileService() {
qsTile.updateTile()
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ class SettingsLaunchpadActivity : Activity() {

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
startForegroundService(Intent(this, UpdaterService::class.java))
val intent = Intent()
intent.setClassName(
"com.google.android.settings.intelligence",
Expand All @@ -21,4 +20,4 @@ class SettingsLaunchpadActivity : Activity() {
finish()
}

}
}
47 changes: 0 additions & 47 deletions app/src/main/java/de/tebbeubben/chargequicktile/UpdaterService.kt

This file was deleted.

4 changes: 1 addition & 3 deletions app/src/main/res/values-de/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,4 @@
<string name="limit_to_80">Bis 80% laden</string>
<string name="deactivated">Aus</string>
<string name="charging_optimization">Optimiertes Laden</string>
<string name="foreground_notification">Hintergrunddienst aktiv</string>
<string name="you_can_hide_this_notification">Du kannst diese Benachrichtigung verstecken.</string>
</resources>
</resources>
2 changes: 0 additions & 2 deletions app/src/main/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,4 @@
<string name="limit_to_80">Limiter à 80%</string>
<string name="deactivated">Désactivé</string>
<string name="charging_optimization">Optimisation de la recharge</string>
<string name="foreground_notification">Service en arrière-plan actif</string>
<string name="you_can_hide_this_notification">Vous pouvez masquer cette notification.</string>
</resources>
4 changes: 1 addition & 3 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,4 @@
<string name="limit_to_80">Limit to 80%</string>
<string name="deactivated">Off</string>
<string name="charging_optimization">Charging Optimization</string>
<string name="foreground_notification">Background service active</string>
<string name="you_can_hide_this_notification">You can hide this notification.</string>
</resources>
</resources>