android: Add Quick Settings tile to toggle VPN state
Only if there is no currently active (or previously active) profile does this currently operate on the configured (or stored most recently used) profile. This way it's possible to use a different connection and quickly disable and re-enable it again. When unlocked the profile name is shown, when locked a generic text is used (this detection doesn't seem to work 100% reliably). To disconnect, the user is forced to unlock the device, connecting is possible without, if the credentials are available and no fatal error occurs (it even works with the system credential store, at least on Android 8.1). Note that the tile is not available right after a reboot. It seems that the system has to be unlocked once to activate third-party tiles (will be interesting to see how this works together with Always-on VPN).
This commit is contained in:
1 parent
08c79d5112
commit
64b7a6d622
12 files changed
+279
No files matched your search
@@ -36,6 +36,9 @@
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="android.service.quicksettings.action.QS_TILE_PREFERENCES" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".ui.VpnProfileControlActivity"
|
||||
@@ -156,6 +159,15 @@
|
||||
<action android:name="android.net.VpnService" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
<service
|
||||
android:name=".ui.VpnTileService"
|
||||
android:label="@string/tile_default"
|
||||
android:icon="@drawable/ic_notification"
|
||||
android:permission="android.permission.BIND_QUICK_SETTINGS_TILE">
|
||||
<intent-filter>
|
||||
<action android:name="android.service.quicksettings.action.QS_TILE" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
|
||||
<provider
|
||||
android:name=".data.LogContentProvider"
|
||||
|
||||
Reference in new issue
Block a user