From 70bcf38e2cf27cfcd920ebf17500fa97478dc0d0 Mon Sep 17 00:00:00 2001 From: Felipe Leme Date: Thu, 24 Jan 2019 14:55:03 -0800 Subject: Moved Content Capture settings to DeviceConfig. To test, manually played with 'adb shell device_config'. Examples: $ adb shell device_config list content_capture $ adb shell device_config delete content_capture enable_contentcapture $ adb shell stop && adb shell start $ adb shell service check content_capture Service content_capture: not found $ adb shell device_config put content_capture enable_contentcapture always $ adb shell stop && adb shell start $ adb shell service check content_capture Service content_capture: found Then ran CTS and FrameworkCoreTests below... Test: atest CtsContentCaptureServiceTestCases \ FrameworksCoreTests:android.provider.SettingsBackupTest#secureSettingsBackedUpOrBlacklisted Test: m update-api Bug: 121037717 Bug: 121153631 Change-Id: Ib93bf8181253228ccbdb3edbd84c5d0431c84eb4 --- services/java/com/android/server/SystemServer.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'services/java') diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.java index 586136802619..80552d88a49d 100644 --- a/services/java/com/android/server/SystemServer.java +++ b/services/java/com/android/server/SystemServer.java @@ -55,6 +55,7 @@ import android.os.SystemProperties; import android.os.Trace; import android.os.UserHandle; import android.os.storage.IStorageManager; +import android.provider.DeviceConfig; import android.provider.Settings; import android.sysprop.VoldProperties; import android.text.TextUtils; @@ -2212,10 +2213,9 @@ public final class SystemServer { } private void startContentCaptureService(@NonNull Context context) { - - // Check if it was explicitly enabled by Settings - final String settings = Settings.Global.getString(context.getContentResolver(), - Settings.Global.CONTENT_CAPTURE_SERVICE_EXPLICITLY_ENABLED); + // Check if it was explicitly enabled by DeviceConfig + final String settings = DeviceConfig.getProperty(DeviceConfig.ContentCapture.NAMESPACE, + DeviceConfig.ContentCapture.PROPERTY_CONTENTCAPTURE_ENABLED); if (settings == null) { // Better be safe than sorry... Slog.d(TAG, "ContentCaptureService disabled because its not set by OEM"); @@ -2224,7 +2224,7 @@ public final class SystemServer { switch (settings) { case "always": // Should be used only during development - Slog.d(TAG, "ContentCaptureService explicitly enabled by Settings"); + Slog.d(TAG, "ContentCaptureService explicitly enabled by DeviceConfig"); break; case "default": // Default case: check if OEM overlaid the resource that defines the service. -- cgit v1.2.3-59-g8ed1b