Snap for 9066247 from bb05572061 to udc-release

Change-Id: I737117576bcbee3384f0b75d1a6109dd526f6a48
This commit is contained in:
Android Build Coastguard Worker
2022-09-15 02:58:13 +00:00
86 changed files with 359 additions and 3989 deletions

View File

@@ -2911,15 +2911,6 @@
</intent-filter>
</activity>
<activity android:name="UsageStatsActivity"
android:exported="true"
android:label="@string/usage_stats_label">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEVELOPMENT_PREFERENCE" />
</intent-filter>
</activity>
<activity
android:name="Settings$PowerUsageSummaryActivity"
android:label="@string/power_usage_summary_title"
@@ -4584,8 +4575,23 @@
</intent-filter>
</activity>
<activity android:name=".spa.SpaActivity" android:exported="false"/>
<activity android:name=".spa.SpaBridgeActivity" android:exported="false"/>
<activity-alias android:name="UsageStatsActivity"
android:exported="true"
android:label="@string/testing_usage_stats"
android:targetActivity=".spa.SpaBridgeActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEVELOPMENT_PREFERENCE" />
</intent-filter>
<meta-data android:name="com.android.settings.spa.DESTINATION"
android:value="UsageStats"/>
</activity-alias>
<activity
android:name="com.android.settings.spa.SpaActivity"
android:name="com.android.settings.spa.SpaDebugActivity"
android:exported="false">
</activity>

View File

@@ -3117,22 +3117,6 @@
column="13"/>
</issue>
<issue
id="HardCodedColor"
severity="Error"
message="Avoid using hardcoded color"
category="Correctness"
priority="4"
summary="Using hardcoded color"
explanation="Hardcoded color values are bad because theme changes cannot be uniformly applied.Instead use the theme specific colors such as `?android:attr/textColorPrimary` in attributes.&#xA;This ensures that a theme change from a light to a dark theme can be uniformlyapplied across the app."
errorLine1=" android:color=&quot;@color/accessibility_feature_background&quot;/>"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="res/drawable/ic_screen_zoom.xml"
line="22"
column="13"/>
</issue>
<issue
id="HardCodedColor"
severity="Error"
@@ -3741,38 +3725,6 @@
column="15"/>
</issue>
<issue
id="HardCodedColor"
severity="Error"
message="Avoid using hardcoded color"
category="Correctness"
priority="4"
summary="Using hardcoded color"
explanation="Hardcoded color values are bad because theme changes cannot be uniformly applied.Instead use the theme specific colors such as `?android:attr/textColorPrimary` in attributes.&#xA;This ensures that a theme change from a light to a dark theme can be uniformlyapplied across the app."
errorLine1=" &lt;item android:offset=&quot;0&quot; android:color=&quot;#FF4285F4&quot;/>"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="res/drawable/one_handed_guideline.xml"
line="34"
column="36"/>
</issue>
<issue
id="HardCodedColor"
severity="Error"
message="Avoid using hardcoded color"
category="Correctness"
priority="4"
summary="Using hardcoded color"
explanation="Hardcoded color values are bad because theme changes cannot be uniformly applied.Instead use the theme specific colors such as `?android:attr/textColorPrimary` in attributes.&#xA;This ensures that a theme change from a light to a dark theme can be uniformlyapplied across the app."
errorLine1=" &lt;item android:offset=&quot;1&quot; android:color=&quot;#004385F5&quot;/>"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="res/drawable/one_handed_guideline.xml"
line="35"
column="36"/>
</issue>
<issue
id="HardCodedColor"
severity="Error"

View File

@@ -1,22 +0,0 @@
<?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.
-->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_enabled="false"
android:alpha="?android:attr/disabledAlpha"
android:color="?android:attr/colorAccent" />
<item android:color="?android:attr/colorAccent" />
</selector>

View File

@@ -1,45 +0,0 @@
<!--
Copyright (C) 2021 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.
-->
<animated-vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt">
<aapt:attr name="android:drawable">
<vector android:height="24dp" android:width="24dp" android:viewportHeight="24"
android:viewportWidth="24"
android:tint="?android:attr/colorControlNormal">
<group android:name="_R_G">
<group android:name="_R_G_L_0_G">
<path android:name="_R_G_L_0_G_D_0_P_0" android:fillColor="#000000"
android:fillAlpha="1" android:fillType="nonZero"
android:pathData=" M12 2 C12,2 3.82,5.64 3.82,5.64 C3.82,5.64 3.82,11.09 3.82,11.09 C3.82,16.14 7.31,20.85 12,22 C16.69,20.85 20.18,16.14 20.18,11.09 C20.18,11.09 20.18,5.64 20.18,5.64 C20.18,5.64 12,2 12,2c M18.18 11.09 C18.18,12.64 17.77,14.14 17.08,15.47 C15.77,14.5 13.4,14 12,14 C10.6,14 8.23,14.5 6.92,15.47 C6.23,14.14 5.82,12.64 5.82,11.09 C5.82,11.09 5.82,6.94 5.82,6.94 C5.82,6.94 12,4.19 12,4.19 C12,4.19 18.18,6.94 18.18,6.94 C18.18,6.94 18.18,11.09 18.18,11.09c "/>
<path android:name="_R_G_L_0_G_D_1_P_0" android:fillColor="#000000"
android:fillAlpha="1" android:fillType="nonZero"
android:pathData=" M12 7.5 C13.66,7.5 15,8.84 15,10.5 C15,12.16 13.66,13.5 12,13.5 C10.34,13.5 9,12.16 9,10.5 C9,8.84 10.34,7.5 12,7.5c "/>
</group>
</group>
<group android:name="time_group"/>
</vector>
</aapt:attr>
<target android:name="time_group">
<aapt:attr name="android:animation">
<set android:ordering="together">
<objectAnimator android:propertyName="translateX" android:duration="2000"
android:startOffset="0" android:valueFrom="0" android:valueTo="1"
android:valueType="floatType"/>
</set>
</aapt:attr>
</target>
</animated-vector>

View File

@@ -1,24 +0,0 @@
<!--
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
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="?attr/sudListItemIconColor"
android:pathData="M17.81,4.47c-0.08,0 -0.16,-0.02 -0.23,-0.06C15.66,3.42 14,3 12.01,3c-1.98,0 -3.86,0.47 -5.57,1.41 -0.24,0.13 -0.54,0.04 -0.68,-0.2 -0.13,-0.24 -0.04,-0.55 0.2,-0.68C7.82,2.52 9.86,2 12.01,2c2.13,0 3.99,0.47 6.03,1.52 0.25,0.13 0.34,0.43 0.21,0.67 -0.09,0.18 -0.26,0.28 -0.44,0.28zM3.5,9.72c-0.1,0 -0.2,-0.03 -0.29,-0.09 -0.23,-0.16 -0.28,-0.47 -0.12,-0.7 0.99,-1.4 2.25,-2.5 3.75,-3.27C9.98,4.04 14,4.03 17.15,5.65c1.5,0.77 2.76,1.86 3.75,3.25 0.16,0.22 0.11,0.54 -0.12,0.7 -0.23,0.16 -0.54,0.11 -0.7,-0.12 -0.9,-1.26 -2.04,-2.25 -3.39,-2.94 -2.87,-1.47 -6.54,-1.47 -9.4,0.01 -1.36,0.7 -2.5,1.7 -3.4,2.96 -0.08,0.14 -0.23,0.21 -0.39,0.21zM9.75,21.79c-0.13,0 -0.26,-0.05 -0.35,-0.15 -0.87,-0.87 -1.34,-1.43 -2.01,-2.64 -0.69,-1.23 -1.05,-2.73 -1.05,-4.34 0,-2.97 2.54,-5.39 5.66,-5.39s5.66,2.42 5.66,5.39c0,0.28 -0.22,0.5 -0.5,0.5s-0.5,-0.22 -0.5,-0.5c0,-2.42 -2.09,-4.39 -4.66,-4.39 -2.57,0 -4.66,1.97 -4.66,4.39 0,1.44 0.32,2.77 0.93,3.85 0.64,1.15 1.08,1.64 1.85,2.42 0.19,0.2 0.19,0.51 0,0.71 -0.11,0.1 -0.24,0.15 -0.37,0.15zM16.92,19.94c-1.19,0 -2.24,-0.3 -3.1,-0.89 -1.49,-1.01 -2.38,-2.65 -2.38,-4.39 0,-0.28 0.22,-0.5 0.5,-0.5s0.5,0.22 0.5,0.5c0,1.41 0.72,2.74 1.94,3.56 0.71,0.48 1.54,0.71 2.54,0.71 0.24,0 0.64,-0.03 1.04,-0.1 0.27,-0.05 0.53,0.13 0.58,0.41 0.05,0.27 -0.13,0.53 -0.41,0.58 -0.57,0.11 -1.07,0.12 -1.21,0.12zM14.91,22c-0.04,0 -0.09,-0.01 -0.13,-0.02 -1.59,-0.44 -2.63,-1.03 -3.72,-2.1 -1.4,-1.39 -2.17,-3.24 -2.17,-5.22 0,-1.62 1.38,-2.94 3.08,-2.94 1.7,0 3.08,1.32 3.08,2.94 0,1.07 0.93,1.94 2.08,1.94s2.08,-0.87 2.08,-1.94c0,-3.77 -3.25,-6.83 -7.25,-6.83 -2.84,0 -5.44,1.58 -6.61,4.03 -0.39,0.81 -0.59,1.76 -0.59,2.8 0,0.78 0.07,2.01 0.67,3.61 0.1,0.26 -0.03,0.55 -0.29,0.64 -0.26,0.1 -0.55,-0.04 -0.64,-0.29 -0.49,-1.31 -0.73,-2.61 -0.73,-3.96 0,-1.2 0.23,-2.29 0.68,-3.24 1.33,-2.79 4.28,-4.6 7.51,-4.6 4.55,0 8.25,3.51 8.25,7.83 0,1.62 -1.38,2.94 -3.08,2.94s-3.08,-1.32 -3.08,-2.94c0,-1.07 -0.93,-1.94 -2.08,-1.94s-2.08,0.87 -2.08,1.94c0,1.71 0.66,3.31 1.87,4.51 0.95,0.94 1.86,1.46 3.27,1.85 0.27,0.07 0.42,0.35 0.35,0.61 -0.05,0.23 -0.26,0.38 -0.47,0.38z"/>
</vector>

View File

@@ -1,29 +0,0 @@
<?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
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="32.0dp"
android:height="32.0dp"
android:viewportWidth="40.0"
android:viewportHeight="40.0">
<path
android:pathData="M20.0,20.0m-20.0,0.0a20.0,20.0 0.0,1.0 1.0,40.0 0.0a20.0,20.0 0.0,1.0 1.0,-40.0 0.0"
android:fillColor="?android:attr/colorAccent"/>
<path
android:pathData="M11.2,21.41l1.63,-1.619999 4.17,4.169998 10.59,-10.589999 1.619999,1.63 -12.209999,12.209999z"
android:fillColor="#FFFFFF"/>
</vector>

View File

