android: Pass UUID to VPN service to initiate profiles

This commit is contained in:
Tobias Brunner 2018-06-21 16:46:13 +02:00
parent 163f752022
commit 6f9b96acb4
3 changed files with 3 additions and 3 deletions

View 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);

View 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());
}

View 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));