Skip to content

Commit

Permalink
Update dev.md
Browse files Browse the repository at this point in the history
  • Loading branch information
synchromach authored Jan 13, 2024
1 parent bd1241a commit 40fb6f5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion _vendors-content/sony/dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ manufacturer:

---

There is no workaround to prevent background process optimizations in *Stamina mode*, but at least apps can detect that Stamina mode is enabled with the following command:
For newer Android versions, check for Battery Saver mode, which for Sony devices is rebranded as STAMINA mode. There is no way to detect if "Prefer battery time" is set, but if your app's notifications don't show up or SurfaceFlinger is at a lower framerate than usual, it's probably on. Alarms are not killed either way, but users can (and some will) deprive your app of the permission to set these alarms in the first place.

For older Android versions, there is no workaround to prevent background process optimizations in STAMINA mode, but apps can detect whether it's enabled with the following code:

```java
if (Build.MANUFACTURER.equals("sony") && android.provider.Settings.Secure.getInt(context.getContentResolver(), "somc.stamina_mode", 0) > 0) {
Expand Down

0 comments on commit 40fb6f5

Please sign in to comment.