@@ -1,25 +0,0 @@
<!--
Copyright (C) 2017 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.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#FFEF6C00"
android:pathData="M12,4.24l6,3v4.1c0,3.9 -2.55,7.5 -6,8.59c-3.45,-1.09 -6,-4.7 -6,-8.59v-4.1L12,4.24M12,2L4,6v5.33c0,4.93 3.41,9.55 8,10.67c4.59,-1.12 8,-5.73 8,-10.67V6L12,2L12,2zM11,15h2v2h-2V15zM13,8h-2v5h2V8z"/>
</vector>

View File

@@ -1,25 +0,0 @@
<!--
Copyright (C) 2017 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.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#FF43A047"
android:pathData="M11.14,16l-3.84,-3.84l1.41,-1.42l2.43,2.42l4.16,-4.16l1.42,1.41L11.14,16zM12,4.24l6,3v4.1c0,3.9 -2.55,7.5 -6,8.59c-3.45,-1.09 -6,-4.7 -6,-8.59v-4.1L12,4.24M12,2L4,6v5.33c0,4.93 3.41,9.55 8,10.67c4.59,-1.12 8,-5.73 8,-10.67V6L12,2L12,2z"/>
</vector>

View File

@@ -1,24 +0,0 @@
<!--
Copyright (C) 2017 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.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#FFF44336"
android:pathData="M15.5,9.91L14.09,8.5L12,10.59L9.91,8.5L8.5,9.91L10.59,12L8.5,14.09l1.41,1.41L12,13.42l2.09,2.08l1.41,-1.41L13.42,12L15.5,9.91zM12,4.24l6,3v4.1c0,3.9 -2.55,7.5 -6,8.59c-3.45,-1.09 -6,-4.7 -6,-8.59v-4.1L12,4.24M12,2L4,6v5.33c0,4.93 3.41,9.55 8,10.67c4.59,-1.12 8,-5.73 8,-10.67V6L12,2L12,2z"/>
</vector>

View File

@@ -1,27 +0,0 @@
<!--
Copyright (C) 2019 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.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FF1E8E3E"
android:pathData="M17,18H7v-2.67l1.59,1.58L10,15.5l-3,-3l-1,-1l-4,4l1.41,1.42L5,15.33v4.17V20v1c0,1.1 0.9,2 2,2h10c1.1,0 2,-0.9 2,-2v-7h-2V18zM17,21H7v-1h10V21z"/>
<path
android:fillColor="#FF1E8E3E"
android:pathData="M7,6h10v2.67l-1.59,-1.58L14,8.5l4,4l4,-4l-1.41,-1.42L19,8.67V4.5V4V3c0,-1.1 -0.9,-1.99 -2,-1.99L7,1C5.9,1 5,1.9 5,3v7h2V6zM7,3h10v1H7V3z"/>
</vector>

View File

@@ -1,27 +0,0 @@
<!--
Copyright (C) 2019 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.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#FFD93025"
android:pathData="M17,18H7v-2.67l1.59,1.58L10,15.5l-3,-3l-1,-1l-4,4l1.41,1.42L5,15.33v4.17V20v1c0,1.1 0.9,2 2,2h10c1.1,0 2,-0.9 2,-2v-7h-2V18zM17,21H7v-1h10V21z"/>
<path
android:fillColor="#FFD93025"
android:pathData="M7,6h10v2.67l-1.59,-1.58L14,8.5l4,4l4,-4l-1.41,-1.42L19,8.67V4.5V4V3c0,-1.1 -0.9,-1.99 -2,-1.99L7,1C5.9,1 5,1.9 5,3v7h2V6zM7,3h10v1H7V3z"/>
</vector>

View File

@@ -1,35 +0,0 @@
<!--
Copyright 2021 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>
<com.android.settingslib.widget.AdaptiveIconShapeDrawable
android:width="@dimen/accessibility_icon_size"
android:height="@dimen/accessibility_icon_size"
android:color="@color/accessibility_feature_background"/>
</item>
<item android:gravity="center">
<vector
android:width="@dimen/accessibility_icon_foreground_size"
android:height="@dimen/accessibility_icon_foreground_size"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#ffffff"
android:pathData="M17,1.01L7,1c-1.1,0 -2,0.9 -2,2v18c0,1.1 0.9,2 2,2h10c1.1,0 2,-0.9 2,-2L19,3c0,-1.1 -0.9,-1.99 -2,-1.99zM17,21L7,21v-1h10v1zM17,18L7,18L7,6h10v12zM17,4L7,4L7,3h10v1zM9.5,8.5L12,8.5L12,7L8,7v4h1.5zM12,17h4v-4h-1.5v2.5L12,15.5z"/>
</vector>
</item>
</layer-list>

View File

@@ -1,31 +0,0 @@
<!--
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.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24.0dp"
android:height="24.0dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0"
android:tint="?android:attr/colorControlNormal">
<path
android:fillColor="#FF000000"
android:pathData="M11,7h2v2h-2z"/>
<path
android:fillColor="#FF000000"
android:pathData="M11,11h2v6h-2z"/>
<path
android:fillColor="#FF000000"
android:pathData="M12,2C6.48,2 2,6.48 2,12c0,5.52 4.48,10 10,10s10,-4.48 10,-10C22,6.48 17.52,2 12,2zM12,20c-4.41,0 -8,-3.59 -8,-8c0,-4.41 3.59,-8 8,-8s8,3.59 8,8C20,16.41 16.41,20 12,20z"/>
</vector>

View File

@@ -1,25 +0,0 @@
<!--
Copyright (C) 2017 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.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0"
android:tint="?android:attr/colorControlNormal">
<path
android:pathData="M14,12c0,-1.1 -0.9,-2 -2,-2s-2,0.9 -2,2 0.9,2 2,2 2,-0.9 2,-2zM12,3c-4.97,0 -9,4.03 -9,9L0,12l4,4 4,-4L5,12c0,-3.87 3.13,-7 7,-7s7,3.13 7,7 -3.13,7 -7,7c-1.51,0 -2.91,-0.49 -4.06,-1.3l-1.42,1.44C8.04,20.3 9.94,21 12,21c4.97,0 9,-4.03 9,-9s-4.03,-9 -9,-9z"
android:fillColor="#FFFFFFFF"/>
</vector>

View File

@@ -1,25 +0,0 @@
<!--
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.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0"
android:tint="?android:attr/colorControlNormal">
<path
android:fillColor="#FF000000"
android:pathData="M15.67,4H14V2h-4v2H8.33C7.6,4 7,4.6 7,5.33v15.33C7,21.4 7.6,22 8.33,22h7.33c0.74,0 1.34,-0.6 1.34,-1.33V5.33C17,4.6 16.4,4 15.67,4z"/>
</vector>

View File

@@ -1,27 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2019 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.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?android:attr/colorControlNormal">
<path
android:pathData="m11.986,12.0357c5.4299,-5.4312 9.9013,-9.875 9.9363,-9.875 0.035,0 0.0637,4.4437 0.0637,9.875v9.875L12.0497,21.9107 2.1134,21.9107ZM19.986,13.3522L19.986,6.7936l-3,2.9922 -3,2.9922v3.5664,3.5664h3,3z"
android:strokeWidth="0.25"
android:fillColor="#000000"/>
</vector>

View File

@@ -1,24 +0,0 @@
<!--
Copyright (C) 2017 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.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:viewportWidth="192"
android:viewportHeight="192"
android:width="72dp"
android:height="72dp">
<path
android:pathData="M184 96A88 88 0 0 1 96 184 88 88 0 0 1 8 96 88 88 0 0 1 96 8 88 88 0 0 1 184 96Z"
android:fillColor="@android:color/white" />
</vector>

View File

@@ -1,31 +0,0 @@
<!--
Copyright (C) 2020 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
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M18.2,1L9.8,1C8.81,1 8,1.81 8,2.8v14.4c0,0.99 0.81,1.79 1.8,1.79l8.4,0.01c0.99,0 1.8,-0.81 1.8,-1.8L20,2.8c0,-0.99 -0.81,-1.8 -1.8,-1.8zM14,3c1.1,0 2,0.89 2,2s-0.9,2 -2,2 -2,-0.89 -2,-2 0.9,-2 2,-2zM14,16.5c-2.21,0 -4,-1.79 -4,-4s1.79,-4 4,-4 4,1.79 4,4 -1.79,4 -4,4z"
android:fillColor="#000000"/>
<path
android:pathData="M14,12.5m-2.5,0a2.5,2.5 0,1 1,5 0a2.5,2.5 0,1 1,-5 0"
android:fillColor="#000000"/>
<path
android:pathData="M6,5H4v16c0,1.1 0.89,2 2,2h10v-2H6V5z"
android:fillColor="#000000"/>
</vector>

View File

@@ -1,26 +0,0 @@
<!--
Copyright (C) 2017 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.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0"
android:tint="?android:attr/colorControlNormal">
<path
android:fillColor="#FF000000"
android:pathData="M12.87,15.07l-2.54,-2.51 0.03,-0.03c1.74,-1.94 2.98,-4.17 3.71,-6.53L17,6L17,4h-7L10,2L8,2v2L1,4v1.99h11.17C11.5,7.92 10.44,9.75 9,11.35 8.07,10.32 7.3,9.19 6.69,8h-2c0.73,1.63 1.73,3.17 2.98,4.56l-5.09,5.02L4,19l5,-5 3.11,3.11 0.76,-2.04zM18.5,10h-2L12,22h2l1.12,-3h4.75L21,22h2l-4.5,-12zM15.88,17l1.62,-4.33L19.12,17h-3.24z"/>
</vector>

View File

@@ -1,45 +0,0 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
android:width="412dp"
android:height="264dp"
android:viewportWidth="412"
android:viewportHeight="264">
<group>
<clip-path
android:pathData="M0,0h412v264h-412z"/>
<path
android:pathData="M126,-246C109.431,-246 96,-232.569 96,-216V195C96,211.569 109.431,225 126,225H284.5C301.069,225 314.5,211.569 314.5,195V-216C314.5,-232.569 301.069,-246 284.5,-246H126ZM122,-235C110.954,-235 102,-226.046 102,-215V189.5C102,200.546 110.954,209.5 122,209.5H288C299.046,209.5 308,200.546 308,189.5V-215C308,-226.046 299.046,-235 288,-235H122Z"
android:fillColor="#000000"
android:fillType="evenOdd"/>
<path
android:pathData="M122.12,-233L288.12,-233A20,20 0,0 1,308.12 -213L308.12,191.5A20,20 0,0 1,288.12 211.5L122.12,211.5A20,20 0,0 1,102.12 191.5L102.12,-213A20,20 0,0 1,122.12 -233z"
android:fillColor="#EAF1FF"/>
<path
android:pathData="M102.16,193.12H308.08C308.08,203.326 299.806,211.6 289.6,211.6H120.64C110.434,211.6 102.16,203.326 102.16,193.12Z"
android:fillColor="#B5CFFC"/>
<path
android:pathData="M187.5,202.72L222.5,202.72A0.5,0.5 0,0 1,223 203.22L223,203.22A0.5,0.5 0,0 1,222.5 203.72L187.5,203.72A0.5,0.5 0,0 1,187 203.22L187,203.22A0.5,0.5 0,0 1,187.5 202.72z"
android:fillColor="#666666"/>
<path
android:pathData="M197,115h36v94.684h-36z"
android:strokeAlpha="0.8"
android:fillAlpha="0.8">
<aapt:attr name="android:fillColor">
<gradient
android:startY="189.19"
android:startX="212.951"
android:endY="168.637"
android:endX="212.447"
android:type="linear">
<item android:offset="0" android:color="#FF4285F4"/>
<item android:offset="1" android:color="#004385F5"/>
</gradient>
</aapt:attr>
</path>
<path
android:pathData="M197,206.899a18,18.101 0,1 0,36 0a18,18.101 0,1 0,-36 0z"
android:strokeAlpha="0.8"
android:fillColor="#3B7BE4"
android:fillAlpha="0.8"/>
</group>
</vector>

