Less intrusive VPN dialog.
Add new AppOps to Settings and remove references to obsolete ManageDialog. VPN UX now lives in Quick Settings. Bug: 12878887 Bug: 16578022 Change-Id: I102a14c05db26ee3aef030cda971e5165f078a91
This commit is contained in:
@@ -646,6 +646,7 @@
|
|||||||
<item>get usage stats</item>
|
<item>get usage stats</item>
|
||||||
<item>mute/unmute microphone</item>
|
<item>mute/unmute microphone</item>
|
||||||
<item>project media</item>
|
<item>project media</item>
|
||||||
|
<item>activate VPN</item>
|
||||||
</string-array>
|
</string-array>
|
||||||
|
|
||||||
<!-- User display names for app ops codes -->
|
<!-- User display names for app ops codes -->
|
||||||
@@ -696,6 +697,7 @@
|
|||||||
<item>Get usage stats</item>
|
<item>Get usage stats</item>
|
||||||
<item>Mute/unmute microphone</item>
|
<item>Mute/unmute microphone</item>
|
||||||
<item>Project media</item>
|
<item>Project media</item>
|
||||||
|
<item>Activate VPN</item>
|
||||||
</string-array>
|
</string-array>
|
||||||
|
|
||||||
<!-- Titles for the list of long press timeout options. -->
|
<!-- Titles for the list of long press timeout options. -->
|
||||||
|
@@ -190,13 +190,15 @@ public class AppOpsState {
|
|||||||
AppOpsManager.OP_WRITE_SETTINGS,
|
AppOpsManager.OP_WRITE_SETTINGS,
|
||||||
AppOpsManager.OP_SYSTEM_ALERT_WINDOW,
|
AppOpsManager.OP_SYSTEM_ALERT_WINDOW,
|
||||||
AppOpsManager.OP_WAKE_LOCK,
|
AppOpsManager.OP_WAKE_LOCK,
|
||||||
AppOpsManager.OP_PROJECT_MEDIA },
|
AppOpsManager.OP_PROJECT_MEDIA,
|
||||||
|
AppOpsManager.OP_ACTIVATE_VPN, },
|
||||||
new boolean[] { false,
|
new boolean[] { false,
|
||||||
true,
|
true,
|
||||||
true,
|
true,
|
||||||
true,
|
true,
|
||||||
true,
|
true,
|
||||||
true,
|
true,
|
||||||
|
false,
|
||||||
false, }
|
false, }
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@@ -45,8 +45,10 @@ import android.view.MenuInflater;
|
|||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.AdapterView.AdapterContextMenuInfo;
|
import android.widget.AdapterView.AdapterContextMenuInfo;
|
||||||
|
import android.widget.AdapterView.OnItemSelectedListener;
|
||||||
import android.widget.ArrayAdapter;
|
import android.widget.ArrayAdapter;
|
||||||
import android.widget.ListView;
|
import android.widget.ListView;
|
||||||
|
import android.widget.Spinner;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
@@ -56,7 +58,6 @@ import com.android.internal.net.VpnProfile;
|
|||||||
import com.android.internal.util.ArrayUtils;
|
import com.android.internal.util.ArrayUtils;
|
||||||
import com.android.settings.R;
|
import com.android.settings.R;
|
||||||
import com.android.settings.SettingsPreferenceFragment;
|
import com.android.settings.SettingsPreferenceFragment;
|
||||||
|
|
||||||
import com.google.android.collect.Lists;
|
import com.google.android.collect.Lists;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -349,15 +350,6 @@ public class VpnSettings extends SettingsPreferenceFragment implements
|
|||||||
|
|
||||||
if (preference instanceof VpnPreference) {
|
if (preference instanceof VpnPreference) {
|
||||||
VpnProfile profile = ((VpnPreference) preference).getProfile();
|
VpnProfile profile = ((VpnPreference) preference).getProfile();
|
||||||
if (mInfo != null && profile.key.equals(mInfo.key) &&
|
|
||||||
mInfo.state == LegacyVpnInfo.STATE_CONNECTED) {
|
|
||||||
try {
|
|
||||||
mInfo.intent.send();
|
|
||||||
return true;
|
|
||||||
} catch (Exception e) {
|
|
||||||
// ignore
|
|
||||||
}
|
|
||||||
}
|
|
||||||
mDialog = new VpnDialog(getActivity(), this, profile, false);
|
mDialog = new VpnDialog(getActivity(), this, profile, false);
|
||||||
} else {
|
} else {
|
||||||
// Generate a new key. Here we just use the current time.
|
// Generate a new key. Here we just use the current time.
|
||||||
|
Reference in New Issue
Block a user