Keystore 2.0: Make Legacy VPN settings ready for Keystore 2.0
Keystore 2.0 no longer stores vpn profiles. It still offers a Legacy VPN profile store, to access existing profiles. Test: N/A Bug: 171305607 Bug: 171305388 Change-Id: I40dea0b9c3824b56814ae4c2fb6c7663c7d97af5
This commit is contained in:
@@ -25,7 +25,7 @@ import android.os.Bundle;
|
||||
import android.os.RemoteException;
|
||||
import android.os.UserHandle;
|
||||
import android.security.Credentials;
|
||||
import android.security.KeyStore;
|
||||
import android.security.LegacyVpnProfileStore;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.widget.Toast;
|
||||
@@ -151,9 +151,8 @@ public class ConfigDialogFragment extends InstrumentedDialogFragment implements
|
||||
return;
|
||||
}
|
||||
|
||||
// Delete from KeyStore
|
||||
KeyStore keyStore = KeyStore.getInstance();
|
||||
keyStore.delete(Credentials.VPN + profile.key, KeyStore.UID_SELF);
|
||||
// Delete from profile store.
|
||||
LegacyVpnProfileStore.remove(Credentials.VPN + profile.key);
|
||||
|
||||
updateLockdownVpn(false, profile);
|
||||
}
|
||||
@@ -188,8 +187,7 @@ public class ConfigDialogFragment extends InstrumentedDialogFragment implements
|
||||
}
|
||||
|
||||
private void save(VpnProfile profile, boolean lockdown) {
|
||||
KeyStore.getInstance().put(Credentials.VPN + profile.key, profile.encode(),
|
||||
KeyStore.UID_SELF, /* flags */ 0);
|
||||
LegacyVpnProfileStore.put(Credentials.VPN + profile.key, profile.encode());
|
||||
|
||||
// Flush out old version of profile
|
||||
disconnect(profile);
|
||||
|
Reference in New Issue
Block a user