android: PowerManager and WifiManager resource locks #319

Manually merged
jarolrod merged 2 commits from android-resource-locks into main 2023-04-17 09:52:02 +00:00 AGit
jarolrod commented 2023-04-16 16:58:53 +00:00 (Migrated from github.com)

This obtains a PARTIAL_WAKE_LOCK from Android's PowerManager and a WIFI_MODE_FULL_HIGH_PERF from the WifiManager. This ensures that the CPU will run our tasks when the screen is off and that Wi-Fi download/upload speeds are not dropped. This makes background IBD performance the same as when the app is in the foreground.

Eventually, we can make this customizable by the user, according to their power/network preferences.

For more information see:

Windows
Intel macOS
Apple Silicon macOS
ARM64 Android

This obtains a [PARTIAL_WAKE_LOCK](https://developer.android.com/reference/android/os/PowerManager#PARTIAL_WAKE_LOCK) from Android's [PowerManager](https://developer.android.com/reference/android/os/PowerManager#summary) and a [WIFI_MODE_FULL_HIGH_PERF](https://developer.android.com/reference/android/net/wifi/WifiManager#WIFI_MODE_FULL_HIGH_PERF) from the [WifiManager](https://developer.android.com/reference/android/net/wifi/WifiManager#summary). This ensures that the CPU will run our tasks when the screen is off and that Wi-Fi download/upload speeds are not dropped. This makes background IBD performance the same as when the app is in the foreground. Eventually, we can make this customizable by the user, according to their power/network preferences. For more information see: - https://developer.android.com/training/scheduling/wakelock#cpu - https://developer.android.com/training/connectivity [![Windows](https://img.shields.io/badge/OS-Windows-green)](https://api.cirrus-ci.com/v1/artifact/github/bitcoin-core/gui-qml/win64/unsecure_win_gui.zip?branch=pull/319) [![Intel macOS](https://img.shields.io/badge/OS-Intel%20macOS-green)](https://api.cirrus-ci.com/v1/artifact/github/bitcoin-core/gui-qml/macos/unsecure_mac_gui.zip?branch=pull/319) [![Apple Silicon macOS](https://img.shields.io/badge/OS-Apple%20Silicon%20macOS-green)](https://api.cirrus-ci.com/v1/artifact/github/bitcoin-core/gui-qml/macos_arm64/unsecure_mac_arm64_gui.zip?branch=pull/319) [![ARM64 Android](https://img.shields.io/badge/OS-Android-green)](https://api.cirrus-ci.com/v1/artifact/github/bitcoin-core/gui-qml/android/unsecure_android_apk.zip?branch=pull/319)
johnny9 (Migrated from github.com) approved these changes 2023-04-16 23:19:45 +00:00
johnny9 (Migrated from github.com) left a comment

ACK 1bb417f84e

Been using these changes myself and they work well for sync times.

ACK 1bb417f84e7d3c57e04f63ca7ff41fbf81001434 Been using these changes myself and they work well for sync times.
Sign in to join this conversation.
No description provided.