Loading location/java/android/location/LocationManager.java +37 −0 Original line number Diff line number Diff line Loading @@ -346,6 +346,43 @@ public class LocationManager { */ public static final String EXTRA_GNSS_CAPABILITIES = "android.location.extra.GNSS_CAPABILITIES"; /** * Broadcast intent action for Settings app to inject a footer at the bottom of location * settings. This is for use only by apps that are included in the system image. * * <p>To inject a footer to location settings, you must declare a broadcast receiver for * this action in the manifest: * <pre> * <receiver android:name="com.example.android.footer.MyFooterInjector"> * <intent-filter> * <action android:name="com.android.settings.location.INJECT_FOOTER" /> * </intent-filter> * <meta-data * android:name="com.android.settings.location.FOOTER_STRING" * android:resource="@string/my_injected_footer_string" /> * </receiver> * </pre> * * <p>This broadcast receiver will never actually be invoked. See also * {#METADATA_SETTINGS_FOOTER_STRING}. * * @hide */ public static final String SETTINGS_FOOTER_DISPLAYED_ACTION = "com.android.settings.location.DISPLAYED_FOOTER"; /** * Metadata name for {@link LocationManager#SETTINGS_FOOTER_DISPLAYED_ACTION} broadcast * receivers to specify a string resource id as location settings footer text. This is for use * only by apps that are included in the system image. * * <p>See {@link #SETTINGS_FOOTER_DISPLAYED_ACTION} for more detail on how to use. * * @hide */ public static final String METADATA_SETTINGS_FOOTER_STRING = "com.android.settings.location.FOOTER_STRING"; private static final long MAX_SINGLE_LOCATION_TIMEOUT_MS = 30 * 1000; private static final String CACHE_KEY_LOCATION_ENABLED_PROPERTY = Loading packages/SettingsLib/FooterPreference/res/layout-v31/preference_footer.xml 0 → 100644 +55 −0 Original line number Diff line number Diff line <?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. --> <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:paddingStart="?android:attr/listPreferredItemPaddingStart" android:paddingEnd="?android:attr/listPreferredItemPaddingEnd" android:background="?android:attr/selectableItemBackground" android:orientation="vertical" android:clipToPadding="false"> <LinearLayout android:id="@+id/icon_frame" android:layout_width="wrap_content" android:layout_height="wrap_content" android:minWidth="56dp" android:gravity="start|top" android:orientation="horizontal" android:paddingEnd="12dp" android:paddingTop="16dp" android:paddingBottom="4dp"> <ImageView android:id="@android:id/icon" android:layout_width="wrap_content" android:layout_height="wrap_content"/> </LinearLayout> <com.android.settingslib.widget.LinkTextView android:id="@android:id/title" android:layout_width="wrap_content" android:layout_height="wrap_content" android:paddingBottom="16dp" android:paddingTop="16dp" android:maxLines="10" android:textColor="?android:attr/textColorSecondary" android:ellipsize="marquee" /> </LinearLayout> No newline at end of file packages/SettingsLib/FooterPreference/res/layout/preference_footer.xml +0 −1 Original line number Diff line number Diff line Loading @@ -23,7 +23,6 @@ android:paddingStart="?android:attr/listPreferredItemPaddingStart" android:paddingEnd="?android:attr/listPreferredItemPaddingEnd" android:background="?android:attr/selectableItemBackground" android:orientation="vertical" android:clipToPadding="false"> <LinearLayout Loading packages/SettingsLib/MainSwitchPreference/res/drawable/track_on.xml→packages/SettingsLib/MainSwitchPreference/res/drawable/switch_bar_bg_disabled.xml +10 −10 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- Copyright (C) 2020 The Android Open Source Project 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. Loading @@ -15,12 +15,12 @@ limitations under the License. --> <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="@drawable/track_on_background" /> <item android:width="13.19dp" android:height="10.06dp" android:gravity="center" android:right="21dp" android:drawable="@drawable/track_on_indicator" /> </layer-list> <ripple xmlns:android="http://schemas.android.com/apk/res/android" android:color="?android:attr/colorControlHighlight"> <item> <shape android:shape="rectangle"> <solid android:color="@color/state_off_color"/> <corners android:radius="@dimen/switch_bar_radius"/> </shape> </item> </ripple> packages/SettingsLib/MainSwitchPreference/res/drawable/track_off_indicator.xml→packages/SettingsLib/MainSwitchPreference/res/drawable/switch_bar_bg_off.xml +10 −18 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- Copyright (C) 2020 The Android Open Source Project 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. Loading @@ -15,20 +15,12 @@ limitations under the License. --> <vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="13.33dp" android:height="1.67dp" android:viewportWidth="13.33" android:viewportHeight="1.67"> <group> <clip-path android:pathData="M0 0H13.3333V1.66667H0V0Z" /> <path android:pathData="M0 0V1.66667H13.3333V0" android:fillColor="@android:color/white" /> </group> </vector> <ripple xmlns:android="http://schemas.android.com/apk/res/android" android:color="?android:attr/colorControlHighlight"> <item> <shape android:shape="rectangle"> <solid android:color="@color/state_off_color"/> <corners android:radius="@dimen/switch_bar_radius"/> </shape> </item> </ripple> Loading
location/java/android/location/LocationManager.java +37 −0 Original line number Diff line number Diff line Loading @@ -346,6 +346,43 @@ public class LocationManager { */ public static final String EXTRA_GNSS_CAPABILITIES = "android.location.extra.GNSS_CAPABILITIES"; /** * Broadcast intent action for Settings app to inject a footer at the bottom of location * settings. This is for use only by apps that are included in the system image. * * <p>To inject a footer to location settings, you must declare a broadcast receiver for * this action in the manifest: * <pre> * <receiver android:name="com.example.android.footer.MyFooterInjector"> * <intent-filter> * <action android:name="com.android.settings.location.INJECT_FOOTER" /> * </intent-filter> * <meta-data * android:name="com.android.settings.location.FOOTER_STRING" * android:resource="@string/my_injected_footer_string" /> * </receiver> * </pre> * * <p>This broadcast receiver will never actually be invoked. See also * {#METADATA_SETTINGS_FOOTER_STRING}. * * @hide */ public static final String SETTINGS_FOOTER_DISPLAYED_ACTION = "com.android.settings.location.DISPLAYED_FOOTER"; /** * Metadata name for {@link LocationManager#SETTINGS_FOOTER_DISPLAYED_ACTION} broadcast * receivers to specify a string resource id as location settings footer text. This is for use * only by apps that are included in the system image. * * <p>See {@link #SETTINGS_FOOTER_DISPLAYED_ACTION} for more detail on how to use. * * @hide */ public static final String METADATA_SETTINGS_FOOTER_STRING = "com.android.settings.location.FOOTER_STRING"; private static final long MAX_SINGLE_LOCATION_TIMEOUT_MS = 30 * 1000; private static final String CACHE_KEY_LOCATION_ENABLED_PROPERTY = Loading
packages/SettingsLib/FooterPreference/res/layout-v31/preference_footer.xml 0 → 100644 +55 −0 Original line number Diff line number Diff line <?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. --> <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:paddingStart="?android:attr/listPreferredItemPaddingStart" android:paddingEnd="?android:attr/listPreferredItemPaddingEnd" android:background="?android:attr/selectableItemBackground" android:orientation="vertical" android:clipToPadding="false"> <LinearLayout android:id="@+id/icon_frame" android:layout_width="wrap_content" android:layout_height="wrap_content" android:minWidth="56dp" android:gravity="start|top" android:orientation="horizontal" android:paddingEnd="12dp" android:paddingTop="16dp" android:paddingBottom="4dp"> <ImageView android:id="@android:id/icon" android:layout_width="wrap_content" android:layout_height="wrap_content"/> </LinearLayout> <com.android.settingslib.widget.LinkTextView android:id="@android:id/title" android:layout_width="wrap_content" android:layout_height="wrap_content" android:paddingBottom="16dp" android:paddingTop="16dp" android:maxLines="10" android:textColor="?android:attr/textColorSecondary" android:ellipsize="marquee" /> </LinearLayout> No newline at end of file
packages/SettingsLib/FooterPreference/res/layout/preference_footer.xml +0 −1 Original line number Diff line number Diff line Loading @@ -23,7 +23,6 @@ android:paddingStart="?android:attr/listPreferredItemPaddingStart" android:paddingEnd="?android:attr/listPreferredItemPaddingEnd" android:background="?android:attr/selectableItemBackground" android:orientation="vertical" android:clipToPadding="false"> <LinearLayout Loading
packages/SettingsLib/MainSwitchPreference/res/drawable/track_on.xml→packages/SettingsLib/MainSwitchPreference/res/drawable/switch_bar_bg_disabled.xml +10 −10 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- Copyright (C) 2020 The Android Open Source Project 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. Loading @@ -15,12 +15,12 @@ limitations under the License. --> <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="@drawable/track_on_background" /> <item android:width="13.19dp" android:height="10.06dp" android:gravity="center" android:right="21dp" android:drawable="@drawable/track_on_indicator" /> </layer-list> <ripple xmlns:android="http://schemas.android.com/apk/res/android" android:color="?android:attr/colorControlHighlight"> <item> <shape android:shape="rectangle"> <solid android:color="@color/state_off_color"/> <corners android:radius="@dimen/switch_bar_radius"/> </shape> </item> </ripple>
packages/SettingsLib/MainSwitchPreference/res/drawable/track_off_indicator.xml→packages/SettingsLib/MainSwitchPreference/res/drawable/switch_bar_bg_off.xml +10 −18 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- Copyright (C) 2020 The Android Open Source Project 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. Loading @@ -15,20 +15,12 @@ limitations under the License. --> <vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="13.33dp" android:height="1.67dp" android:viewportWidth="13.33" android:viewportHeight="1.67"> <group> <clip-path android:pathData="M0 0H13.3333V1.66667H0V0Z" /> <path android:pathData="M0 0V1.66667H13.3333V0" android:fillColor="@android:color/white" /> </group> </vector> <ripple xmlns:android="http://schemas.android.com/apk/res/android" android:color="?android:attr/colorControlHighlight"> <item> <shape android:shape="rectangle"> <solid android:color="@color/state_off_color"/> <corners android:radius="@dimen/switch_bar_radius"/> </shape> </item> </ripple>