lock screen: use device admin instead of accessibility service

This commit is contained in:
Josia Pietsch 2024-11-01 21:35:31 +01:00
parent 3c73a7f49d
commit 3423534085
Signed by: jrpie
GPG key ID: E70B571D66986A2D
7 changed files with 80 additions and 96 deletions

View file

@ -1,18 +1,13 @@
<resources>
<string name="accessibility_service_description">Enable lock screen action</string>
<!--
-
- Home
-
-->
-
- Home
-
-->
<string name="alert_cant_open_title">Can\'t open app</string>
<string name="alert_cant_open_message">Want to change its settings?</string>
<string name="alert_lock_screen_failed">Failed to lock screen</string>
<string name="toast_cant_open_message">Open settings to choose an action for this gesture</string>
<string name="toast_accessibility_service_not_enabled">μLauncher\'s accessibility service is not enabled. Please enable it in settings</string>
<string name="toast_lock_screen_not_supported">Sorry, lock screen is available on Android 9+</string>
<!--
-
@ -207,11 +202,13 @@
<string name="tutorial_finish_button">Start</string>
<string name="settings">Settings</string>
<string name="ic_menu_alt">More options</string>
<string name="alert_cant_expand_status_bar_panel">Error: Can\'t expand status bar.\nThis action is using functionality that is not part of the published Android API. Unfortunately, it does not seem to work on your device.</string>
<string name="snackbar_app_hidden">App hidden. You can make it visible again in settings.</string>
<string name="undo">Undo</string>
<string name="list_other_expand_settings_panel">Quick Settings</string>
<string name="toast_device_admin_not_enabled">µLauncher needs to be a device admin in order to lock the screen.</string>
<string name="device_admin_explanation">This is required for the lock screen action.</string>
<string name="device_admin_description">Enable the lock screen action</string>
</resources>

View file

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<accessibility-service xmlns:android="http://schemas.android.com/apk/res/android"
android:accessibilityEventTypes="typeAllMask"
android:accessibilityFeedbackType="feedbackAllMask"
android:accessibilityFlags="flagDefault"
android:description="@string/accessibility_service_description"
/>

View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<device-admin xmlns:android="http://schemas.android.com/apk/res/android">
<uses-policies>
<force-lock />
</uses-policies>
</device-admin>