View File

@@ -1,22 +0,0 @@
<?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.
-->
<ripple
xmlns:android="http://schemas.android.com/apk/res/android"
android:color="?android:attr/colorControlHighlight">
<item android:drawable="?android:attr/colorBackground"/>
</ripple>

View File

@@ -1,21 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2014 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.
-->
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="?android:attr/colorControlHighlight">
<item android:drawable="?android:attr/colorSecondary" />
</ripple>

View File

@@ -1,24 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2021 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.
-->
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="?android:attr/textColorSecondaryInverse"/>
<corners android:radius="8dp"/>
<size android:height="4dp"/>
</shape>

View File

@@ -1,29 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2021 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.
-->
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scaleType="centerInside"
android:cropToPadding="true"
android:src="@drawable/one_handed_guideline"
android:contentDescription="@null" />
</FrameLayout>

View File

@@ -1,33 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2020 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
-->
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView
android:id="@+id/item_textview"
android:layout_width="match_parent"
android:layout_height="42dp"
android:fontFamily="@*android:string/config_headlineFontFamilyMedium"
android:gravity="center_vertical"
android:maxLength="20"
android:paddingLeft="@dimen/accessibility_layout_margin_start_end"
android:singleLine="true"
android:textSize="14sp" />
</FrameLayout>

View File

@@ -1,61 +0,0 @@
<?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.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?android:attr/listPreferredItemHeightSmall"
android:gravity="center_vertical"
android:paddingStart="?android:attr/listPreferredItemPaddingStart"
android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
android:background="?android:attr/selectableItemBackground">
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:paddingTop="16dip"
android:paddingBottom="16dip">
<TextView
android:id="@android:id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="@*android:style/TextAppearance.DeviceDefault.Subhead"
android:textColor="?android:attr/textColorPrimary"
android:textAlignment="center"
android:ellipsize="marquee"
android:hyphenationFrequency="normalFast"
android:lineBreakWordStyle="phrase"
android:fadingEdge="horizontal" />
<TextView
android:id="@android:id/summary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@android:id/title"
android:layout_alignStart="@android:id/title"
android:visibility="gone"
android:textAlignment="viewStart"
android:textAppearance="@*android:style/TextAppearance.DeviceDefault.Body1"
android:textColor="?android:attr/textColorSecondary"
android:hyphenationFrequency="normalFast"
android:lineBreakWordStyle="phrase"
android:maxLines="10" />
</RelativeLayout>
</LinearLayout>

View File

@@ -1,93 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2018 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.
-->
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?android:attr/listPreferredItemHeightSmall"
android:gravity="center_vertical"
android:background="@android:color/transparent"
android:clipToPadding="false">
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="?android:attr/selectableItemBackground"
android:gravity="start|center_vertical"
android:clipToPadding="false">
<LinearLayout
android:id="@+id/checkbox_frame"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center"
android:minWidth="56dp"
android:layout_marginEnd="16dp"
android:orientation="vertical">
<RadioButton
android:id="@android:id/checkbox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="@null"
android:focusable="false"
android:clickable="false" />
</LinearLayout>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:paddingTop="16dp"
android:paddingBottom="16dp"
android:paddingEnd="16dp">
<TextView
android:id="@android:id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:textAppearance="?android:attr/textAppearanceListItem"
android:ellipsize="marquee" />
<TextView
android:id="@android:id/summary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@android:id/title"
android:layout_alignStart="@android:id/title"
android:textAppearance="?android:attr/textAppearanceListItemSecondary"
android:textColor="?android:attr/textColorSecondary"
android:hyphenationFrequency="normalFast"
android:lineBreakWordStyle="phrase"
android:maxLines="10" />
</RelativeLayout>
</LinearLayout>
<include layout="@layout/preference_two_target_divider" />
<LinearLayout
android:id="@android:id/widget_frame"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center"
android:minWidth="@dimen/two_target_min_width"
android:orientation="vertical" />
</LinearLayout>

View File

@@ -1,27 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2018 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.
-->
<!-- Settings button -->
<ImageView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/settings_button"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:scaleType="center"
android:src="@drawable/ic_settings_accent"
android:contentDescription="@string/settings_button" />

View File

@@ -1,22 +0,0 @@
<?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.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="8dp"
android:paddingBottom="4dp"
android:orientation="vertical" />

View File

@@ -1,24 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2009 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.
-->
<CheckBox
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/remember"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/bluetooth_dock_settings_remember"
android:focusable="true"
android:clickable="true" />

View File

@@ -1,25 +0,0 @@
<?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.
-->
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="6dip"
android:paddingBottom="6dip"
android:paddingStart="@dimen/sud_layout_margin_sides"
android:paddingEnd="@dimen/sud_layout_margin_sides"
android:text="@string/unlock_setup_wizard_fingerprint_details" />

View File

@@ -1,29 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2017 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.
-->
<!-- For use in a LayoutPreference -->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="wrap_content"
android:layout_width="match_parent" >
<com.android.settings.widget.SwitchBar
android:id="@+id/switch_bar"
android:minHeight="?android:attr/actionBarSize"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:paddingStart="0dp"
android:theme="?attr/switchBarTheme" />
</LinearLayout>

View File

@@ -1,30 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2011 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.
-->
<HorizontalScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scrollbars="none"
android:fillViewport="true">
<TabWidget
android:id="@android:id/tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
style="?android:attr/tabWidgetStyle" />
</HorizontalScrollView>

View File

@@ -1,62 +0,0 @@
<!--
Copyright (C) 2017 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.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/selectableItemBackground"
android:gravity="center_vertical"
android:minHeight="?android:attr/listPreferredItemHeight"
android:orientation="vertical"
android:paddingStart="?android:attr/listPreferredItemPaddingStart"
android:paddingEnd="?android:attr/listPreferredItemPaddingEnd">
<TextView
android:id="@+id/tz_item_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="TimeZone name"
android:textAppearance="?android:attr/textAppearanceListItem" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/tz_item_details"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textAppearance="?android:attr/textAppearanceListItemSecondary"
android:textColor="?android:attr/textColorSecondary" />
<TextView
android:id="@+id/tz_item_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAlignment="viewEnd"
android:textAppearance="?android:attr/textAppearanceListItemSecondary"
android:textColor="?android:attr/textColorSecondary" />
</LinearLayout>
<TextView
android:id="@+id/tz_item_dst"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceListItemSecondary"
android:textColor="?android:attr/textColorSecondary" />
</LinearLayout>

View File

@@ -1,80 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2014 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.
-->
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?android:attr/listPreferredItemHeight"
android:gravity="center_vertical">
<LinearLayout
android:id="@+id/clickable"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
android:paddingStart="?android:attr/listPreferredItemPaddingStart"
android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
android:gravity="center_vertical"
android:clickable="true"
android:focusable="true"
android:background="?android:attr/selectableItemBackground">
<CheckBox
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/checkbox"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center"
android:focusable="false"
android:clickable="false"/>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="6dip"
android:layout_marginTop="6dip"
android:layout_marginBottom="6dip"
android:layout_weight="1">
<TextView
android:id="@+id/name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:textAppearance="?android:attr/textAppearanceMedium"
android:ellipsize="marquee"
android:fadingEdge="horizontal"/>
<TextView
android:id="@+id/description"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@android:id/title"
android:layout_alignStart="@android:id/title"
android:paddingBottom="3dip"
android:visibility="gone"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textSize="13sp"
android:textColor="?android:attr/textColorSecondary"
android:focusable="false"
android:maxLines="4"/>
</RelativeLayout>
</LinearLayout>
</LinearLayout>

View File

@@ -1,23 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2011 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.
-->
<Button
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/cert_remove_button"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_gravity="end"
android:layout_margin="6dip"
/>

View File

@@ -1,181 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
** Copyright 2008, 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.
*/
-->
<!-- This is not a standalone element it can be included into apps that need 12-key input -->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="64dip"
android:layout_marginStart="2dip"
android:layout_marginEnd="2dip"
android:orientation="horizontal">
<Button android:id="@+id/one"
android:layout_width="0sp"
android:layout_height="fill_parent"
android:layout_weight="1"
android:layout_marginStart="2dip"
android:layout_marginEnd="2dip"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textStyle="bold"
/>
<Button android:id="@+id/two"
android:layout_width="0sp"
android:layout_height="fill_parent"
android:layout_weight="1"
android:layout_marginStart="2dip"
android:layout_marginEnd="2dip"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textStyle="bold"
/>
<Button android:id="@+id/three"
android:layout_width="0sp"
android:layout_height="fill_parent"
android:layout_weight="1"
android:layout_marginStart="2dip"
android:layout_marginEnd="2dip"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textStyle="bold"
/>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="64dip"
android:layout_marginStart="2dip"
android:layout_marginEnd="2dip"
android:orientation="horizontal">
<Button android:id="@+id/four"
android:layout_width="0sp"
android:layout_height="fill_parent"
android:layout_weight="1"
android:layout_marginStart="2dip"
android:layout_marginEnd="2dip"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textStyle="bold"
/>
<Button android:id="@+id/five"
android:layout_width="0sp"
android:layout_height="fill_parent"
android:layout_weight="1"
android:layout_marginStart="2dip"
android:layout_marginEnd="2dip"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textStyle="bold"
/>
<Button android:id="@+id/six"
android:layout_width="0sp"
android:layout_height="fill_parent"
android:layout_weight="1"
android:layout_marginStart="2dip"
android:layout_marginEnd="2dip"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textStyle="bold"
/>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="64dip"
android:layout_marginStart="2dip"
android:layout_marginEnd="2dip"
android:orientation="horizontal">
<Button android:id="@+id/seven"
android:layout_width="0sp"
android:layout_height="fill_parent"
android:layout_weight="1"
android:layout_marginStart="2dip"
android:layout_marginEnd="2dip"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textStyle="bold"
/>
<Button android:id="@+id/eight"
android:layout_width="0sp"
android:layout_height="fill_parent"
android:layout_weight="1"
android:layout_marginStart="2dip"
android:layout_marginEnd="2dip"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textStyle="bold"
/>
<Button android:id="@+id/nine"
android:layout_width="0sp"
android:layout_height="fill_parent"
android:layout_weight="1"
android:layout_marginStart="2dip"
android:layout_marginEnd="2dip"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textStyle="bold"
/>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="64dip"
android:layout_marginStart="2dip"
android:layout_marginEnd="2dip"
android:orientation="horizontal">
<Button android:id="@+id/ok"
android:layout_width="0sp"
android:layout_height="fill_parent"
android:layout_weight="1"
android:layout_marginStart="2dip"
android:layout_marginEnd="2dip"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textStyle="bold"
android:text="@android:string/ok"
/>
<Button android:id="@+id/zero"
android:layout_width="0sp"
android:layout_height="fill_parent"
android:layout_weight="1"
android:layout_marginStart="2dip"
android:layout_marginEnd="2dip"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textStyle="bold"
/>
<Button android:id="@+id/cancel"
android:layout_width="0sp"
android:layout_height="fill_parent"
android:layout_weight="1"
android:layout_marginStart="2dip"
android:layout_marginEnd="2dip"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textStyle="bold"
android:text="@android:string/cancel"
/>
</LinearLayout>
</LinearLayout>

