summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Jeff Sharkey <jsharkey@android.com> 2015-12-03 23:19:42 +0000
committer android-build-merger <android-build-merger@google.com> 2015-12-03 23:19:42 +0000
commitb0b78ab5874b48c18fd10e939c4f134bcae52cd9 (patch)
tree19e66a79802545cd9fe6b1393ce46b50541485db
parent9bbb90383e6d8e78ac68248ff278394b37dc9fb8 (diff)
parentf2a3c341ab9061b576ab399e1336e9e45afb8c2e (diff)
Merge "Allow customisation of advanced settings in DocumentsUI" am: f1b325c1ec
am: f2a3c341ab * commit 'f2a3c341ab9061b576ab399e1336e9e45afb8c2e': Allow customisation of advanced settings in DocumentsUI
-rw-r--r--packages/DocumentsUI/res/values/config.xml19
-rw-r--r--packages/DocumentsUI/src/com/android/documentsui/LocalPreferences.java4
2 files changed, 22 insertions, 1 deletions
diff --git a/packages/DocumentsUI/res/values/config.xml b/packages/DocumentsUI/res/values/config.xml
new file mode 100644
index 000000000000..a35c4984b72a
--- /dev/null
+++ b/packages/DocumentsUI/res/values/config.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2015 The Android Open Source 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.
+-->
+<resources>
+ <!-- Allow Advanced Devices default value to be customised -->
+ <bool name="config_defaultAdvancedDevices">false</bool>
+</resources>
diff --git a/packages/DocumentsUI/src/com/android/documentsui/LocalPreferences.java b/packages/DocumentsUI/src/com/android/documentsui/LocalPreferences.java
index e6c5ae23c4f5..113e9d7f7357 100644
--- a/packages/DocumentsUI/src/com/android/documentsui/LocalPreferences.java
+++ b/packages/DocumentsUI/src/com/android/documentsui/LocalPreferences.java
@@ -24,8 +24,10 @@ public class LocalPreferences {
private static final String KEY_FILE_SIZE = "fileSize";
public static boolean getDisplayAdvancedDevices(Context context) {
+ boolean defaultAdvanced = context.getResources()
+ .getBoolean(R.bool.config_defaultAdvancedDevices);
return PreferenceManager.getDefaultSharedPreferences(context)
- .getBoolean(KEY_ADVANCED_DEVICES, false);
+ .getBoolean(KEY_ADVANCED_DEVICES, defaultAdvanced);
}
public static boolean getDisplayFileSize(Context context) {