am 453d52b6
: am 51d71aa2
: am 583deb52
: Merge "Unconfigure the lockdown VPN if the user forgets its profile." into mnc-dr-dev
* commit '453d52b6575ebd97c7b4c962bd3a687c1c163968': Unconfigure the lockdown VPN if the user forgets its profile.
This commit is contained in:
@@ -16,6 +16,8 @@
|
|||||||
|
|
||||||
package com.android.settings.vpn2;
|
package com.android.settings.vpn2;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
import android.app.DialogFragment;
|
import android.app.DialogFragment;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
@@ -123,7 +125,18 @@ public class ConfigDialogFragment extends DialogFragment implements
|
|||||||
disconnect(profile);
|
disconnect(profile);
|
||||||
|
|
||||||
// Delete from KeyStore
|
// Delete from KeyStore
|
||||||
KeyStore.getInstance().delete(Credentials.VPN + profile.key, KeyStore.UID_SELF);
|
KeyStore keyStore = KeyStore.getInstance();
|
||||||
|
keyStore.delete(Credentials.VPN + profile.key, KeyStore.UID_SELF);
|
||||||
|
|
||||||
|
// If this was the current lockdown VPN, clear it.
|
||||||
|
if (Arrays.equals(profile.key.getBytes(), keyStore.get(Credentials.LOCKDOWN_VPN))) {
|
||||||
|
keyStore.delete(Credentials.LOCKDOWN_VPN);
|
||||||
|
try {
|
||||||
|
mService.updateLockdownVpn();
|
||||||
|
} catch (RemoteException e) {
|
||||||
|
Log.e(TAG, "Failed to clear lockdown VPN configuration");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
dismiss();
|
dismiss();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user