View File

@@ -1,60 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2020 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.
-->
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/request_background_location_permission"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:paddingStart="8dp"
android:paddingEnd="10dp"
android:paddingTop="18dp"
android:paddingBottom="0dp"
android:layout_height="wrap_content"
android:orientation="horizontal">
<ImageView
android:layout_width="40dp"
android:layout_height="wrap_content"
android:src="@drawable/ic_settings_location"
android:tint="?android:attr/colorAccent"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:paddingRight="2dp"
android:gravity="center_vertical"
android:text="@string/twilight_mode_location_off_dialog_message"
android:textAppearance="?attr/textAppearanceSubtitle1"
android:textSize="16sp"
android:textColor="?android:attr/textColorPrimary"/>
</LinearLayout>
<Button
android:id="@+id/go_to_location_setting"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/twilight_mode_launch_location"
style="@style/Widget.AppCompat.Button.Borderless.Colored"
android:layout_gravity="end"/>
</LinearLayout>

View File

@@ -1,20 +0,0 @@
<!--
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.
-->
<TextView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall" />

View File

@@ -1,45 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:text="@string/display_order_text"
android:textAppearance="?android:attr/textAppearanceLarge"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<Spinner
android:id="@+id/typeSpinner"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:entries="@array/usage_stats_display_order_types" />
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<TextView
android:text="@string/app_name_label"
android:textAppearance="?android:attr/textAppearanceMedium"
android:layout_width="wrap_content"
android:paddingEnd="6dip"
android:layout_height="wrap_content" />
<TextView
android:text="@string/last_time_used_label"
android:paddingEnd="6dip"
android:textAppearance="?android:attr/textAppearanceMedium"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:text="@string/usage_time_label"
android:textAppearance="?android:attr/textAppearanceMedium"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<ListView android:id="@+id/pkg_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:drawSelectorOnTop="false" />
</LinearLayout>

View File

@@ -1,50 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
** Copyright 2008, 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.
*/
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:minHeight="?android:attr/listPreferredItemHeight">
<TextView android:id="@+id/package_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:paddingEnd="6dip"
android:paddingStart="12dip"
android:maxLines="1" />
<TextView android:id="@+id/last_time_used"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:paddingEnd="6dip"
android:paddingStart="12dip"
android:maxLines="1" />
<TextView android:id="@+id/usage_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:paddingEnd="6dip"
android:paddingStart="12dip"
android:maxLines="1" />
</LinearLayout>

View File

@@ -1,38 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2012 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.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="16dip"
android:paddingRight="16dip"
android:paddingTop="8dip"
android:paddingBottom="8dip"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="@string/vpn_lockdown_summary" />
<ListView
android:id="@android:id/list"
android:layout_width="match_parent"
android:layout_height="0dip"
android:layout_weight="1" />
</LinearLayout>

View File

@@ -1,44 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2017 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.
-->
<!--
Defines a panel with two buttons and a spacer in between.
The right button uses the Material.Button.Colored style.
-->
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="4dp"
android:paddingStart="8dp"
android:paddingEnd="8dp">
<Button
android:id="@+id/forget_button"
android:text="@string/forget"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:layout_gravity="center"/>
<Button
style="@android:style/Widget.Material.Button.Colored"
android:id="@+id/signin_button"
android:text="@string/wifi_sign_in_button_text"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:layout_gravity="center"/>
</LinearLayout>

View File

@@ -1,12 +0,0 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<CheckBox
android:id="@+id/checkbox"
style="?android:attr/textAppearanceMedium"
android:text="@string/wifi_scan_notify_remember_choice"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp" />
</FrameLayout>

View File

@@ -1,27 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2011 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.
-->
<!-- Based on simple_list_item_1.xml in framework -->
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/text1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="20sp"
android:gravity="center_vertical"
android:paddingStart="16dip"
android:minHeight="48dip"
/>

View File

@@ -1,76 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2014 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.
-->
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fadeScrollbars="false"
android:scrollIndicators="top|bottom">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/wifi_section">
<LinearLayout android:id="@+id/password_layout"
style="@style/wifi_item"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="8dip"
android:orientation="vertical" >
<TextView
android:id="@+id/password_label"
style="?android:attr/textAppearanceSmall"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dip"
android:text="@string/wifi_password" />
<EditText android:id="@+id/password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:password="true"
android:maxLength="63"
android:imeOptions="flagForceAscii" />
<TextView
style="@style/wifi_item_label"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<CheckBox android:id="@+id/show_password"
style="@style/wifi_item_content"
android:textSize="14sp"
android:text="@string/wifi_show_password"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
<ProgressBar
android:id="@+id/progress_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|center_horizontal"
android:padding="8dip"
android:visibility="gone"
style="@android:style/Widget.ProgressBar.Large" />
</LinearLayout>
</ScrollView>

View File

@@ -1,36 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2017 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.
-->
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:gravity="bottom"
android:paddingTop="4dp"
android:paddingStart="72dp"
android:paddingEnd="72dp"
android:layout_width="match_parent"
android:layout_height="match_parent">
<Button
android:id="@+id/zen_mode_button"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:paddingEnd="8dp" />
</LinearLayout>

View File

@@ -1,25 +0,0 @@
<?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.
-->
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="horizontal">
<include layout="@layout/preference_widget_gear"
android:id="@+id/zen_automatic_rule_widget" />
</LinearLayout>

View File

@@ -1,21 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2012 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.
-->
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/wifi_wps"
android:title="@string/wifi_setup_wps" />
</menu>

View File

@@ -1,24 +0,0 @@
<?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.
-->
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/delete"
android:title="@string/zen_mode_delete_rule"
android:icon="@drawable/ic_delete"
android:visible="true"
android:showAsAction="collapseActionView|ifRoom" />
</menu>

View File

@@ -261,13 +261,6 @@
<item>Excellent</item>
</string-array>
<!-- Display options for UsageStats class -->
<string-array name="usage_stats_display_order_types">
<item>Usage time</item>
<item>Last time used</item>
<item>App name</item>
</string-array>
<!-- Phase 2 options for PEAP -->
<string-array name="wifi_peap_phase2_entries">
<item>MSCHAPV2</item>

File diff suppressed because it is too large Load Diff

View File

@@ -63,11 +63,6 @@
<item name="android:layout_height">wrap_content</item>
</style>
<style name="form_value">
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_width">match_parent</item>
</style>
<style name="PreferenceFragmentListSinglePane" parent="@*android:style/PreferenceFragmentList">
<item name="android:layout_marginStart">0dp</item>
<item name="android:layout_marginEnd">0dp</item>
@@ -80,22 +75,6 @@
<item name="android:scrollbarStyle">outsideOverlay</item>
</style>
<style name="bt_item">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_marginTop">8dip</item>
<item name="android:layout_marginStart">16dip</item>
<item name="android:layout_marginEnd">16dip</item>
<item name="android:orientation">vertical</item>
<item name="android:gravity">start</item>
</style>
<style name="bt_item_edit_content">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:textSize">18sp</item>
</style>
<style name="wifi_item">
<item name="android:layout_marginTop">8dip</item>
<item name="android:layout_marginStart">8dip</item>
@@ -198,18 +177,6 @@
<item name="android:activityOpenExitAnimation">@anim/confirm_credential_open_exit</item>
</style>
<style name="SetupWizardButton.Negative" parent="@style/SudGlifButton.Secondary">
<!-- Negative margin to offset for padding of the button itself. We want the label to be
aligned with the text above it -->
<item name="android:layout_marginStart">-16dp</item>
</style>
<style name="SetupWizardButton.Positive" parent="@style/SudGlifButton.Primary"/>
<style name="AccentColorHighlightBorderlessButton">
<item name="android:colorControlHighlight">?android:attr/colorAccent</item>
</style>
<style name="vpn_label">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">wrap_content</item>

View File

@@ -1,38 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2019 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.
-->
<!-- @deprecated This class will be removed in Android U, use {@link network_provider_sims_list.xml}
instead.-->
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res-auto"
android:title="@string/network_settings_title">
<com.android.settingslib.RestrictedPreference
android:key="add_more"
settings:isPreferenceVisible="false"
settings:userRestriction="no_config_mobile_networks"
settings:useAdminDisabledSummary="true"
settings:searchable="false"
android:title="@string/mobile_network_list_add_more"
android:icon="@drawable/ic_menu_add_activated_tint"
android:order="100" >
<intent android:action="android.telephony.euicc.action.PROVISION_EMBEDDED_SUBSCRIPTION">
<extra android:name="android.telephony.euicc.extra.FORCE_PROVISION"
android:value="true"/>
</intent>
</com.android.settingslib.RestrictedPreference>
</PreferenceScreen>

View File

