diff options
author | Adnan Begovic <adnan@cyngn.com> | 2015-12-03 16:56:41 -0800 |
---|---|---|
committer | Adnan Begovic <adnan@cyngn.com> | 2015-12-03 17:11:24 -0800 |
commit | 144146eb1773ec8fe6e21b413e74a23f20e33685 (patch) | |
tree | 37ce9e14e07086cf30cae999b9ec4d1a9b929117 /packages/CMSettingsProvider | |
parent | ad00d5bb14ee44c8e8c3da982f5751d45d223ed4 (diff) | |
download | vendor_cmsdk-144146eb1773ec8fe6e21b413e74a23f20e33685.zip vendor_cmsdk-144146eb1773ec8fe6e21b413e74a23f20e33685.tar.gz vendor_cmsdk-144146eb1773ec8fe6e21b413e74a23f20e33685.tar.bz2 |
CMSettingsProvider: Only enable component if already disabled.
Each CALL method would renable and already enabled component,
cut down on log spam.
Change-Id: Ie58c75e32c828b1ce8b1017620b5a3b073830bbd
Diffstat (limited to 'packages/CMSettingsProvider')
-rw-r--r-- | packages/CMSettingsProvider/src/org/cyanogenmod/cmsettings/CMSettingsProvider.java | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/packages/CMSettingsProvider/src/org/cyanogenmod/cmsettings/CMSettingsProvider.java b/packages/CMSettingsProvider/src/org/cyanogenmod/cmsettings/CMSettingsProvider.java index 4da7d6c..5c837bd 100644 --- a/packages/CMSettingsProvider/src/org/cyanogenmod/cmsettings/CMSettingsProvider.java +++ b/packages/CMSettingsProvider/src/org/cyanogenmod/cmsettings/CMSettingsProvider.java @@ -265,13 +265,16 @@ public class CMSettingsProvider extends ContentProvider { boolean hasMigratedCMSettings = mSharedPrefs.getBoolean(PREF_HAS_MIGRATED_CM_SETTINGS, false); - if (!hasMigratedCMSettings) { + final ComponentName preBootReceiver = new ComponentName("org.cyanogenmod.cmsettings", + "org.cyanogenmod.cmsettings.PreBootReceiver"); + final PackageManager packageManager = getContext().getPackageManager(); + if (!hasMigratedCMSettings && + packageManager.getComponentEnabledSetting(preBootReceiver) + == PackageManager.COMPONENT_ENABLED_STATE_DISABLED ) { if (LOCAL_LOGV) { Log.d(TAG, "Reenabling component preboot receiver"); } - getContext().getPackageManager().setComponentEnabledSetting( - new ComponentName("org.cyanogenmod.cmsettings", - "org.cyanogenmod.cmsettings.PreBootReceiver"), + packageManager.setComponentEnabledSetting(preBootReceiver, PackageManager.COMPONENT_ENABLED_STATE_ENABLED, PackageManager.DONT_KILL_APP); } |