OSDN Git Service

Conditionally remove Dock settings shortcut and Power control widget.
authorAmith Yamasani <yamasani@google.com>
Fri, 7 Jan 2011 20:52:21 +0000 (12:52 -0800)
committerAmith Yamasani <yamasani@google.com>
Sun, 9 Jan 2011 20:03:45 +0000 (12:03 -0800)
Bug: 3258028
Bug: 3248740

Change-Id: Id37787cc9562cde13048e8dfba957599219d94b5

AndroidManifest.xml
res/values-xlarge/bools.xml [new file with mode: 0644]
res/values/bools.xml

index 91353bc..a94258e 100644 (file)
         <activity android:name="Settings$DockSettingsActivity"
                 android:theme="@android:style/Theme.Holo"
                 android:label="@string/dock_settings_title"
-                android:clearTaskOnLaunch="true">
+                android:clearTaskOnLaunch="true"
+                android:enabled="@bool/has_dock_settings">
             <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
                 <action android:name="com.android.settings.DOCK_SETTINGS" />
         <activity android:name="AppWidgetPickActivity"
                 android:label="@string/widget_picker_title"
                 android:theme="@*android:style/Theme.Dialog.Alert"
-                android:finishOnCloseSystemDialogs="true">
+                android:finishOnCloseSystemDialogs="true"
+                android:enabled="@bool/has_powercontrol_widget">
             <intent-filter>
                 <action android:name="android.appwidget.action.APPWIDGET_PICK" />
                 <category android:name="android.intent.category.DEFAULT" />
             android:theme="@android:style/Theme.Holo.DialogWhenLarge"/>
 
         <receiver android:name=".widget.SettingsAppWidgetProvider"
-                android:label="@string/gadget_title" android:exported="false">
+                android:label="@string/gadget_title" android:exported="false"
+                android:enabled="@bool/has_powercontrol_widget">
             <intent-filter>
                 <action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
                 <action android:name="android.net.wifi.WIFI_STATE_CHANGED" />
diff --git a/res/values-xlarge/bools.xml b/res/values-xlarge/bools.xml
new file mode 100644 (file)
index 0000000..55f496a
--- /dev/null
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2010 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>
+    <!-- Whether or not the Power Control widget is enabled -->
+    <bool name="has_powercontrol_widget">false</bool>
+</resources>
index 61cc79e..235e2bb 100644 (file)
@@ -20,4 +20,6 @@
     <bool name="has_intrusive_led">false</bool>
     <!-- Whether or not the dock settings are to be displayed for this device when docked -->
     <bool name="has_dock_settings">false</bool>
+    <!-- Whether or not the Power Control widget is enabled -->
+    <bool name="has_powercontrol_widget">true</bool>
 </resources>