fix NPE crash if VPN prepare Intent is null on boot
This commit is contained in:
parent
ddecd0ce82
commit
ec24428915
|
@ -33,15 +33,15 @@ public class OnBootReceiver extends BroadcastReceiver {
|
||||||
|
|
||||||
@SuppressLint("NewApi")
|
@SuppressLint("NewApi")
|
||||||
public void startVpnService (Context context)
|
public void startVpnService (Context context)
|
||||||
{
|
{
|
||||||
Intent intent = VpnService.prepare(context);
|
Intent intent = VpnService.prepare(context);
|
||||||
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
|
||||||
|
|
||||||
if (intent != null) {
|
|
||||||
context.startActivity(intent);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
if (intent != null) {
|
||||||
|
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||||
|
context.startActivity(intent);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
private void startService (String action, Context context)
|
private void startService (String action, Context context)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue