## Problem
On Android 10 (API 29) or later, when a trusted network has been configured, if the mobile device rejoins the network while KDE Connect is running in the background, it doesn't reconnect to any paired devices in the trusted network. It only reconnects when the user brings the app to the foreground.
## Cause
Android 10 introduced [a separate permission for background location access](https://developer.android.com/about/versions/10/privacy/changes#app-access-device-location).
When KDE Connect is running in the background with API 29+, [`TrustedNetworkHelper.currentSSID` fails to get the SSID](d22967f475/src/org/kde/kdeconnect/Helpers/TrustedNetworkHelper.java (L77)) because it doesn't have the required permission. This prevents KDE Connect from verifying whether a network is trusted.
## Solution
Make KDE Connect request for background location access permission.
To request for background location access, an app must [declare it in the manifest](https://developer.android.com/training/location/permissions#background), or else the option to to enable background location access won't appear in settings.
As a side note, the permission request dialog in `TrustedNetworksActivity` doesn't require changes because after Android 11, the option to allow background location no longer shows up in a dialog. [It has to be manually enabled in settings.](https://developer.android.com/training/location/permissions#background-dialog-target-sdk-version)
## Test Plan
### Before:
On Android 10 or later, configure a trusted network and pair with a device in it. Let KDE Connect run in the background. Disconnect from the trusted network and then rejoin. KDE Connect won't automatically reconnect to the paired device.
### After:
Do the same steps as above, except after configuring the trust network, go into settings and allow KDE Connect to access location all the time. After KDE Connect rejoins the trusted network, it should automatically reconnect to the paired device.

Summary: I have created a new activity that allows you to trust all networks or add networks one by one to a list when you are connected to that network
Test Plan:
Test Cases:
1. By default everything should works like it works before, If you uncheck the "Allow all" option in trusted network menu and there isn't any ssid in the trusted
network list the app doesn't send the first udp package and log "Current WiFi isn't a Trusted Network"
2. With the "Allow all" uncheck, use "Add: YOUR_SSID_NAME" button to add your current ssid to the trusted networks list, once you added, go back and the app should
works as always
{F6152314}
1 -> https://youtu.be/ZpCEFTstbJI
2 -> https://youtu.be/cVB1LXlFVyk
Reviewers: #kde_connect, jdvr
Subscribers: sredman, albertvaka, nicolasfella, apol, kdeconnect
Tags: #kde_connect
Maniphest Tasks: T8539
Differential Revision: https://phabricator.kde.org/D13505