Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f530da67 authored by Chia-chi Yeh's avatar Chia-chi Yeh
Browse files

VpnDialogs: use IConnectivityManager instead or ConnectivityManager.

Change-Id: I8870a43ecbffa606d2e29f6c4b1b1a605b2b79e5
parent f8905fd1
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -23,7 +23,8 @@ import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.net.ConnectivityManager;
import android.net.IConnectivityManager;
import android.os.ServiceManager;
import android.util.Log;
import android.view.View;
import android.widget.Button;
@@ -37,7 +38,7 @@ public class ConfirmDialog extends Activity implements CompoundButton.OnCheckedC

    private String mPackageName;

    private ConnectivityManager mService;
    private IConnectivityManager mService;

    private AlertDialog mDialog;
    private Button mButton;
@@ -47,7 +48,9 @@ public class ConfirmDialog extends Activity implements CompoundButton.OnCheckedC
        super.onResume();
        try {
            mPackageName = getCallingPackage();
            mService = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);

            mService = IConnectivityManager.Stub.asInterface(
                    ServiceManager.getService(Context.CONNECTIVITY_SERVICE));

            if (mPackageName.equals(mService.prepareVpn(null))) {
                setResult(RESULT_OK);
+5 −3
Original line number Diff line number Diff line
@@ -23,9 +23,10 @@ import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.net.ConnectivityManager;
import android.net.IConnectivityManager;
import android.os.Handler;
import android.os.Message;
import android.os.ServiceManager;
import android.os.SystemClock;
import android.util.Log;
import android.view.View;
@@ -45,7 +46,7 @@ public class ManageDialog extends Activity implements
    private String mInterfaceName;
    private long mStartTime;

    private ConnectivityManager mService;
    private IConnectivityManager mService;

    private AlertDialog mDialog;
    private TextView mDuration;
@@ -64,7 +65,8 @@ public class ManageDialog extends Activity implements
            mInterfaceName = intent.getStringExtra("interfaceName");
            mStartTime = intent.getLongExtra("startTime", 0);

            mService = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
            mService = IConnectivityManager.Stub.asInterface(
                    ServiceManager.getService(Context.CONNECTIVITY_SERVICE));

            PackageManager pm = getPackageManager();
            ApplicationInfo app = pm.getApplicationInfo(mPackageName, 0);