From d6af174b1db2066e51456d20c58827c7fdc37c10 Mon Sep 17 00:00:00 2001 From: LuK1337 Date: Sun, 7 Jul 2019 11:07:27 +0200 Subject: msm8996-common: Use android.intent.action.BOOT_COMPLETED where possible * Ensure that the startup of PocketMode still takes place before ConfigPanel. Change-Id: I2436a38bddccb908acf94d916d0220918e8b6a0c --- .../pocketmode/BootCompletedReceiver.java | 36 ++++++++++++++++++++ .../src/org/lineageos/pocketmode/Startup.java | 39 ---------------------- 2 files changed, 36 insertions(+), 39 deletions(-) create mode 100644 pocketmode/src/org/lineageos/pocketmode/BootCompletedReceiver.java delete mode 100644 pocketmode/src/org/lineageos/pocketmode/Startup.java (limited to 'pocketmode/src') diff --git a/pocketmode/src/org/lineageos/pocketmode/BootCompletedReceiver.java b/pocketmode/src/org/lineageos/pocketmode/BootCompletedReceiver.java new file mode 100644 index 0000000..97b481f --- /dev/null +++ b/pocketmode/src/org/lineageos/pocketmode/BootCompletedReceiver.java @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2016 The CyanogenMod Project + * 2018-2019 The LineageOS Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.lineageos.pocketmode; + +import android.content.BroadcastReceiver; +import android.content.Context; +import android.content.Intent; +import android.os.UserHandle; +import android.util.Log; + +public class BootCompletedReceiver extends BroadcastReceiver { + + private static final String TAG = "ZukPocketMode"; + + @Override + public void onReceive(Context context, Intent intent) { + Log.d(TAG, "Starting"); + context.startServiceAsUser(new Intent(context, PocketModeService.class), + UserHandle.CURRENT); + } +} diff --git a/pocketmode/src/org/lineageos/pocketmode/Startup.java b/pocketmode/src/org/lineageos/pocketmode/Startup.java deleted file mode 100644 index 39b3371..0000000 --- a/pocketmode/src/org/lineageos/pocketmode/Startup.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2016 The CyanogenMod Project - * 2018-2019 The LineageOS Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.lineageos.pocketmode; - -import android.content.BroadcastReceiver; -import android.content.Context; -import android.content.Intent; -import android.os.UserHandle; -import android.util.Log; - -public class Startup extends BroadcastReceiver { - - private static final String TAG = "ZukPocketMode"; - - @Override - public void onReceive(Context context, Intent intent) { - final String action = intent.getAction(); - if (lineageos.content.Intent.ACTION_INITIALIZE_LINEAGE_HARDWARE.equals(action)) { - Log.d(TAG, "Starting"); - context.startServiceAsUser(new Intent(context, PocketModeService.class), - UserHandle.CURRENT); - } - } -} -- cgit v1.2.3