android: Pass UUID to VPN service to initiate profiles
This commit is contained in:
+1
-1
@@ -160,7 +160,7 @@ public class CharonVpnService extends VpnService implements Runnable, VpnStateSe
|
|||||||
Bundle bundle = intent.getExtras();
|
Bundle bundle = intent.getExtras();
|
||||||
if (bundle != null)
|
if (bundle != null)
|
||||||
{
|
{
|
||||||
profile = mDataSource.getVpnProfile(bundle.getLong(VpnProfileDataSource.KEY_ID));
|
profile = mDataSource.getVpnProfile(bundle.getString(VpnProfileDataSource.KEY_UUID));
|
||||||
if (profile != null)
|
if (profile != null)
|
||||||
{
|
{
|
||||||
String password = bundle.getString(VpnProfileDataSource.KEY_PASSWORD);
|
String password = bundle.getString(VpnProfileDataSource.KEY_PASSWORD);
|
||||||
|
|||||||
+1
-1
@@ -289,7 +289,7 @@ public class VpnStateService extends Service
|
|||||||
if (profileInfo == null)
|
if (profileInfo == null)
|
||||||
{
|
{
|
||||||
profileInfo = new Bundle();
|
profileInfo = new Bundle();
|
||||||
profileInfo.putLong(VpnProfileDataSource.KEY_ID, mProfile.getId());
|
profileInfo.putString(VpnProfileDataSource.KEY_UUID, mProfile.getUUID().toString());
|
||||||
/* pass the previous password along */
|
/* pass the previous password along */
|
||||||
profileInfo.putString(VpnProfileDataSource.KEY_PASSWORD, mProfile.getPassword());
|
profileInfo.putString(VpnProfileDataSource.KEY_PASSWORD, mProfile.getPassword());
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -217,7 +217,7 @@ public class VpnProfileControlActivity extends AppCompatActivity
|
|||||||
public void startVpnProfile(VpnProfile profile)
|
public void startVpnProfile(VpnProfile profile)
|
||||||
{
|
{
|
||||||
Bundle profileInfo = new Bundle();
|
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_USERNAME, profile.getUsername());
|
||||||
profileInfo.putString(VpnProfileDataSource.KEY_PASSWORD, profile.getPassword());
|
profileInfo.putString(VpnProfileDataSource.KEY_PASSWORD, profile.getPassword());
|
||||||
profileInfo.putBoolean(PROFILE_REQUIRES_PASSWORD, profile.getVpnType().has(VpnTypeFeature.USER_PASS));
|
profileInfo.putBoolean(PROFILE_REQUIRES_PASSWORD, profile.getVpnType().has(VpnTypeFeature.USER_PASS));
|
||||||
|
|||||||
Reference in New Issue
Block a user