Merge \"Adding custom manifest shortcuts in Settings app\" into nyc-mr1-dev
am: 139fbb78b5
Change-Id: I0dbe76be67dfe27f7e0a28d6a2eeb7da97cec19a
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 6c84efc..cd061fc 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -120,6 +120,7 @@
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
+ <meta-data android:name="android.app.shortcuts" android:resource="@xml/shortcuts"/>
</activity-alias>
<activity android:name=".Settings$WirelessSettings"
diff --git a/res/drawable/ic_shortcut_battery.xml b/res/drawable/ic_shortcut_battery.xml
new file mode 100644
index 0000000..36bffa2
--- /dev/null
+++ b/res/drawable/ic_shortcut_battery.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2016 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
+ -->
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
+ <item>
+ <bitmap android:src="@drawable/shortcut_base" />
+ </item>
+ <item>
+ <inset android:inset="19.2dp">
+ <vector android:width="24.0dp"
+ android:height="24.0dp"
+ android:viewportWidth="24.0"
+ android:viewportHeight="24.0">
+ <path
+ android:fillColor="@color/icon_accent"
+ android:pathData="M15.67,4.0L14.0,4.0L14.0,2.0l-4.0,0.0l0.0,2.0L8.33,4.0C7.6,4.0 7.0,4.6 7.0,5.33l0.0,15.33C7.0,21.4 7.6,22.0 8.33,22.0l7.33,0.0c0.74,0.0 1.34,-0.6 1.34,-1.33L17.0,5.33C17.0,4.6 16.4,4.0 15.67,4.0z
+ M16,5l0,5.5l-8,0l0,-5.5l3,0l0,-2l2,0l0,2l3,0z"/>
+ </vector>
+ </inset>
+ </item>
+</layer-list>
\ No newline at end of file
diff --git a/res/drawable/ic_shortcut_data_usage.xml b/res/drawable/ic_shortcut_data_usage.xml
new file mode 100644
index 0000000..d1d4cac
--- /dev/null
+++ b/res/drawable/ic_shortcut_data_usage.xml
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2016 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
+ -->
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
+ <item>
+ <bitmap android:src="@drawable/shortcut_base" />
+ </item>
+ <item>
+ <inset android:inset="19.2dp">
+ <vector android:width="24.0dp"
+ android:height="24.0dp"
+ android:viewportWidth="24.0"
+ android:viewportHeight="24.0">
+ <path
+ android:fillColor="@color/icon_accent"
+ android:pathData="M26.0,4.1
+ l0.0,6.06
+ c6.7,0.97 12.0,6.79 12.0,13.84
+ 0.0,1.79 -0.35,3.5 -0.96,5.07
+ l5.2,3.07
+ C43.35,29.65 44.0,26.91 44.0,24.0
+ c0.0,-10.37 -7.89,-18.89 -18.0,-19.9z
+ M24.0,38.0
+ c-7.73,0.0 -14.0,-6.27 -14.0,-14.0 0.0,-7.05 5.22,-12.87 12.0,-13.84
+ l0.0,-6
+ C11.88,5.1 4.0,13.63 4.0,24.0
+ c0.0,11.05 8.94,20.0 19.99,20.0 6.62,0.0 12.47,-3.23 16.11,-8.18
+ l-5.19,-3.06
+ C32.35,35.95 28.42,38.0 24.0,38.0z"/>
+ </vector>
+ </inset>
+ </item>
+</layer-list>
\ No newline at end of file
diff --git a/res/drawable/ic_shortcut_display.xml b/res/drawable/ic_shortcut_display.xml
new file mode 100644
index 0000000..9053f5f
--- /dev/null
+++ b/res/drawable/ic_shortcut_display.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2016 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
+ -->
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
+ <item>
+ <bitmap android:src="@drawable/shortcut_base" />
+ </item>
+ <item>
+ <inset android:inset="19.2dp">
+ <vector android:width="24.0dp"
+ android:height="24.0dp"
+ android:viewportWidth="24.0"
+ android:viewportHeight="24.0">
+ <path
+ android:fillColor="@color/icon_accent"
+ android:pathData="M20.0,15.31L23.31,12.0 20.0,8.69L20.0,4.0l-4.69,0.0L12.0,0.69 8.69,4.0L4.0,4.0l0.0,4.69L0.69,12.0 4.0,15.31L4.0,20.0l4.69,0.0L12.0,23.31 15.31,20.0L20.0,20.0l0.0,-4.69zM12.0,18.0L12.0,6.0c3.31,0.0 6.0,2.69 6.0,6.0s-2.69,6.0 -6.0,6.0z"/>
+ </vector>
+ </inset>
+ </item>
+</layer-list>
\ No newline at end of file
diff --git a/res/drawable/ic_shortcut_storage.xml b/res/drawable/ic_shortcut_storage.xml
new file mode 100644
index 0000000..0729d1d
--- /dev/null
+++ b/res/drawable/ic_shortcut_storage.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2016 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
+ -->
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
+ <item>
+ <bitmap android:src="@drawable/shortcut_base" />
+ </item>
+ <item>
+ <inset android:inset="19.2dp">
+ <vector android:width="24.0dp"
+ android:height="24.0dp"
+ android:viewportWidth="24.0"
+ android:viewportHeight="24.0">
+ <path
+ android:fillColor="@color/icon_accent"
+ android:pathData="M2.0,20.0l20.0,0.0l0.0,-4.0L2.0,16.0l0.0,4.0zm2.0,-3.0l2.0,0.0l0.0,2.0L4.0,19.0l0.0,-2.0zM2.0,4.0l0.0,4.0l20.0,0.0L22.0,4.0L2.0,4.0zm4.0,3.0L4.0,7.0L4.0,5.0l2.0,0.0l0.0,2.0zm-4.0,7.0l20.0,0.0l0.0,-4.0L2.0,10.0l0.0,4.0zm2.0,-3.0l2.0,0.0l0.0,2.0L4.0,13.0l0.0,-2.0z"/>
+ </vector>
+ </inset>
+ </item>
+</layer-list>
\ No newline at end of file
diff --git a/res/drawable/ic_shortcut_wireless.xml b/res/drawable/ic_shortcut_wireless.xml
new file mode 100644
index 0000000..1c4d1d7
--- /dev/null
+++ b/res/drawable/ic_shortcut_wireless.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2016 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
+ -->
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
+ <item>
+ <bitmap android:src="@drawable/shortcut_base" />
+ </item>
+ <item>
+ <inset android:inset="19.2dp">
+ <vector android:width="24.0dp"
+ android:height="24.0dp"
+ android:viewportWidth="24.0"
+ android:viewportHeight="24.0">
+ <path
+ android:fillColor="@color/icon_accent"
+ android:pathData="M9.01,15.99l8.8,-10.96C17.47,4.77 14.08,2.0 9.0,2.0S0.53,4.7 0.19,5.03l8.8,10.96l0.02,0.0z"/>
+ </vector>
+ </inset>
+ </item>
+</layer-list>
\ No newline at end of file
diff --git a/res/xml/shortcuts.xml b/res/xml/shortcuts.xml
new file mode 100644
index 0000000..e12c935
--- /dev/null
+++ b/res/xml/shortcuts.xml
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ ~ Copyright (C) 2016 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
+ -->
+<shortcuts xmlns:android="http://schemas.android.com/apk/res/android" >
+ <shortcut
+ android:shortcutId="manifest-shortcut-wifi"
+ android:icon="@drawable/ic_shortcut_wireless"
+ android:shortcutShortLabel="@string/wifi_settings" >
+ <intent android:action="android.settings.WIFI_SETTINGS" />
+ </shortcut>
+ <shortcut
+ android:shortcutId="manifest-shortcut-data-usage"
+ android:icon="@drawable/ic_shortcut_data_usage"
+ android:shortcutShortLabel="@string/data_usage_summary_title">
+ <intent
+ android:action="android.intent.action.MAIN"
+ android:targetPackage="com.android.settings"
+ android:targetClass="com.android.settings.Settings$DataUsageSummaryActivity" />
+ </shortcut>
+ <shortcut
+ android:shortcutId="manifest-shortcut-display"
+ android:icon="@drawable/ic_shortcut_display"
+ android:shortcutShortLabel="@string/display_settings">
+ <intent android:action="com.android.settings.DISPLAY_SETTINGS" />
+ </shortcut>
+ <shortcut
+ android:shortcutId="manifest-shortcut-battery"
+ android:icon="@drawable/ic_shortcut_battery"
+ android:shortcutShortLabel="@string/power_usage_summary_title" >
+ <intent android:action="android.intent.action.POWER_USAGE_SUMMARY" />
+ </shortcut>
+ <shortcut
+ android:shortcutId="manifest-shortcut-storage"
+ android:icon="@drawable/ic_shortcut_storage"
+ android:shortcutShortLabel="@string/storage_settings" >
+ <intent android:action="android.settings.INTERNAL_STORAGE_SETTINGS" />
+ </shortcut>
+</shortcuts>
\ No newline at end of file