@@ -1,128 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2018 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.
-->
<!-- @deprecated This class will be removed in Android U, use {@link network_provider_internet.xml}
instead.-->
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res-auto"
android:key="network_and_internet_screen"
android:title="@string/network_dashboard_title">
<PreferenceCategory
android:key="multi_network_header"
android:title="@string/summary_placeholder"
android:layout="@layout/preference_category_no_label"
settings:allowDividerBelow="true"
android:order="-40"
settings:controller="com.android.settings.network.MultiNetworkHeaderController"/>
<com.android.settingslib.PrimarySwitchPreference
android:fragment="com.android.settings.wifi.WifiSettings"
android:key="main_toggle_wifi"
android:title="@string/wifi_settings"
android:summary="@string/summary_placeholder"
android:icon="@drawable/ic_settings_wireless"
android:order="-30"
settings:allowDividerAbove="true">
<intent
android:action="android.settings.WIFI_SETTINGS"
android:targetClass="Settings$WifiSettingsActivity" />
</com.android.settingslib.PrimarySwitchPreference>
<com.android.settings.widget.AddPreference
android:key="mobile_network_list"
android:title="@string/network_settings_title"
android:summary="@string/summary_placeholder"
android:icon="@drawable/ic_network_cell"
android:order="-15"
settings:keywords="@string/keywords_more_mobile_networks"
settings:userRestriction="no_config_mobile_networks"
settings:useAdminDisabledSummary="true" />
<com.android.settingslib.RestrictedSwitchPreference
android:key="airplane_mode"
android:title="@string/airplane_mode"
android:icon="@drawable/ic_airplanemode_active"
android:disableDependentsState="true"
android:order="-5"
settings:controller="com.android.settings.network.AirplaneModePreferenceController"
settings:userRestriction="no_airplane_mode"/>
<com.android.settingslib.RestrictedPreference
android:key="manage_mobile_plan"
android:title="@string/manage_mobile_plan_title"
android:persistent="false"
android:order="19"
settings:userRestriction="no_config_mobile_networks"
settings:useAdminDisabledSummary="true" />
<com.android.settingslib.RestrictedPreference
android:fragment="com.android.settings.TetherSettings"
android:key="tether_settings"
android:title="@string/tether_settings_title_all"
android:icon="@drawable/ic_wifi_tethering"
android:order="5"
android:summary="@string/summary_placeholder"
settings:keywords="@string/keywords_hotspot_tethering"
settings:userRestriction="no_config_tethering"
settings:useAdminDisabledSummary="true" />
<com.android.settingslib.PrimarySwitchPreference
android:fragment="com.android.settings.AllInOneTetherSettings"
android:key="all_tether_settings"
android:title="@string/tether_settings_title_all"
android:icon="@drawable/ic_wifi_tethering"
android:order="6"
android:summary="@string/summary_placeholder"
settings:controller="com.android.settings.network.AllInOneTetherPreferenceController"
settings:keywords="@string/keywords_hotspot_tethering"
settings:userRestriction="no_config_tethering"
settings:useAdminDisabledSummary="true" />
<com.android.settings.datausage.DataSaverPreference
android:key="restrict_background_parent_entry"
android:title="@string/data_saver_title"
android:icon="@drawable/ic_settings_data_usage"
android:order="10"
android:fragment="com.android.settings.datausage.DataSaverSummary"/>
<com.android.settingslib.RestrictedPreference
android:fragment="com.android.settings.vpn2.VpnSettings"
android:key="vpn_settings"
android:title="@string/vpn_settings_title"
android:icon="@drawable/ic_vpn_key"
android:order="15"
android:summary="@string/summary_placeholder"
settings:userRestriction="no_config_vpn"
settings:useAdminDisabledSummary="true" />
<com.android.settings.network.PrivateDnsModeDialogPreference
android:key="private_dns_settings"
android:title="@string/select_private_dns_configuration_title"
android:order="20"
android:dialogTitle="@string/select_private_dns_configuration_dialog_title"
android:dialogLayout="@layout/private_dns_mode_dialog"
android:positiveButtonText="@string/save"
android:negativeButtonText="@android:string/cancel" />
<Preference
android:fragment="com.android.settings.network.AdaptiveConnectivitySettings"
android:key="adaptive_connectivity"
android:title="@string/adaptive_connectivity_title"
android:summary="@string/summary_placeholder"
android:order="25"
settings:controller="com.android.settings.network.AdaptiveConnectivityPreferenceController"/>
</PreferenceScreen>

View File

@@ -1,21 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2017 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.
-->
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
android:title="@string/network_scorer_picker_title">
</PreferenceScreen>

View File

@@ -1,39 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2017 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.
-->
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res-auto">
<com.android.settingslib.widget.LayoutPreference
android:key="pref_app_header"
android:layout="@layout/settings_entity_header" />
<com.android.settingslib.widget.MainSwitchPreference
android:key="block" />
<!-- Channels added here -->
<Preference
android:key="app_link"
android:title="@string/app_settings_link"
settings:allowDividerAbove="true"/>
<com.android.settingslib.widget.FooterPreference
android:key="desc" />
<com.android.settingslib.widget.FooterPreference
android:key="block_desc" />
</PreferenceScreen>

View File

@@ -1,33 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2017 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.
-->
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
android:title="@string/notification_importance_title">
<com.android.settingslib.widget.SelectorWithWidgetPreference
android:key="importance_high"
android:title="@string/notification_importance_high" />
<com.android.settingslib.widget.SelectorWithWidgetPreference
android:key="importance_default"
android:title="@string/notification_importance_default" />
<com.android.settingslib.widget.SelectorWithWidgetPreference
android:key="importance_low"
android:title="@string/notification_importance_low" />
<com.android.settingslib.widget.SelectorWithWidgetPreference
android:key="importance_min"
android:title="@string/notification_importance_min" />
</PreferenceScreen>

View File

@@ -1,21 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2014 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.
-->
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res-auto"
android:title="@string/app_notifications_title">
</PreferenceScreen>

View File

@@ -1,69 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2014 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.
-->
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
android:title="@string/other_sound_settings"
android:key="other_sound_settings"
xmlns:settings="http://schemas.android.com/apk/res-auto">
<!-- Dial pad tones -->
<SwitchPreference
android:key="dial_pad_tones"
android:title="@string/dial_pad_tones_title" />
<!-- Screen locking sounds -->
<SwitchPreference
android:key="screen_locking_sounds"
android:title="@string/screen_locking_sounds_title" />
<!-- Charging sounds -->
<SwitchPreference
android:key="charging_sounds"
android:title="@string/charging_sounds_title" />
<!-- Docking sounds -->
<SwitchPreference
android:key="docking_sounds"
android:title="@string/docking_sounds_title" />
<!-- Touch sounds -->
<SwitchPreference
android:key="touch_sounds"
android:title="@string/touch_sounds_title" />
<!-- Vibrate icon in status bar -->
<SwitchPreference
android:key="vibrate_icon"
android:title="@string/vibrate_icon_title" />
<!-- Dock speaker plays -->
<DropDownPreference
android:key="dock_audio_media"
android:title="@string/dock_audio_media_title"
android:summary="%s" />
<!-- Boot sounds -->
<SwitchPreference
android:key="boot_sounds"
android:title="@string/boot_sounds_title" />
<!-- Emergency tone -->
<DropDownPreference
android:key="emergency_tone"
android:title="@string/emergency_tone_title"
android:summary="%s" />
</PreferenceScreen>

View File

@@ -1,20 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2008 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.
-->
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
android:title="@string/lock_settings_profile_title">
</PreferenceScreen>

View File

@@ -1,21 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2012 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.
-->
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<CheckBoxPreference
android:key="sync_switch"
android:title="@string/sync_automatically" />
</PreferenceScreen>

View File

@@ -1,19 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2014 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.
-->
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
android:key="usage_access_screen"
android:title="@string/usage_access_title"/>

View File

@@ -1,20 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2020 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.
-->
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
android:title="@string/vibrate_when_ringing_title" />

View File

@@ -1,25 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2014 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.
-->
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
android:title="@string/voice_input_settings_title">
<!-- The contents of this category are filled in by the Java code
based on the list of available voice interaction and recognition services. -->
<PreferenceCategory android:key="voice_service_preference_section"
android:title="@string/voice_service_preference_section_title" />
</PreferenceScreen>

View File

@@ -1,30 +0,0 @@
<?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.
-->
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
android:title="@string/wifi_settings_category">
<com.android.settings.bluetooth.BluetoothProgressCategory
android:key="access_points"
android:title="@string/wifi_access_points"
android:persistent="false" />
<Preference
android:key="add_network"
android:title="@string/wifi_add_network"
android:persistent="false" />
</PreferenceScreen>

View File

@@ -1,18 +0,0 @@
<?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.
-->
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
</PreferenceScreen>

View File

@@ -1,255 +0,0 @@
/**
* Copyright (C) 2007 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.
*/
package com.android.settings;
import android.app.Activity;
import android.app.usage.UsageStats;
import android.app.usage.UsageStatsManager;
import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.os.Bundle;
import android.text.format.DateUtils;
import android.util.ArrayMap;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemSelectedListener;
import android.widget.BaseAdapter;
import android.widget.ListView;
import android.widget.Spinner;
import android.widget.TextView;
import java.text.DateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
/**
* Activity to display package usage statistics.
*/
public class UsageStatsActivity extends Activity implements OnItemSelectedListener {
private static final String TAG = "UsageStatsActivity";
private static final boolean localLOGV = false;
private UsageStatsManager mUsageStatsManager;
private LayoutInflater mInflater;
private UsageStatsAdapter mAdapter;
private PackageManager mPm;
public static class AppNameComparator implements Comparator<UsageStats> {
private Map<String, String> mAppLabelList;
AppNameComparator(Map<String, String> appList) {
mAppLabelList = appList;
}
@Override
public final int compare(UsageStats a, UsageStats b) {
String alabel = mAppLabelList.get(a.getPackageName());
String blabel = mAppLabelList.get(b.getPackageName());
return alabel.compareTo(blabel);
}
}
public static class LastTimeUsedComparator implements Comparator<UsageStats> {
@Override
public final int compare(UsageStats a, UsageStats b) {
// return by descending order
return Long.compare(b.getLastTimeUsed(), a.getLastTimeUsed());
}
}
public static class UsageTimeComparator implements Comparator<UsageStats> {
@Override
public final int compare(UsageStats a, UsageStats b) {
return Long.compare(b.getTotalTimeInForeground(), a.getTotalTimeInForeground());
}
}
// View Holder used when displaying views
static class AppViewHolder {
TextView pkgName;
TextView lastTimeUsed;
TextView usageTime;
}
class UsageStatsAdapter extends BaseAdapter {
// Constants defining order for display order
private static final int _DISPLAY_ORDER_USAGE_TIME = 0;
private static final int _DISPLAY_ORDER_LAST_TIME_USED = 1;
private static final int _DISPLAY_ORDER_APP_NAME = 2;
private int mDisplayOrder = _DISPLAY_ORDER_USAGE_TIME;
private LastTimeUsedComparator mLastTimeUsedComparator = new LastTimeUsedComparator();
private UsageTimeComparator mUsageTimeComparator = new UsageTimeComparator();
private AppNameComparator mAppLabelComparator;
private final ArrayMap<String, String> mAppLabelMap = new ArrayMap<>();
private final ArrayList<UsageStats> mPackageStats = new ArrayList<>();
UsageStatsAdapter() {
Calendar cal = Calendar.getInstance();
cal.add(Calendar.DAY_OF_YEAR, -5);
final List<UsageStats> stats =
mUsageStatsManager.queryUsageStats(UsageStatsManager.INTERVAL_BEST,
cal.getTimeInMillis(), System.currentTimeMillis());
if (stats == null) {
return;
}
ArrayMap<String, UsageStats> map = new ArrayMap<>();
final int statCount = stats.size();
for (int i = 0; i < statCount; i++) {
final android.app.usage.UsageStats pkgStats = stats.get(i);
// load application labels for each application
try {
ApplicationInfo appInfo = mPm.getApplicationInfo(pkgStats.getPackageName(), 0);
String label = appInfo.loadLabel(mPm).toString();
mAppLabelMap.put(pkgStats.getPackageName(), label);
UsageStats existingStats =
map.get(pkgStats.getPackageName());
if (existingStats == null) {
map.put(pkgStats.getPackageName(), pkgStats);
} else {
existingStats.add(pkgStats);
}
} catch (NameNotFoundException e) {
// This package may be gone.
}
}
mPackageStats.addAll(map.values());
// Sort list
mAppLabelComparator = new AppNameComparator(mAppLabelMap);
sortList();
}
@Override
public int getCount() {
return mPackageStats.size();
}
@Override
public Object getItem(int position) {
return mPackageStats.get(position);
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
// A ViewHolder keeps references to children views to avoid unneccessary calls
// to findViewById() on each row.
AppViewHolder holder;
// When convertView is not null, we can reuse it directly, there is no need
// to reinflate it. We only inflate a new View when the convertView supplied
// by ListView is null.
if (convertView == null) {
convertView = mInflater.inflate(R.layout.usage_stats_item, null);
// Creates a ViewHolder and store references to the two children views
// we want to bind data to.
holder = new AppViewHolder();
holder.pkgName = (TextView) convertView.findViewById(R.id.package_name);
holder.lastTimeUsed = (TextView) convertView.findViewById(R.id.last_time_used);
holder.usageTime = (TextView) convertView.findViewById(R.id.usage_time);
convertView.setTag(holder);
} else {
// Get the ViewHolder back to get fast access to the TextView
// and the ImageView.
holder = (AppViewHolder) convertView.getTag();
}
// Bind the data efficiently with the holder
UsageStats pkgStats = mPackageStats.get(position);
if (pkgStats != null) {
String label = mAppLabelMap.get(pkgStats.getPackageName());
holder.pkgName.setText(label);
holder.lastTimeUsed.setText(DateUtils.formatSameDayTime(pkgStats.getLastTimeUsed(),
System.currentTimeMillis(), DateFormat.MEDIUM, DateFormat.MEDIUM));
holder.usageTime.setText(
DateUtils.formatElapsedTime(pkgStats.getTotalTimeInForeground() / 1000));
} else {
Log.w(TAG, "No usage stats info for package:" + position);
}
return convertView;
}
void sortList(int sortOrder) {
if (mDisplayOrder == sortOrder) {
// do nothing
return;
}
mDisplayOrder= sortOrder;
sortList();
}
private void sortList() {
if (mDisplayOrder == _DISPLAY_ORDER_USAGE_TIME) {
if (localLOGV) Log.i(TAG, "Sorting by usage time");
Collections.sort(mPackageStats, mUsageTimeComparator);
} else if (mDisplayOrder == _DISPLAY_ORDER_LAST_TIME_USED) {
if (localLOGV) Log.i(TAG, "Sorting by last time used");
Collections.sort(mPackageStats, mLastTimeUsedComparator);
} else if (mDisplayOrder == _DISPLAY_ORDER_APP_NAME) {
if (localLOGV) Log.i(TAG, "Sorting by application name");
Collections.sort(mPackageStats, mAppLabelComparator);
}
notifyDataSetChanged();
}
}
/** Called when the activity is first created. */
@Override
protected void onCreate(Bundle icicle) {
super.onCreate(icicle);
setContentView(R.layout.usage_stats);
mUsageStatsManager = (UsageStatsManager) getSystemService(Context.USAGE_STATS_SERVICE);
mInflater = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);
mPm = getPackageManager();
Spinner typeSpinner = (Spinner) findViewById(R.id.typeSpinner);
typeSpinner.setOnItemSelectedListener(this);
ListView listView = (ListView) findViewById(R.id.pkg_list);
mAdapter = new UsageStatsAdapter();
listView.setAdapter(mAdapter);
}
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
mAdapter.sortList(position);
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
// do nothing
}
}

