From 582cbf066b7c47eecef759ca0755649a6bc0e39e Mon Sep 17 00:00:00 2001 From: Marius Gavrilescu Date: Fri, 26 Jul 2013 18:44:31 +0300 Subject: [PATCH] Add BOOT notification --- AndroidManifest.xml | 2 ++ res/values/strings.xml | 1 + src/ro/ieval/fonbot/ProtectedBroadcastReceiver.java | 3 +++ src/ro/ieval/fonbot/Utils.java | 4 +++- 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 57db97c..ac938be 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -37,6 +37,7 @@ + @@ -187,6 +188,7 @@ + diff --git a/res/values/strings.xml b/res/values/strings.xml index 59d92a5..2351589 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -463,4 +463,5 @@ The help command can be used to get a list of commands and help for them. Exampl Example: torch Toggling torch state… + Your device has been turned on diff --git a/src/ro/ieval/fonbot/ProtectedBroadcastReceiver.java b/src/ro/ieval/fonbot/ProtectedBroadcastReceiver.java index 6cfe312..17f99f0 100644 --- a/src/ro/ieval/fonbot/ProtectedBroadcastReceiver.java +++ b/src/ro/ieval/fonbot/ProtectedBroadcastReceiver.java @@ -51,6 +51,9 @@ public final class ProtectedBroadcastReceiver extends BroadcastReceiver { Utils.sendMessage(context, toNonNull(MessageType.BATTERY), toNonNull(context.getString(battery_okay))); Heavy.describeBatteryLevel(context, null, toNonNull(MessageType.BATTERY)); + } else if(action.equals(Intent.ACTION_BOOT_COMPLETED)){ + Utils.sendMessage(context, toNonNull(MessageType.BOOT), + toNonNull(context.getString(device_booted))); } } diff --git a/src/ro/ieval/fonbot/Utils.java b/src/ro/ieval/fonbot/Utils.java index 0c309b0..79ff2e1 100644 --- a/src/ro/ieval/fonbot/Utils.java +++ b/src/ro/ieval/fonbot/Utils.java @@ -110,7 +110,9 @@ public final class Utils { /** Fine battery status notifications */ BATTERY_CHANGED, /** Headset plug/unplug notifications */ - HEADSET + HEADSET, + /** Phone booted notifications */ + BOOT, } /** -- 2.39.2