From d85c13c0836c61150891210db45b4ca1ea5cff79 Mon Sep 17 00:00:00 2001 From: Bruno Martins Date: Thu, 17 Dec 2020 19:31:36 +0000 Subject: msm8996-common: Check if PocketMode is enabled rather than installed This is more effective, because the package may still be installed and at the same time disabled by the user. Change-Id: I95ccf5c4cdb05bac6cd91b96d7da6461dc8f6c44 --- .../src/org/lineageos/settings/device/ButtonSettingsFragment.java | 4 ++-- .../settings/device/ConfigPanelSearchIndexablesProvider.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/configpanel/src/org/lineageos/settings/device/ButtonSettingsFragment.java b/configpanel/src/org/lineageos/settings/device/ButtonSettingsFragment.java index cee52c5..d23e939 100644 --- a/configpanel/src/org/lineageos/settings/device/ButtonSettingsFragment.java +++ b/configpanel/src/org/lineageos/settings/device/ButtonSettingsFragment.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2016 The CyanogenMod Project - * (C) 2017 The LineageOS Project + * (C) 2017,2020-2021 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. @@ -110,7 +110,7 @@ public class ButtonSettingsFragment extends PreferenceFragment (PreferenceCategory) getPreferenceScreen().findPreference(Constants.CATEGORY_FP); SwitchPreference b = (SwitchPreference) findPreference(Constants.FP_POCKETMODE_KEY); - if (!PackageManagerUtils.isAppInstalled(getContext(), "org.lineageos.pocketmode")) { + if (!PackageManagerUtils.isAppEnabled(getContext(), "org.lineageos.pocketmode")) { fingerprintCategory.removePreference(b); } else { b.setOnPreferenceChangeListener(this); diff --git a/configpanel/src/org/lineageos/settings/device/ConfigPanelSearchIndexablesProvider.java b/configpanel/src/org/lineageos/settings/device/ConfigPanelSearchIndexablesProvider.java index ebb9557..24539e6 100644 --- a/configpanel/src/org/lineageos/settings/device/ConfigPanelSearchIndexablesProvider.java +++ b/configpanel/src/org/lineageos/settings/device/ConfigPanelSearchIndexablesProvider.java @@ -1,6 +1,6 @@ /* * Copyright (C) 2016 The CyanogenMod Project - * (C) 2017-2018 The LineageOS Project + * (C) 2017-2018,2020 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. @@ -80,7 +80,7 @@ public class ConfigPanelSearchIndexablesProvider extends SearchIndexablesProvide private List getNonIndexableKeys(Context context) { List keys = new ArrayList<>(); - if (!PackageManagerUtils.isAppInstalled(context, "org.lineageos.pocketmode")) { + if (!PackageManagerUtils.isAppEnabled(context, "org.lineageos.pocketmode")) { keys.add(Constants.FP_POCKETMODE_KEY); } keys.add(Constants.FP_WAKEUP_KEY); -- cgit v1.2.3