diff options
| author | Bruno Martins <bgcngm@gmail.com> | 2022-02-17 22:49:13 +0000 |
|---|---|---|
| committer | Bruno Martins <bgcngm@gmail.com> | 2022-02-17 23:16:59 +0000 |
| commit | dc37e143bf703a6eef06ba5d35f8ea54358844e2 (patch) | |
| tree | a3e2e6d756e05b0b83388d27ede6c965e1c046ad | |
| parent | f95fa2950639a3bc31dbac80bb2a291a0f9023c5 (diff) | |
pro1: devicesettings: Import Doze
Change-Id: I67d33d6cc839f5ae43bba17963264d46e413d462
19 files changed, 106 insertions, 177 deletions
@@ -206,10 +206,6 @@ PRODUCT_PACKAGES += \ libvulkan \ memtrack.msm8998 -# Doze -PRODUCT_PACKAGES += \ - Doze - # DRM PRODUCT_PACKAGES += \ android.hardware.drm@1.0-impl:64 \ diff --git a/devicesettings/Android.bp b/devicesettings/Android.bp index 498cada..242e3ca 100644 --- a/devicesettings/Android.bp +++ b/devicesettings/Android.bp @@ -19,4 +19,8 @@ android_app { "SettingsLib", "setupdesign", ], + + optimize: { + proguard_flags_files: ["proguard.flags"], + }, } diff --git a/devicesettings/AndroidManifest.xml b/devicesettings/AndroidManifest.xml index d419383..ff73445 100644 --- a/devicesettings/AndroidManifest.xml +++ b/devicesettings/AndroidManifest.xml @@ -17,9 +17,12 @@ <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="org.lineageos.settings.device" + android:versionCode="1" + android:versionName="1.0" android:sharedUserId="android.uid.system"> <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /> + <uses-permission android:name="android.permission.WAKE_LOCK" /> <uses-sdk android:minSdkVersion="27" @@ -52,6 +55,20 @@ </intent-filter> </receiver> + <service android:name=".doze.DozeService" + android:permission="DozeService"> + </service> + + <activity + android:name=".doze.DozeSettingsActivity" + android:label="@string/ambient_display_title" + android:theme="@style/Theme.SubSettingsBase"> + <intent-filter> + <action android:name="org.lineageos.settings.device.DOZE_SETTINGS" /> + <category android:name="android.intent.category.DEFAULT" /> + </intent-filter> + </activity> + <activity android:name=".keyboard.KeyboardSettingsActivity" android:label="@string/keyboard_settings_title"> diff --git a/doze/proguard.flags b/devicesettings/proguard.flags index f6d7a5b..f6d7a5b 100644 --- a/doze/proguard.flags +++ b/devicesettings/proguard.flags diff --git a/doze/res/drawable/ic_pickup.xml b/devicesettings/res/drawable/ic_pickup.xml index a7d5eb7..a7d5eb7 100644 --- a/doze/res/drawable/ic_pickup.xml +++ b/devicesettings/res/drawable/ic_pickup.xml diff --git a/doze/res/drawable/ic_pocket.xml b/devicesettings/res/drawable/ic_pocket.xml index 44ae6e2..44ae6e2 100644 --- a/doze/res/drawable/ic_pocket.xml +++ b/devicesettings/res/drawable/ic_pocket.xml diff --git a/doze/res/xml/doze_settings.xml b/devicesettings/res/xml/doze_settings.xml index da95bac..da95bac 100644 --- a/doze/res/xml/doze_settings.xml +++ b/devicesettings/res/xml/doze_settings.xml diff --git a/devicesettings/src/org/lineageos/settings/device/BootCompletedReceiver.java b/devicesettings/src/org/lineageos/settings/device/BootCompletedReceiver.java index 77ebcaf..e2b10bc 100644 --- a/devicesettings/src/org/lineageos/settings/device/BootCompletedReceiver.java +++ b/devicesettings/src/org/lineageos/settings/device/BootCompletedReceiver.java @@ -22,6 +22,7 @@ import android.content.Intent; import android.content.SharedPreferences; import android.preference.PreferenceManager; +import org.lineageos.settings.device.doze.DozeUtils; import org.lineageos.settings.device.keyboard.KeyboardUtils; import org.lineageos.settings.device.touchscreen.TouchscreenUtils; @@ -31,6 +32,7 @@ public class BootCompletedReceiver extends BroadcastReceiver { public void onReceive(Context context, Intent intent) { SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); + DozeUtils.checkDozeService(context); KeyboardUtils.setKeyboardKeymap(prefs); KeyboardUtils.setKeyboardPollInterval(prefs); TouchscreenUtils.setTouchscreenMargin(context); diff --git a/devicesettings/src/org/lineageos/settings/device/DeviceSettingsSearchIndexablesProvider.java b/devicesettings/src/org/lineageos/settings/device/DeviceSettingsSearchIndexablesProvider.java index 8dec9d7..b021915 100644 --- a/devicesettings/src/org/lineageos/settings/device/DeviceSettingsSearchIndexablesProvider.java +++ b/devicesettings/src/org/lineageos/settings/device/DeviceSettingsSearchIndexablesProvider.java @@ -32,16 +32,21 @@ import android.database.MatrixCursor; import android.provider.SearchIndexableResource; import android.provider.SearchIndexablesProvider; +import org.lineageos.settings.device.doze.DozeSettingsActivity; import org.lineageos.settings.device.keyboard.KeyboardSettingsActivity; import org.lineageos.settings.device.touchscreen.TouchscreenSettingsActivity; public class DeviceSettingsSearchIndexablesProvider extends SearchIndexablesProvider { private static final String TAG = "DeviceSettingsSearchIndexablesProvider"; - private static final int SEARCH_IDX_KEYBOARD_PANEL = 0; - private static final int SEARCH_IDX_TOUCHSCREEN_PANEL = 1; + private static final int SEARCH_IDX_DOZE_SETTINGS = 0; + private static final int SEARCH_IDX_KEYBOARD_PANEL = 1; + private static final int SEARCH_IDX_TOUCHSCREEN_PANEL = 2; private static SearchIndexableResource[] INDEXABLE_RES = new SearchIndexableResource[]{ + new SearchIndexableResource(1, R.xml.doze_settings, + DozeSettingsActivity.class.getName(), + R.drawable.ic_settings_dummy), new SearchIndexableResource(1, R.xml.keyboard_panel, KeyboardSettingsActivity.class.getName(), R.drawable.ic_settings_dummy), @@ -58,6 +63,7 @@ public class DeviceSettingsSearchIndexablesProvider extends SearchIndexablesProv @Override public Cursor queryXmlResources(String[] projection) { MatrixCursor cursor = new MatrixCursor(INDEXABLES_XML_RES_COLUMNS); + cursor.addRow(generateResourceRef(INDEXABLE_RES[SEARCH_IDX_DOZE_SETTINGS])); cursor.addRow(generateResourceRef(INDEXABLE_RES[SEARCH_IDX_KEYBOARD_PANEL])); cursor.addRow(generateResourceRef(INDEXABLE_RES[SEARCH_IDX_TOUCHSCREEN_PANEL])); return cursor; diff --git a/devicesettings/src/org/lineageos/settings/device/doze/Constants.java b/devicesettings/src/org/lineageos/settings/device/doze/Constants.java new file mode 100644 index 0000000..13d3850 --- /dev/null +++ b/devicesettings/src/org/lineageos/settings/device/doze/Constants.java @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2022 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.settings.device.doze; + +public final class Constants { + public static final String DOZE_INTENT = "com.android.systemui.doze.pulse"; + + public static final String DOZE_ENABLE = "doze_enable"; + + public static final String ALWAYS_ON_DISPLAY = "always_on_display"; + + public static final String CATEGORY_TILT_SENSOR = "tilt_sensor"; + public static final String CATEGORY_PROX_SENSOR = "proximity_sensor"; + + public static final String GESTURE_PICK_UP_KEY = "gesture_pick_up"; + public static final String GESTURE_POCKET_KEY = "gesture_pocket"; +} diff --git a/doze/src/org/lineageos/settings/doze/DozeService.java b/devicesettings/src/org/lineageos/settings/device/doze/DozeService.java index 7f92915..588bbbd 100644 --- a/doze/src/org/lineageos/settings/doze/DozeService.java +++ b/devicesettings/src/org/lineageos/settings/device/doze/DozeService.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015 The CyanogenMod Project - * 2017-2018 The LineageOS Project + * 2017-2018,2022 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. @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.lineageos.settings.doze; +package org.lineageos.settings.device.doze; import android.app.Service; import android.content.BroadcastReceiver; @@ -65,20 +65,20 @@ public class DozeService extends Service { private void onDisplayOn() { if (DEBUG) Log.d(TAG, "Display on"); - if (Utils.isPickUpEnabled(this)) { + if (DozeUtils.isPickUpEnabled(this)) { mTiltSensor.disable(); } - if (Utils.isPocketGestureEnabled(this)) { + if (DozeUtils.isPocketGestureEnabled(this)) { mProximitySensor.disable(); } } private void onDisplayOff() { if (DEBUG) Log.d(TAG, "Display off"); - if (Utils.isPickUpEnabled(this)) { + if (DozeUtils.isPickUpEnabled(this)) { mTiltSensor.enable(); } - if (Utils.isPocketGestureEnabled(this)) { + if (DozeUtils.isPocketGestureEnabled(this)) { mProximitySensor.enable(); } } diff --git a/doze/src/org/lineageos/settings/doze/DozeSettingsActivity.java b/devicesettings/src/org/lineageos/settings/device/doze/DozeSettingsActivity.java index 213f0b4..95b189e 100644 --- a/doze/src/org/lineageos/settings/doze/DozeSettingsActivity.java +++ b/devicesettings/src/org/lineageos/settings/device/doze/DozeSettingsActivity.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015-2016 The CyanogenMod Project - * 2017,2021 The LineageOS Project + * 2017,2021-2022 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. @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.lineageos.settings.doze; +package org.lineageos.settings.device.doze; import android.os.Bundle; diff --git a/doze/src/org/lineageos/settings/doze/DozeSettingsFragment.java b/devicesettings/src/org/lineageos/settings/device/doze/DozeSettingsFragment.java index 954ae28..5ba6b92 100644 --- a/doze/src/org/lineageos/settings/doze/DozeSettingsFragment.java +++ b/devicesettings/src/org/lineageos/settings/device/doze/DozeSettingsFragment.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015 The CyanogenMod Project - * 2017-2019,2021 The LineageOS Project + * 2017-2019,2021-2022 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. @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.lineageos.settings.doze; +package org.lineageos.settings.device.doze; import android.app.Activity; import android.app.AlertDialog; @@ -36,6 +36,8 @@ import androidx.preference.SwitchPreference; import com.android.settingslib.widget.MainSwitchPreference; import com.android.settingslib.widget.OnMainSwitchChangeListener; +import org.lineageos.settings.device.R; + public class DozeSettingsFragment extends PreferenceFragment implements OnMainSwitchChangeListener, Preference.OnPreferenceChangeListener { @@ -58,64 +60,64 @@ public class DozeSettingsFragment extends PreferenceFragment showHelp(); } - boolean dozeEnabled = Utils.isDozeEnabled(getActivity()); + boolean dozeEnabled = DozeUtils.isDozeEnabled(getActivity()); - mSwitchBar = (MainSwitchPreference) findPreference(Utils.DOZE_ENABLE); + mSwitchBar = findPreference(Constants.DOZE_ENABLE); mSwitchBar.addOnSwitchChangeListener(this); mSwitchBar.setChecked(dozeEnabled); - mAlwaysOnDisplayPreference = (SwitchPreference) findPreference(Utils.ALWAYS_ON_DISPLAY); + mAlwaysOnDisplayPreference = findPreference(Constants.ALWAYS_ON_DISPLAY); mAlwaysOnDisplayPreference.setEnabled(dozeEnabled); - mAlwaysOnDisplayPreference.setChecked(Utils.isAlwaysOnEnabled(getActivity())); + mAlwaysOnDisplayPreference.setChecked(DozeUtils.isAlwaysOnEnabled(getActivity())); mAlwaysOnDisplayPreference.setOnPreferenceChangeListener(this); PreferenceCategory tiltSensorCategory = - (PreferenceCategory) getPreferenceScreen().findPreference(Utils.CATEG_TILT_SENSOR); + getPreferenceScreen().findPreference(Constants.CATEGORY_TILT_SENSOR); PreferenceCategory proximitySensorCategory = - (PreferenceCategory) getPreferenceScreen().findPreference(Utils.CATEG_PROX_SENSOR); + getPreferenceScreen().findPreference(Constants.CATEGORY_PROX_SENSOR); - mPickUpPreference = (SwitchPreference) findPreference(Utils.GESTURE_PICK_UP_KEY); + mPickUpPreference = findPreference(Constants.GESTURE_PICK_UP_KEY); mPickUpPreference.setEnabled(dozeEnabled); mPickUpPreference.setOnPreferenceChangeListener(this); - mPocketPreference = (SwitchPreference) findPreference(Utils.GESTURE_POCKET_KEY); + mPocketPreference = findPreference(Constants.GESTURE_POCKET_KEY); mPocketPreference.setEnabled(dozeEnabled); mPocketPreference.setOnPreferenceChangeListener(this); // Hide proximity sensor related features if the device doesn't support them - if (!Utils.getProxCheckBeforePulse(getActivity())) { + if (!DozeUtils.getProxCheckBeforePulse(getActivity())) { getPreferenceScreen().removePreference(proximitySensorCategory); } // Hide AOD if not supported and set all its dependents otherwise - if (!Utils.alwaysOnDisplayAvailable(getActivity())) { + if (!DozeUtils.alwaysOnDisplayAvailable(getActivity())) { getPreferenceScreen().removePreference(mAlwaysOnDisplayPreference); } else { - tiltSensorCategory.setDependency(Utils.ALWAYS_ON_DISPLAY); - proximitySensorCategory.setDependency(Utils.ALWAYS_ON_DISPLAY); + tiltSensorCategory.setDependency(Constants.ALWAYS_ON_DISPLAY); + proximitySensorCategory.setDependency(Constants.ALWAYS_ON_DISPLAY); } } @Override public boolean onPreferenceChange(Preference preference, Object newValue) { - if (Utils.ALWAYS_ON_DISPLAY.equals(preference.getKey())) { - Utils.enableAlwaysOn(getActivity(), (Boolean) newValue); + if (Constants.ALWAYS_ON_DISPLAY.equals(preference.getKey())) { + DozeUtils.enableAlwaysOn(getActivity(), (Boolean) newValue); } - mHandler.post(() -> Utils.checkDozeService(getActivity())); + mHandler.post(() -> DozeUtils.checkDozeService(getActivity())); return true; } @Override public void onSwitchChanged(Switch switchView, boolean isChecked) { - Utils.enableDoze(getActivity(), isChecked); - Utils.checkDozeService(getActivity()); + DozeUtils.enableDoze(getActivity(), isChecked); + DozeUtils.checkDozeService(getActivity()); mSwitchBar.setChecked(isChecked); if (!isChecked) { - Utils.enableAlwaysOn(getActivity(), false); + DozeUtils.enableAlwaysOn(getActivity(), false); mAlwaysOnDisplayPreference.setChecked(false); } mAlwaysOnDisplayPreference.setEnabled(isChecked); @@ -124,7 +126,7 @@ public class DozeSettingsFragment extends PreferenceFragment mPocketPreference.setEnabled(isChecked); } - private static class HelpDialogFragment extends DialogFragment { + public static class HelpDialogFragment extends DialogFragment { @Override public Dialog onCreateDialog(Bundle savedInstanceState) { return new AlertDialog.Builder(getActivity()) diff --git a/doze/src/org/lineageos/settings/doze/Utils.java b/devicesettings/src/org/lineageos/settings/device/doze/DozeUtils.java index 7bb66ea..9baab31 100644 --- a/doze/src/org/lineageos/settings/doze/Utils.java +++ b/devicesettings/src/org/lineageos/settings/device/doze/DozeUtils.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2015 The CyanogenMod Project - * 2017-2019,2021 The LineageOS Project + * 2017-2019,2021-2022 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. @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.lineageos.settings.doze; +package org.lineageos.settings.device.doze; import android.content.Context; import android.content.Intent; @@ -30,23 +30,11 @@ import androidx.preference.PreferenceManager; import static android.provider.Settings.Secure.DOZE_ALWAYS_ON; import static android.provider.Settings.Secure.DOZE_ENABLED; -public final class Utils { +public final class DozeUtils { private static final String TAG = "DozeUtils"; private static final boolean DEBUG = false; - private static final String DOZE_INTENT = "com.android.systemui.doze.pulse"; - - protected static final String DOZE_ENABLE = "doze_enable"; - - protected static final String ALWAYS_ON_DISPLAY = "always_on_display"; - - protected static final String CATEG_TILT_SENSOR = "tilt_sensor"; - protected static final String CATEG_PROX_SENSOR = "proximity_sensor"; - - protected static final String GESTURE_PICK_UP_KEY = "gesture_pick_up"; - protected static final String GESTURE_POCKET_KEY = "gesture_pocket"; - protected static void startService(Context context) { if (DEBUG) Log.d(TAG, "Starting service"); context.startServiceAsUser(new Intent(context, DozeService.class), @@ -90,7 +78,7 @@ public final class Utils { protected static void launchDozePulse(Context context) { if (DEBUG) Log.d(TAG, "Launch doze pulse"); - context.sendBroadcastAsUser(new Intent(DOZE_INTENT), + context.sendBroadcastAsUser(new Intent(Constants.DOZE_INTENT), new UserHandle(UserHandle.USER_CURRENT)); } @@ -118,11 +106,11 @@ public final class Utils { } protected static boolean isPickUpEnabled(Context context) { - return isGestureEnabled(context, GESTURE_PICK_UP_KEY); + return isGestureEnabled(context, Constants.GESTURE_PICK_UP_KEY); } protected static boolean isPocketGestureEnabled(Context context) { - return isGestureEnabled(context, GESTURE_POCKET_KEY); + return isGestureEnabled(context, Constants.GESTURE_POCKET_KEY); } protected static boolean sensorsEnabled(Context context) { diff --git a/doze/src/org/lineageos/settings/doze/ProximitySensor.java b/devicesettings/src/org/lineageos/settings/device/doze/ProximitySensor.java index 50f2fd5..973be5c 100644 --- a/doze/src/org/lineageos/settings/doze/ProximitySensor.java +++ b/devicesettings/src/org/lineageos/settings/device/doze/ProximitySensor.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2015 The CyanogenMod Project - * 2017-2018 The LineageOS Project + * 2017-2018,2022 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. @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.lineageos.settings.doze; +package org.lineageos.settings.device.doze; import android.content.Context; import android.hardware.Sensor; @@ -60,7 +60,7 @@ public class ProximitySensor implements SensorEventListener { boolean isNear = event.values[0] < mSensor.getMaximumRange(); if (mSawNear && !isNear) { if (shouldPulse(event.timestamp)) { - Utils.launchDozePulse(mContext); + DozeUtils.launchDozePulse(mContext); } } else { mInPocketTime = event.timestamp; @@ -71,7 +71,7 @@ public class ProximitySensor implements SensorEventListener { private boolean shouldPulse(long timestamp) { long delta = timestamp - mInPocketTime; - if (Utils.isPocketGestureEnabled(mContext)) { + if (DozeUtils.isPocketGestureEnabled(mContext)) { return delta >= POCKET_MIN_DELTA_NS; } return false; diff --git a/doze/src/org/lineageos/settings/doze/TiltSensor.java b/devicesettings/src/org/lineageos/settings/device/doze/TiltSensor.java index 6598127..605e027 100644 --- a/doze/src/org/lineageos/settings/doze/TiltSensor.java +++ b/devicesettings/src/org/lineageos/settings/device/doze/TiltSensor.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2015 The CyanogenMod Project - * 2017-2018 The LineageOS Project + * 2017-2018,2022 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. @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.lineageos.settings.doze; +package org.lineageos.settings.device.doze; import android.content.Context; import android.hardware.Sensor; @@ -67,7 +67,7 @@ public class TiltSensor implements SensorEventListener { } if (event.values[0] == 1) { - Utils.launchDozePulse(mContext); + DozeUtils.launchDozePulse(mContext); } } diff --git a/doze/Android.bp b/doze/Android.bp deleted file mode 100644 index b6b59ad..0000000 --- a/doze/Android.bp +++ /dev/null @@ -1,23 +0,0 @@ -// -// Copyright (C) 2017-2021 The LineageOS Project -// -// SPDX-License-Identifier: Apache-2.0 -// - -android_app { - name: "Doze", - - srcs: ["src/**/*.java"], - resource_dirs: ["res"], - certificate: "platform", - platform_apis: true, - privileged: true, - - static_libs: [ - "org.lineageos.settings.resources", - ], - - optimize: { - proguard_flags_files: ["proguard.flags"], - }, -} diff --git a/doze/AndroidManifest.xml b/doze/AndroidManifest.xml deleted file mode 100644 index f880f70..0000000 --- a/doze/AndroidManifest.xml +++ /dev/null @@ -1,59 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - Copyright (C) 2015-2016 The CyanogenMod Project - 2017 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. ---> -<manifest xmlns:android="http://schemas.android.com/apk/res/android" - package="org.lineageos.settings.doze" - android:versionCode="1" - android:versionName="1.0" - android:sharedUserId="android.uid.system"> - - <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/> - <uses-permission android:name="android.permission.WAKE_LOCK" /> - - <protected-broadcast android:name="com.android.systemui.doze.pulse" /> - - <uses-sdk - android:minSdkVersion="24" - android:targetSdkVersion="24"/> - - <application - android:label="@string/device_settings_app_name" - android:persistent="true"> - - <receiver android:name=".BootCompletedReceiver"> - <intent-filter> - <action android:name="android.intent.action.BOOT_COMPLETED" /> - <category android:name="android.intent.category.DEFAULT" /> - </intent-filter> - </receiver> - - <service android:name=".DozeService" - android:permission="DozeService"> - </service> - - <activity - android:name=".DozeSettingsActivity" - android:label="@string/ambient_display_title" - android:theme="@style/Theme.SubSettingsBase"> - <intent-filter> - <action android:name="org.lineageos.settings.device.DOZE_SETTINGS" /> - <category android:name="android.intent.category.DEFAULT" /> - </intent-filter> - </activity> - - </application> -</manifest> diff --git a/doze/src/org/lineageos/settings/doze/BootCompletedReceiver.java b/doze/src/org/lineageos/settings/doze/BootCompletedReceiver.java deleted file mode 100644 index ac9a913..0000000 --- a/doze/src/org/lineageos/settings/doze/BootCompletedReceiver.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (C) 2015 The CyanogenMod Project - * 2017-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.settings.doze; - -import android.content.BroadcastReceiver; -import android.content.Context; -import android.content.Intent; -import android.util.Log; - -public class BootCompletedReceiver extends BroadcastReceiver { - - private static final boolean DEBUG = false; - private static final String TAG = "Doze"; - - @Override - public void onReceive(final Context context, Intent intent) { - if (DEBUG) Log.d(TAG, "Received boot completed intent"); - Utils.checkDozeService(context); - } -} |
