]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
android: Pass UUID to VPN service to initiate profiles
authorTobias Brunner <tobias@strongswan.org>
Thu, 21 Jun 2018 14:46:13 +0000 (16:46 +0200)
committerTobias Brunner <tobias@strongswan.org>
Tue, 3 Jul 2018 09:31:42 +0000 (11:31 +0200)
src/frontends/android/app/src/main/java/org/strongswan/android/logic/CharonVpnService.java
src/frontends/android/app/src/main/java/org/strongswan/android/logic/VpnStateService.java
src/frontends/android/app/src/main/java/org/strongswan/android/ui/VpnProfileControlActivity.java

index 803b205a78e08fd288d0d757e92f67e277fe23a6..ac22cf5ff2a1e89342b6eea1cd32869bbfd4c487 100644 (file)
@@ -160,7 +160,7 @@ public class CharonVpnService extends VpnService implements Runnable, VpnStateSe
                                Bundle bundle = intent.getExtras();
                                if (bundle != null)
                                {
-                                       profile = mDataSource.getVpnProfile(bundle.getLong(VpnProfileDataSource.KEY_ID));
+                                       profile = mDataSource.getVpnProfile(bundle.getString(VpnProfileDataSource.KEY_UUID));
                                        if (profile != null)
                                        {
                                                String password = bundle.getString(VpnProfileDataSource.KEY_PASSWORD);
index 4be782640b1d0b04a822f8423b2fd42919e4983d..0dc340346848b5bd7bce55b29b0ae7c73759c283 100644 (file)
@@ -289,7 +289,7 @@ public class VpnStateService extends Service
                if (profileInfo == null)
                {
                        profileInfo = new Bundle();
-                       profileInfo.putLong(VpnProfileDataSource.KEY_ID, mProfile.getId());
+                       profileInfo.putString(VpnProfileDataSource.KEY_UUID, mProfile.getUUID().toString());
                        /* pass the previous password along */
                        profileInfo.putString(VpnProfileDataSource.KEY_PASSWORD, mProfile.getPassword());
                }
index a6cad4ecdb9fb8519a9fcb2d580993bae30d01c7..09553bdff4aac47e9d01a776496fb8ebd60d7eaa 100644 (file)
@@ -217,7 +217,7 @@ public class VpnProfileControlActivity extends AppCompatActivity
        public void startVpnProfile(VpnProfile profile)
        {
                Bundle profileInfo = new Bundle();
-               profileInfo.putLong(VpnProfileDataSource.KEY_ID, profile.getId());
+               profileInfo.putString(VpnProfileDataSource.KEY_UUID, profile.getUUID().toString());
                profileInfo.putString(VpnProfileDataSource.KEY_USERNAME, profile.getUsername());
                profileInfo.putString(VpnProfileDataSource.KEY_PASSWORD, profile.getPassword());
                profileInfo.putBoolean(PROFILE_REQUIRES_PASSWORD, profile.getVpnType().has(VpnTypeFeature.USER_PASS));