Merge branch 'android-always-on-managed'

Fixes an issue with initiating managed profiles as Always-on VPN.

Closes strongswan/strongswan#2756
This commit is contained in:
Tobias Brunner 2025-04-04 08:57:12 +02:00
commit 5e4dedfc20
4 changed files with 13 additions and 20 deletions

View File

@ -9,8 +9,8 @@ android {
minSdkVersion 21
targetSdkVersion 34
versionCode 88
versionName "2.5.4"
versionCode 89
versionName "2.5.5"
externalNativeBuild {
ndkBuild {

View File

@ -1,6 +1,6 @@
/*
* Copyright (C) 2023 Relution GmbH
* Copyright (C) 2014-2024 Tobias Brunner
* Copyright (C) 2014-2025 Tobias Brunner
*
* Copyright (C) secunet Security Networks AG
*
@ -38,14 +38,10 @@ import java.util.concurrent.Executor;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import androidx.annotation.NonNull;
import androidx.core.os.HandlerCompat;
import androidx.lifecycle.DefaultLifecycleObserver;
import androidx.lifecycle.LifecycleOwner;
import androidx.lifecycle.ProcessLifecycleOwner;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
public class StrongSwanApplication extends Application implements DefaultLifecycleObserver
public class StrongSwanApplication extends Application
{
private static final String TAG = StrongSwanApplication.class.getSimpleName();
@ -80,6 +76,7 @@ public class StrongSwanApplication extends Application implements DefaultLifecyc
public void onCreate()
{
super.onCreate();
StrongSwanApplication.mContext = getApplicationContext();
StrongSwanApplication.mInstance = this;
@ -92,24 +89,12 @@ public class StrongSwanApplication extends Application implements DefaultLifecyc
mUserCertificateManager = new ManagedUserCertificateManager(mContext, mManagedConfigurationService, mDatabaseHelper);
ProcessLifecycleOwner.get().getLifecycle().addObserver(this);
}
@Override
public void onResume(@NonNull LifecycleOwner owner)
{
reloadManagedConfigurationAndNotifyListeners();
final IntentFilter restrictionsFilter = new IntentFilter(Intent.ACTION_APPLICATION_RESTRICTIONS_CHANGED);
registerReceiver(mRestrictionsReceiver, restrictionsFilter);
}
@Override
public void onPause(@NonNull LifecycleOwner owner)
{
unregisterReceiver(mRestrictionsReceiver);
}
private void reloadManagedConfigurationAndNotifyListeners()
{
final Set<String> uuids = new HashSet<>(mManagedConfigurationService.getManagedProfiles().keySet());

View File

@ -1,3 +1,7 @@
# 2.5.5 #
- Fixt den Start von verwalteten Profilen als Always-on VPN
# 2.5.4 #
- Fixt Probleme beim Wiederherstellen der Verbindung

View File

@ -1,3 +1,7 @@
# 2.5.5 #
- Fix initiating managed profiles as Always-on VPN
# 2.5.4 #
- Fix issues when reestablishing the connection