View File

@@ -28,6 +28,7 @@ import static com.android.settings.accessibility.TextReadingPreferenceFragment.R
import android.content.ComponentName;
import com.android.internal.util.FrameworkStatsLog;
import com.android.settings.core.instrumentation.SettingsStatsLog;
/** Methods for logging accessibility states. */
@@ -112,4 +113,26 @@ public final class AccessibilityStatsLogUtils {
return SettingsStatsLog.ACCESSIBILITY_TEXT_READING_OPTIONS_CHANGED__ENTRY_POINT__TEXT_READING_UNKNOWN_ENTRY;
}
}
/**
* Converts the entering page id where the hearing aid binding process starts for logging.
*
* @param pageId the entry page id where the hearing aid binding process starts
* @return the int value for logging mapped from some page ids defined in
* {@link SettingsStatsLog}
*/
public static int convertToHearingAidInfoBondEntry(int pageId) {
switch (pageId) {
case SettingsStatsLog.SETTINGS_UICHANGED__PAGE_ID__SETTINGS_CONNECTED_DEVICE_CATEGORY:
return FrameworkStatsLog.HEARING_AID_INFO_REPORTED__BOND_ENTRY__CONNECTED_DEVICES;
case SettingsStatsLog.SETTINGS_UICHANGED__PAGE_ID__DIALOG_ACCESSIBILITY_HEARINGAID:
return FrameworkStatsLog.HEARING_AID_INFO_REPORTED__BOND_ENTRY__ACCESSIBILITY_HEARING_AIDS;
case SettingsStatsLog.SETTINGS_UICHANGED__PAGE_ID__DIALOG_ACCESSIBILITY_HEARING_AID_PAIR_ANOTHER:
return FrameworkStatsLog.HEARING_AID_INFO_REPORTED__BOND_ENTRY__ACCESSIBILITY_HEARING_AID_PAIR_ANOTHER;
case SettingsStatsLog.SETTINGS_UICHANGED__PAGE_ID__BLUETOOTH_FRAGMENT:
return FrameworkStatsLog.HEARING_AID_INFO_REPORTED__BOND_ENTRY__BLUETOOTH;
default:
return FrameworkStatsLog.HEARING_AID_INFO_REPORTED__BOND_ENTRY__PAGE_UNKNOWN;
}
}
}

View File

