Conditionally remove Dock settings shortcut and Power control widget.

Bug: 3258028
Bug: 3248740

Change-Id: Id37787cc9562cde13048e8dfba957599219d94b5
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 91353bc..a94258e 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -452,7 +452,8 @@
         <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" />
@@ -988,7 +989,8 @@
         <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" />
@@ -1065,7 +1067,8 @@
             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" />