mirror of
https://github.com/fankes/termux-app.git
synced 2025-09-06 10:45:23 +08:00
Move Termux app specific logic out of PermissionUtils
This commit is contained in:
@@ -640,8 +640,13 @@ public final class TermuxService extends Service implements TermuxTask.TermuxTas
|
||||
// For android >= 10, apps require Display over other apps permission to start foreground activities
|
||||
// from background (services). If it is not granted, then TermuxSessions that are started will
|
||||
// show in Termux notification but will not run until user manually clicks the notification.
|
||||
if (PermissionUtils.validateDisplayOverOtherAppsPermissionForPostAndroid10(this)) {
|
||||
if (PermissionUtils.validateDisplayOverOtherAppsPermissionForPostAndroid10(this, true)) {
|
||||
TermuxActivity.startTermuxActivity(this);
|
||||
} else {
|
||||
TermuxAppSharedPreferences preferences = TermuxAppSharedPreferences.build(this);
|
||||
if (preferences == null) return;
|
||||
if (preferences.arePluginErrorNotificationsEnabled())
|
||||
Logger.showToast(this, this.getString(R.string.error_display_over_other_apps_permission_not_granted), true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -91,6 +91,11 @@
|
||||
|
||||
|
||||
|
||||
<!-- TermuxService -->
|
||||
<string name="error_display_over_other_apps_permission_not_granted">&TERMUX_APP_NAME; requires \"Display over other apps\" permission to start terminal sessions from background on Android >= 10. Grants it from Settings -> Apps -> &TERMUX_APP_NAME; -> Advanced</string>
|
||||
|
||||
|
||||
|
||||
<!-- Termux RunCommandService -->
|
||||
<string name="error_run_command_service_invalid_intent_action">Invalid intent action to RunCommandService: `%1$s`</string>
|
||||
<string name="error_run_command_service_mandatory_extra_missing">Mandatory extra missing to RunCommandService: \"%1$s\"</string>
|
||||
|
Reference in New Issue
Block a user