Remove references to global proxy APIs
Remove global proxy settings from Apidemos Remove CorpApp Bug: 3460938 Change-Id: I2b6889a96341f0e4fad50a9cfaa76db715ecfaa0
This commit is contained in:
@@ -43,12 +43,8 @@ import android.widget.Spinner;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import java.net.InetSocketAddress;
|
||||
import java.net.Proxy;
|
||||
import java.text.DateFormat;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Example of a do-nothing admin class. When enabled, it lets you control
|
||||
@@ -189,10 +185,6 @@ public class DeviceAdminSample extends DeviceAdminReceiver {
|
||||
|
||||
private EditText mTimeout;
|
||||
|
||||
EditText mProxyHost;
|
||||
EditText mProxyList;
|
||||
Button mProxyButton;
|
||||
|
||||
private EditText mPasswordExpirationTimeout;
|
||||
private Button mPasswordExpirationButton;
|
||||
private TextView mPasswordExpirationStatus;
|
||||
@@ -400,11 +392,6 @@ public class DeviceAdminSample extends DeviceAdminReceiver {
|
||||
mTimeoutButton = (Button) findViewById(R.id.set_timeout);
|
||||
mTimeoutButton.setOnClickListener(mSetTimeoutListener);
|
||||
|
||||
mProxyHost = (EditText) findViewById(R.id.proxyhost);
|
||||
mProxyList = (EditText) findViewById(R.id.proxylist);
|
||||
mProxyButton = (Button) findViewById(R.id.set_proxy);
|
||||
mProxyButton.setOnClickListener(mSetProxyListener);
|
||||
|
||||
mEnableEncryptionButton = (Button) findViewById(R.id.encryption_enable_button);
|
||||
mEnableEncryptionButton.setOnClickListener(mEncryptionButtonListener);
|
||||
mDisableEncryptionButton = (Button) findViewById(R.id.encryption_disable_button);
|
||||
@@ -788,49 +775,6 @@ public class DeviceAdminSample extends DeviceAdminReceiver {
|
||||
}
|
||||
};
|
||||
|
||||
private OnClickListener mSetProxyListener = new OnClickListener() {
|
||||
|
||||
public void onClick(View v) {
|
||||
boolean active = mDPM.isAdminActive(mDeviceAdminSample);
|
||||
String proxySpec = mProxyHost.getText().toString();
|
||||
String proxyList = mProxyList.getText().toString();
|
||||
Proxy instProxy;
|
||||
List<String> exclList;
|
||||
|
||||
if ((proxySpec.length() == 0) || (proxySpec == null)) {
|
||||
instProxy = Proxy.NO_PROXY;
|
||||
} else {
|
||||
String[] proxyComponents = proxySpec.split(":");
|
||||
if (proxyComponents.length != 2) {
|
||||
Toast.makeText(Controller.this, "Wrong proxy specification.",
|
||||
Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
instProxy = new Proxy(Proxy.Type.HTTP,
|
||||
new InetSocketAddress(proxyComponents[0],
|
||||
Integer.parseInt(proxyComponents[1])));
|
||||
}
|
||||
if ((proxyList == null) || (proxyList.length() == 0)) {
|
||||
exclList = null;
|
||||
} else {
|
||||
String[] listDoms = proxyList.split(",");
|
||||
if (listDoms.length == 0) {
|
||||
Toast.makeText(Controller.this, "Wrong exclusion list format.",
|
||||
Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
exclList = Arrays.asList(listDoms);
|
||||
}
|
||||
if (active) {
|
||||
mDPM.setGlobalProxy(mDeviceAdminSample, instProxy, exclList);
|
||||
ComponentName proxyAdmin = mDPM.getGlobalProxyAdmin();
|
||||
if ((proxyAdmin != null) && (proxyAdmin.equals(mDeviceAdminSample))) {
|
||||
Toast.makeText(Controller.this, "Global Proxy set by device admin.",
|
||||
Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
private OnClickListener mEncryptionButtonListener = new OnClickListener() {
|
||||
public void onClick(View v) {
|
||||
int buttonId = v.getId();
|
||||
|
||||
Reference in New Issue
Block a user