diff options
-rw-r--r-- | app/src/main/AndroidManifest.xml | 13 | ||||
-rw-r--r-- | app/src/main/java/se/leap/bitmaskclient/Dashboard.java | 25 | ||||
-rw-r--r-- | app/src/main/java/se/leap/bitmaskclient/OnBootReceiver.java (renamed from src/se/leap/bitmaskclient/OnBootReceiver.java) | 0 |
3 files changed, 23 insertions, 15 deletions
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index b2366b82..0d23b069 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -22,7 +22,7 @@ <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> - + <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /> <!-- <uses-permission android:name="com.android.vending.BILLING" /> --> <uses-sdk @@ -43,7 +43,16 @@ </intent-filter> </service> <service android:name="se.leap.bitmaskclient.ProviderAPI" android:enabled="true"/> - + + <receiver + android:name="se.leap.bitmaskclient.OnBootReceiver" + android:enabled="true" + android:permission="android.permission.RECEIVE_BOOT_COMPLETED" > + <intent-filter> + <action android:name="android.intent.action.BOOT_COMPLETED" /> + </intent-filter> + </receiver> + <activity android:name="se.leap.openvpn.LaunchVPN" android:label="@string/vpn_launch_title" > diff --git a/app/src/main/java/se/leap/bitmaskclient/Dashboard.java b/app/src/main/java/se/leap/bitmaskclient/Dashboard.java index 62a68d2d..3c17ebb8 100644 --- a/app/src/main/java/se/leap/bitmaskclient/Dashboard.java +++ b/app/src/main/java/se/leap/bitmaskclient/Dashboard.java @@ -116,7 +116,7 @@ public class Dashboard extends Activity implements LogInDialog.LogInDialogInterf Intent updateEIP = new Intent(getApplicationContext(), EIP.class); updateEIP.setAction(EIP.ACTION_UPDATE_EIP_SERVICE); startService(updateEIP); - buildDashboard(); + buildDashboard(false); invalidateOptionsMenu(); if(data != null && data.hasExtra(LogInDialog.VERB)) { View view = ((ViewGroup)findViewById(android.R.id.content)).getChildAt(0); @@ -175,18 +175,17 @@ public class Dashboard extends Activity implements LogInDialog.LogInDialogInterf FragmentManager fragMan = getFragmentManager(); if ( provider.hasEIP()){ EipServiceFragment eipFragment = new EipServiceFragment(); - EipServiceFragment eipFragment = new EipServiceFragment(); - if (hide_and_turn_on_eip) { - getSharedPreferences(Dashboard.SHARED_PREFERENCES, MODE_PRIVATE).edit().remove(Dashboard.START_ON_BOOT).commit(); - Bundle arguments = new Bundle(); - arguments.putBoolean(EipServiceFragment.START_ON_BOOT, true); - eipFragment.setArguments(arguments); - } - fragMan.beginTransaction().replace(R.id.servicesCollection, eipFragment, EipServiceFragment.TAG).commit(); - - if (hide_and_turn_on_eip) { - onBackPressed(); - } + if (hide_and_turn_on_eip) { + getSharedPreferences(Dashboard.SHARED_PREFERENCES, MODE_PRIVATE).edit().remove(Dashboard.START_ON_BOOT).commit(); + Bundle arguments = new Bundle(); + arguments.putBoolean(EipServiceFragment.START_ON_BOOT, true); + eipFragment.setArguments(arguments); + } + fragMan.beginTransaction().replace(R.id.servicesCollection, eipFragment, EipServiceFragment.TAG).commit(); + + if (hide_and_turn_on_eip) { + onBackPressed(); + } } } diff --git a/src/se/leap/bitmaskclient/OnBootReceiver.java b/app/src/main/java/se/leap/bitmaskclient/OnBootReceiver.java index eb196d46..eb196d46 100644 --- a/src/se/leap/bitmaskclient/OnBootReceiver.java +++ b/app/src/main/java/se/leap/bitmaskclient/OnBootReceiver.java |