@@ -29,8 +29,11 @@ import android.widget.Toast;
import androidx.annotation.VisibleForTesting;
import com.android.settings.R;
import com.android.settings.accessibility.AccessibilityStatsLogUtils;
import com.android.settings.overlay.FeatureFactory;
import com.android.settingslib.bluetooth.BluetoothDeviceFilter;
import com.android.settingslib.bluetooth.CachedBluetoothDevice;
import com.android.settingslib.bluetooth.HearingAidStatsLogUtils;
import com.android.settingslib.search.Indexable;
import com.android.settingslib.widget.FooterPreference;
@@ -179,6 +182,13 @@ public class BluetoothPairingDetail extends DeviceListPreferenceFragment impleme
// If one device is connected(bonded), then close this fragment.
finish();
return;
} else if (bondState == BluetoothDevice.BOND_BONDING) {
// Set the bond entry where binding process starts for logging hearing aid device info
final int pageId = FeatureFactory.getFactory(
getContext()).getMetricsFeatureProvider().getAttribution(getActivity());
final int bondEntry = AccessibilityStatsLogUtils.convertToHearingAidInfoBondEntry(
pageId);
HearingAidStatsLogUtils.setBondEntryForDevice(bondEntry, cachedDevice);
}
if (mSelectedDevice != null && cachedDevice != null) {
BluetoothDevice device = cachedDevice.getDevice();

View File

@@ -27,6 +27,8 @@ import com.android.settings.overlay.FeatureFactory;
import com.android.settingslib.core.instrumentation.MetricsFeatureProvider;
import com.android.settingslib.utils.ThreadUtils;
import org.jetbrains.annotations.NotNull;
import java.util.ArrayList;
public class DataSaverBackend {
@@ -43,10 +45,11 @@ public class DataSaverBackend {
private boolean mDenylistInitialized;
// TODO: Staticize into only one.
public DataSaverBackend(Context context) {
mContext = context;
mMetricsFeatureProvider = FeatureFactory.getFactory(context).getMetricsFeatureProvider();
mPolicyManager = NetworkPolicyManager.from(context);
public DataSaverBackend(@NotNull Context context) {
// TODO(b/246537614):Use fragment context to DataSaverBackend class will caused memory leak
mContext = context.getApplicationContext();
mMetricsFeatureProvider = FeatureFactory.getFactory(mContext).getMetricsFeatureProvider();
mPolicyManager = NetworkPolicyManager.from(mContext);
}
public void addListener(Listener listener) {

View File

@@ -74,6 +74,7 @@ public class ImeiInfoPreferenceController extends BasePreferenceController {
for (int simSlotNumber = 1; simSlotNumber < mTelephonyManager.getPhoneCount();
simSlotNumber++) {
final Preference multiSimPreference = createNewPreference(screen.getContext());
multiSimPreference.setCopyingEnabled(true);
multiSimPreference.setOrder(imeiPreferenceOrder + simSlotNumber);
multiSimPreference.setKey(getPreferenceKey() + simSlotNumber);
category.addPreference(multiSimPreference);
@@ -150,7 +151,7 @@ public class ImeiInfoPreferenceController extends BasePreferenceController {
private int getPhoneType(int slotIndex) {
SubscriptionInfo subInfo = SubscriptionManager.from(mContext)
.getActiveSubscriptionInfoForSimSlotIndex(slotIndex);
.getActiveSubscriptionInfoForSimSlotIndex(slotIndex);
return mTelephonyManager.getCurrentPhoneType(subInfo != null ? subInfo.getSubscriptionId()
: SubscriptionManager.DEFAULT_SUBSCRIPTION_ID);
}

View File

@@ -21,6 +21,7 @@ import android.content.ComponentName;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.nearby.NearbyManager;
import android.os.Bundle;
import android.provider.Settings;
import android.text.TextUtils;
@@ -34,6 +35,7 @@ import com.android.settings.SettingsPreferenceFragment;
import com.android.settings.search.BaseSearchIndexProvider;
import com.android.settingslib.search.SearchIndexable;
import com.android.settingslib.widget.MainSwitchPreference;
import com.android.settingslib.widget.OnMainSwitchChangeListener;
import java.util.Objects;
@@ -48,14 +50,17 @@ public class FastPairSettingsFragment extends SettingsPreferenceFragment {
private static final String SCAN_SWITCH_KEY = "fast_pair_scan_switch";
private static final String SAVED_DEVICES_PREF_KEY = "saved_devices";
private MainSwitchPreference mMainSwitchPreference;
private OnMainSwitchChangeListener mMainSwitchChangeListener;
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
MainSwitchPreference mainSwitchPreference = Objects.requireNonNull(
mMainSwitchPreference = Objects.requireNonNull(
findPreference(SCAN_SWITCH_KEY));
mainSwitchPreference.setChecked(false);
mMainSwitchChangeListener = (switchView, isChecked) ->
NearbyManager.setFastPairScanEnabled(getContext(), isChecked);
Preference savedDevicePref = Objects.requireNonNull(
findPreference(SAVED_DEVICES_PREF_KEY));
savedDevicePref.setOnPreferenceClickListener(preference -> {
@@ -67,6 +72,19 @@ public class FastPairSettingsFragment extends SettingsPreferenceFragment {
});
}
@Override
public void onResume() {
super.onResume();
mMainSwitchPreference.addOnSwitchChangeListener(mMainSwitchChangeListener);
mMainSwitchPreference.setChecked(NearbyManager.isFastPairScanEnabled(getContext()));
}
@Override
public void onPause() {
super.onPause();
mMainSwitchPreference.removeOnSwitchChangeListener(mMainSwitchChangeListener);
}
@Override
public int getMetricsCategory() {
return SettingsEnums.CONNECTION_DEVICE_ADVANCED_FAST_PAIR;

View File

@@ -1,108 +0,0 @@
/*
* Copyright (C) 2018 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.
*/
package com.android.settings.network;
import android.app.settings.SettingsEnums;
import android.content.Context;
import androidx.annotation.VisibleForTesting;
import androidx.preference.PreferenceCategory;
import androidx.preference.PreferenceScreen;
import com.android.settings.core.BasePreferenceController;
import com.android.settings.wifi.WifiConnectionPreferenceController;
import com.android.settingslib.core.lifecycle.Lifecycle;
/**
* This controls a header at the top of the Network & internet page that only appears when there
* are two or more active mobile subscriptions. It shows an overview of available network
* connections with an entry for wifi (if connected) and an entry for each subscription.
*
* @deprecated This class will be removed in Android U, there is no networks header anymore.
*/
@Deprecated
public class MultiNetworkHeaderController extends BasePreferenceController implements
WifiConnectionPreferenceController.UpdateListener,
SubscriptionsPreferenceController.UpdateListener {
public static final String TAG = "MultiNetworkHdrCtrl";
private WifiConnectionPreferenceController mWifiController;
private SubscriptionsPreferenceController mSubscriptionsController;
private PreferenceCategory mPreferenceCategory;
private PreferenceScreen mPreferenceScreen;
private int mOriginalExpandedChildrenCount;
public MultiNetworkHeaderController(Context context, String key) {
super(context, key);
}
public void init(Lifecycle lifecycle) {
mWifiController = createWifiController(lifecycle);
mSubscriptionsController = createSubscriptionsController(lifecycle);
}
@VisibleForTesting
WifiConnectionPreferenceController createWifiController(Lifecycle lifecycle) {
final int prefOrder = 0;
return new WifiConnectionPreferenceController(mContext, lifecycle, this, mPreferenceKey,
prefOrder, SettingsEnums.SETTINGS_NETWORK_CATEGORY);
}
@VisibleForTesting
SubscriptionsPreferenceController createSubscriptionsController(Lifecycle lifecycle) {
final int prefStartOrder = 10;
return new SubscriptionsPreferenceController(mContext, lifecycle, this, mPreferenceKey,
prefStartOrder);
}
@Override
public void displayPreference(PreferenceScreen screen) {
super.displayPreference(screen);
mPreferenceScreen = screen;
mOriginalExpandedChildrenCount = mPreferenceScreen.getInitialExpandedChildrenCount();
mPreferenceCategory = screen.findPreference(mPreferenceKey);
mPreferenceCategory.setVisible(isAvailable());
mWifiController.displayPreference(screen);
mSubscriptionsController.displayPreference(screen);
}
@Override
public int getAvailabilityStatus() {
if (mSubscriptionsController == null || !mSubscriptionsController.isAvailable()) {
return CONDITIONALLY_UNAVAILABLE;
} else {
return AVAILABLE;
}
}
@Override
public void onChildrenUpdated() {
final boolean available = isAvailable();
// TODO(b/129893781) we need a better way to express where the advanced collapsing starts
// for preference groups that have items dynamically added/removed in the top expanded
// section.
if (mOriginalExpandedChildrenCount != Integer.MAX_VALUE) {
if (available) {
mPreferenceScreen.setInitialExpandedChildrenCount(
mOriginalExpandedChildrenCount + mPreferenceCategory.getPreferenceCount());
} else {
mPreferenceScreen.setInitialExpandedChildrenCount(mOriginalExpandedChildrenCount);
}
}
mPreferenceCategory.setVisible(available);
}
}

View File

@@ -32,10 +32,9 @@ import com.android.settingslib.core.lifecycle.Lifecycle;
* are active mobile subscriptions. It shows an overview of available mobile network
* connections with an entry for each subscription.
*
* {@link NetworkMobileProviderController} is used to show subscription status on internet
* page for provider model. This original class can refer to {@link MultiNetworkHeaderController},
*
*/
* {@link NetworkMobileProviderController} is used to show subscription status on internet
* page for provider model.
*/
public class NetworkMobileProviderController extends BasePreferenceController implements
SubscriptionsPreferenceController.UpdateListener {

View File

@@ -23,9 +23,9 @@ import com.android.settingslib.spa.framework.BrowseActivity
class SpaActivity : BrowseActivity(SpaEnvironment.settingsPageProviders) {
companion object {
@JvmStatic
fun startSpaActivity(context: Context, startDestination: String) {
fun startSpaActivity(context: Context, destination: String) {
val intent = Intent(context, SpaActivity::class.java).apply {
putExtra(KEY_DESTINATION, startDestination)
putExtra(KEY_DESTINATION, destination)
}
context.startActivity(intent)
}

View File

@@ -0,0 +1,49 @@
/*
* Copyright (C) 2022 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.
*/
package com.android.settings.spa
import android.app.Activity
import android.content.pm.PackageManager
import android.content.pm.PackageManager.ComponentInfoFlags
import android.os.Bundle
import com.android.settings.spa.SpaActivity.Companion.startSpaActivity
/**
* Activity used as a bridge to [SpaActivity].
*
* Since [SpaActivity] is not exported, [SpaActivity] could not be the target activity of
* <activity-alias>, otherwise all its pages will be exported.
* So need this bridge activity to sit in the middle of <activity-alias> and [SpaActivity].
*/
class SpaBridgeActivity : Activity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
getDestination()?.let { destination ->
startSpaActivity(this, destination)
}
finish()
}
private fun getDestination(): String? =
packageManager.getActivityInfo(
componentName, ComponentInfoFlags.of(PackageManager.GET_META_DATA.toLong())
).metaData.getString(META_DATA_KEY_DESTINATION)
companion object {
private const val META_DATA_KEY_DESTINATION = "com.android.settings.spa.DESTINATION"
}
}

View File

@@ -0,0 +1,22 @@
/*
* Copyright (C) 2022 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.
*/
package com.android.settings.spa
import com.android.settingslib.spa.framework.DebugActivity
class SpaDebugActivity :
DebugActivity(SpaEnvironment.settingsEntryRepository, SpaActivity::class.java)

View File

@@ -24,11 +24,12 @@ import com.android.settings.spa.app.specialaccess.MediaManagementAppsAppListProv
import com.android.settings.spa.app.specialaccess.ModifySystemSettingsAppListProvider
import com.android.settings.spa.app.specialaccess.PictureInPictureListProvider
import com.android.settings.spa.app.specialaccess.SpecialAppAccessPageProvider
import com.android.settings.spa.development.UsageStatsPageProvider
import com.android.settings.spa.home.HomePageProvider
import com.android.settingslib.spa.framework.common.SettingsEntryRepository
import com.android.settingslib.spa.framework.common.SettingsPage
import com.android.settings.spa.notification.AppListNotificationsPageProvider
import com.android.settings.spa.notification.NotificationMainPageProvider
import com.android.settingslib.spa.framework.common.SettingsEntryRepository
import com.android.settingslib.spa.framework.common.SettingsPage
import com.android.settingslib.spa.framework.common.SettingsPageProviderRepository
import com.android.settingslib.spaprivileged.template.app.TogglePermissionAppListTemplate
@@ -52,6 +53,7 @@ object SpaEnvironment {
SpecialAppAccessPageProvider,
NotificationMainPageProvider,
AppListNotificationsPageProvider,
UsageStatsPageProvider,
) + togglePermissionAppListTemplate.createPageProviders(),
rootPages = listOf(
SettingsPage.create(HomePageProvider.name),

View File

@@ -0,0 +1,52 @@
/*
* Copyright (C) 2022 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.
*/
package com.android.settings.spa.development
import android.os.Bundle
import androidx.compose.runtime.Composable
import androidx.compose.ui.res.stringResource
import com.android.settings.R
import com.android.settingslib.spa.framework.common.SettingsPageProvider
import com.android.settingslib.spa.framework.compose.navigator
import com.android.settingslib.spa.framework.compose.rememberContext
import com.android.settingslib.spa.widget.preference.Preference
import com.android.settingslib.spa.widget.preference.PreferenceModel
import com.android.settingslib.spaprivileged.template.app.AppListItem
import com.android.settingslib.spaprivileged.template.app.AppListPage
object UsageStatsPageProvider : SettingsPageProvider {
override val name = "UsageStats"
@Composable
override fun Page(arguments: Bundle?) {
AppListPage(
title = stringResource(R.string.testing_usage_stats),
listModel = rememberContext(::UsageStatsListModel),
primaryUserOnly = true,
) { itemModel ->
AppListItem(itemModel) {}
}
}
@Composable
fun EntryItem() {
Preference(object : PreferenceModel {
override val title = stringResource(R.string.testing_usage_stats)
override val onClick = navigator(name)
})
}
}

View File

@@ -0,0 +1,101 @@
/*
* Copyright (C) 2022 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.
*/
package com.android.settings.spa.development
import android.app.usage.UsageStats
import android.app.usage.UsageStatsManager
import android.content.Context
import android.content.pm.ApplicationInfo
import android.text.format.DateUtils
import androidx.compose.runtime.Composable
import androidx.compose.runtime.State
import com.android.settings.R
import com.android.settings.spa.development.UsageStatsListModel.SpinnerItem.Companion.toSpinnerItem
import com.android.settingslib.spa.framework.compose.stateOf
import com.android.settingslib.spaprivileged.model.app.AppEntry
import com.android.settingslib.spaprivileged.model.app.AppListModel
import com.android.settingslib.spaprivileged.model.app.AppRecord
import java.text.DateFormat
import java.util.concurrent.TimeUnit
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.combine
import kotlinx.coroutines.flow.map
data class UsageStatsAppRecord(
override val app: ApplicationInfo,
val usageStats: UsageStats?,
) : AppRecord
class UsageStatsListModel(private val context: Context) : AppListModel<UsageStatsAppRecord> {
private val usageStatsManager =
context.getSystemService(Context.USAGE_STATS_SERVICE) as UsageStatsManager
private val now = System.currentTimeMillis()
override fun transform(
userIdFlow: Flow<Int>,
appListFlow: Flow<List<ApplicationInfo>>,
) = userIdFlow.map { getUsageStats() }
.combine(appListFlow) { usageStatsMap, appList ->
appList.map { app -> UsageStatsAppRecord(app, usageStatsMap[app.packageName]) }
}
override fun getSpinnerOptions() = SpinnerItem.values().map {
context.getString(it.stringResId)
}
override fun filter(
userIdFlow: Flow<Int>,
option: Int,
recordListFlow: Flow<List<UsageStatsAppRecord>>,
) = recordListFlow.map { recordList ->
recordList.filter { it.usageStats != null }
}
override fun getComparator(option: Int) = when (option.toSpinnerItem()) {
SpinnerItem.UsageTime -> compareByDescending { it.record.usageStats?.totalTimeInForeground }
SpinnerItem.LastTimeUsed -> compareByDescending { it.record.usageStats?.lastTimeUsed }
else -> compareBy<AppEntry<UsageStatsAppRecord>> { 0 }
}.then(super.getComparator(option))
@Composable
override fun getSummary(option: Int, record: UsageStatsAppRecord): State<String>? {
val usageStats = record.usageStats ?: return null
val lastTimeUsed = DateUtils.formatSameDayTime(
usageStats.lastTimeUsed, now, DateFormat.MEDIUM, DateFormat.MEDIUM)
val lastTimeUsedLine = "${context.getString(R.string.last_time_used_label)}: $lastTimeUsed"
val usageTime = DateUtils.formatElapsedTime(usageStats.totalTimeInForeground / 1000)
val usageTimeLine = "${context.getString(R.string.usage_time_label)}: $usageTime"
return stateOf("$lastTimeUsedLine\n$usageTimeLine")
}
private fun getUsageStats(): Map<String, UsageStats> {
val startTime = now - TimeUnit.DAYS.toMillis(5)
return usageStatsManager.queryUsageStats(UsageStatsManager.INTERVAL_BEST, startTime, now)
.groupingBy { it.packageName }.reduce { _, a, b -> a.add(b); a }
}
private enum class SpinnerItem(val stringResId: Int) {
UsageTime(R.string.usage_stats_sort_by_usage_time),
LastTimeUsed(R.string.usage_stats_sort_by_last_time_used),
AppName(R.string.usage_stats_sort_by_app_name);
companion object {
fun Int.toSpinnerItem(): SpinnerItem = values()[this]
}
}
}

View File

@@ -56,8 +56,9 @@ public class WifiTetherPreferenceController extends AbstractPreferenceController
WifiTetherSoftApManager mWifiTetherSoftApManager;
public WifiTetherPreferenceController(Context context, Lifecycle lifecycle) {
// TODO(b/246537032):Use fragment context to WifiManager service will caused memory leak
this(context, lifecycle,
context.getSystemService(WifiManager.class),
context.getApplicationContext().getSystemService(WifiManager.class),
context.getSystemService(TetheringManager.class),
true /* initSoftApManager */,
WifiEnterpriseRestrictionUtils.isWifiTetheringAllowed(context));

View File

@@ -5,6 +5,7 @@ import android.net.wifi.WifiManager;
import android.os.Handler;
import android.os.HandlerExecutor;
import java.lang.ref.WeakReference;
import java.util.List;
/**
@@ -15,23 +16,14 @@ public class WifiTetherSoftApManager {
private WifiManager mWifiManager;
private WifiTetherSoftApCallback mWifiTetherSoftApCallback;
private WifiManager.SoftApCallback mSoftApCallback = new WifiManager.SoftApCallback() {
@Override
public void onStateChanged(int state, int failureReason) {
mWifiTetherSoftApCallback.onStateChanged(state, failureReason);
}
@Override
public void onConnectedClientsChanged(List<WifiClient> clients) {
mWifiTetherSoftApCallback.onConnectedClientsChanged(clients);
}
};
private WifiManager.SoftApCallback mSoftApCallback;
private Handler mHandler;
WifiTetherSoftApManager(WifiManager wifiManager,
WifiTetherSoftApCallback wifiTetherSoftApCallback) {
mWifiManager = wifiManager;
mWifiTetherSoftApCallback = wifiTetherSoftApCallback;
mSoftApCallback = new WifiManagerSoftApCallback(this);
mHandler = new Handler();
}
@@ -43,6 +35,14 @@ public class WifiTetherSoftApManager {
mWifiManager.unregisterSoftApCallback(mSoftApCallback);
}
void onStateChanged(int state, int failureReason) {
mWifiTetherSoftApCallback.onStateChanged(state, failureReason);
}
void onConnectedClientsChanged(List<WifiClient> clients) {
mWifiTetherSoftApCallback.onConnectedClientsChanged(clients);
}
public interface WifiTetherSoftApCallback {
void onStateChanged(int state, int failureReason);
@@ -53,4 +53,31 @@ public class WifiTetherSoftApManager {
*/
void onConnectedClientsChanged(List<WifiClient> clients);
}
// TODO(b/246537032):Need to declare the service callback as static class and use
// WeakReference to avoid the callback link being occupied by WifiManager
private static final class WifiManagerSoftApCallback implements
WifiManager.SoftApCallback {
WeakReference<WifiTetherSoftApManager> mMyClass;
WifiManagerSoftApCallback(WifiTetherSoftApManager controller) {
mMyClass = new WeakReference<>(controller);
}
@Override
public void onStateChanged(int state, int failureReason) {
WifiTetherSoftApManager controller = mMyClass.get();
if (controller == null) return;
controller.onStateChanged(state, failureReason);
}
@Override
public void onConnectedClientsChanged(List<WifiClient> clients) {
WifiTetherSoftApManager controller = mMyClass.get();
if (controller == null) return;
controller.onConnectedClientsChanged(clients);
}
}
}

View File

@@ -1,23 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2017 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.
-->
<ripple
xmlns:android="http://schemas.android.com/apk/res/android"
android:color="?android:attr/colorControlHighlight">
<!-- Overlay this since Robolectric has trouble inflating ?android:attr/colorBackground -->
<item android:drawable="@android:color/transparent"/>
</ripple>

View File

@@ -1,173 +0,0 @@
/*
* Copyright (C) 2020 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.
*/
package com.android.settings.network;
import static com.google.common.truth.Truth.assertThat;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.when;
import android.content.Context;
import android.os.Looper;
import android.telephony.SubscriptionManager;
import androidx.preference.PreferenceCategory;
import androidx.preference.PreferenceManager;
import androidx.preference.PreferenceScreen;
import androidx.test.core.app.ApplicationProvider;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import com.android.settings.wifi.WifiConnectionPreferenceController;
import com.android.settingslib.core.lifecycle.Lifecycle;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
@RunWith(AndroidJUnit4.class)
public class MultiNetworkHeaderControllerTest {
private static final String KEY_HEADER = "multi_network_header";
private static final int EXPANDED_CHILDREN_COUNT = 5;
@Mock
private PreferenceCategory mPreferenceCategory;
@Mock
private WifiConnectionPreferenceController mWifiController;
@Mock
private SubscriptionsPreferenceController mSubscriptionsController;
@Mock
private SubscriptionManager mSubscriptionManager;
@Mock
private Lifecycle mLifecycle;
private Context mContext;
private PreferenceManager mPreferenceManager;
private PreferenceScreen mPreferenceScreen;
private MultiNetworkHeaderController mHeaderController;
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
mContext = spy(ApplicationProvider.getApplicationContext());
when(mContext.getSystemService(SubscriptionManager.class)).thenReturn(mSubscriptionManager);
mHeaderController = new MultiNetworkHeaderController(mContext, KEY_HEADER) {
@Override
WifiConnectionPreferenceController createWifiController(Lifecycle lifecycle) {
return mWifiController;
}
@Override
SubscriptionsPreferenceController createSubscriptionsController(Lifecycle lifecycle) {
return mSubscriptionsController;
}
};
if (Looper.myLooper() == null) {
Looper.prepare();
}
mPreferenceManager = new PreferenceManager(mContext);
mPreferenceScreen = mPreferenceManager.createPreferenceScreen(mContext);
mPreferenceScreen.setInitialExpandedChildrenCount(EXPANDED_CHILDREN_COUNT);
when(mPreferenceCategory.getKey()).thenReturn(KEY_HEADER);
when(mPreferenceCategory.getPreferenceCount()).thenReturn(3);
mPreferenceScreen.addPreference(mPreferenceCategory);
}
@Test
public void isAvailable_beforeInitIsCalled_notAvailable() {
assertThat(mHeaderController.isAvailable()).isFalse();
}
// When calling displayPreference, the header itself should only be visible if the
// subscriptions controller says it is available. This is a helper for test cases of this logic.
private void displayPreferenceTest(boolean wifiAvailable, boolean subscriptionsAvailable,
boolean setVisibleExpectedValue) {
when(mWifiController.isAvailable()).thenReturn(wifiAvailable);
when(mSubscriptionsController.isAvailable()).thenReturn(subscriptionsAvailable);
mHeaderController.init(mLifecycle);
mHeaderController.displayPreference(mPreferenceScreen);
Assert.assertEquals(mPreferenceCategory.isVisible(), setVisibleExpectedValue);
}
@Test
public void displayPreference_bothNotAvailable_categoryIsNotVisible() {
displayPreferenceTest(false, false, false);
}
@Test
public void displayPreference_wifiAvailableButNotSubscriptions_categoryIsNotVisible() {
displayPreferenceTest(true, false, false);
}
@Test
public void displayPreference_subscriptionsAvailableButNotWifi_categoryIsVisible() {
displayPreferenceTest(false, true, true);
}
@Test
public void displayPreference_bothAvailable_categoryIsVisible() {
displayPreferenceTest(true, true, true);
}
@Test
public void onChildUpdated_subscriptionsBecameAvailable_categoryIsVisible() {
when(mSubscriptionsController.isAvailable()).thenReturn(false);
mHeaderController.init(mLifecycle);
mHeaderController.displayPreference(mPreferenceScreen);
when(mSubscriptionsController.isAvailable()).thenReturn(true);
mHeaderController.onChildrenUpdated();
Assert.assertTrue(mPreferenceCategory.isVisible());
assertThat(mPreferenceScreen.getInitialExpandedChildrenCount()).isEqualTo(
EXPANDED_CHILDREN_COUNT + mPreferenceCategory.getPreferenceCount());
}
@Test
public void onChildUpdated_subscriptionsBecameUnavailable_categoryIsNotVisible() {
when(mSubscriptionsController.isAvailable()).thenReturn(true);
mHeaderController.init(mLifecycle);
mHeaderController.displayPreference(mPreferenceScreen);
when(mSubscriptionsController.isAvailable()).thenReturn(false);
mHeaderController.onChildrenUpdated();
Assert.assertFalse(mPreferenceCategory.isVisible());
assertThat(mPreferenceScreen.getInitialExpandedChildrenCount()).isEqualTo(
EXPANDED_CHILDREN_COUNT);
}
@Test
public void onChildUpdated_noExpandedChildCountAndAvailable_doesNotSetExpandedCount() {
mPreferenceScreen.setInitialExpandedChildrenCount(Integer.MAX_VALUE);
when(mSubscriptionsController.isAvailable()).thenReturn(false);
mHeaderController.init(mLifecycle);
mHeaderController.displayPreference(mPreferenceScreen);
when(mSubscriptionsController.isAvailable()).thenReturn(true);
mHeaderController.onChildrenUpdated();
// Check that setInitialExpandedChildrenCount was never called.
Assert.assertEquals(mPreferenceScreen.getInitialExpandedChildrenCount(), Integer.MAX_VALUE);
}
}

View File

@@ -49,8 +49,7 @@ import org.mockito.MockitoAnnotations;
* Unit test for NetworkMobileProviderController.
*
* {@link NetworkMobileProviderController} is used to show subscription status on internet page for
* provider model. This original class can refer to {@link MultiNetworkHeaderController}, and
* NetworkMobileProviderControllerTest can also refer to {@link MultiNetworkHeaderControllerTest}.
* provider model.
*/
@RunWith(AndroidJUnit4.class)
public class NetworkMobileProviderControllerTest {