From 773190f57d707264586f8e19fbe22ef284dd4e1e Mon Sep 17 00:00:00 2001 From: Samuel Holland Date: Sun, 30 Jul 2017 02:01:38 -0500 Subject: ProfileService: Add a listener to start it on boot This will allow automatically starting profiles on boot. Signed-off-by: Jason A. Donenfeld --- app/src/main/AndroidManifest.xml | 11 ++++++++++- .../java/com/wireguard/android/BootCompletedReceiver.java | 14 ++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 app/src/main/java/com/wireguard/android/BootCompletedReceiver.java (limited to 'app/src') diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 02a8b7fa..2c02aa95 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,6 +1,9 @@ + package="com.wireguard.android" + android:installLocation="internalOnly"> + + + + + + + + diff --git a/app/src/main/java/com/wireguard/android/BootCompletedReceiver.java b/app/src/main/java/com/wireguard/android/BootCompletedReceiver.java new file mode 100644 index 00000000..9f7e3dc2 --- /dev/null +++ b/app/src/main/java/com/wireguard/android/BootCompletedReceiver.java @@ -0,0 +1,14 @@ +package com.wireguard.android; + +import android.content.BroadcastReceiver; +import android.content.Context; +import android.content.Intent; + +public class BootCompletedReceiver extends BroadcastReceiver { + + @Override + public void onReceive(Context context, Intent intent) { + Intent startServiceIntent = new Intent(context, ProfileService.class); + context.startService(startServiceIntent); + } +} -- cgit v1.2.3