Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e7ff0891 authored by Raff Tsai's avatar Raff Tsai Committed by Android (Google) Code Review
Browse files

Merge "Separate personal/work tab in LocationSettings"

parents 2280fe5c 5089629b
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -3770,6 +3770,8 @@
    <string name="location_recent_location_requests_see_all">See all</string>
    <!-- Location settings screen, sub category for location services [CHAR LIMIT=30] -->
    <string name="location_category_location_services">Location services</string>
    <!-- Location settings screen, sub category for recent work profile app location requests [CHAR LIMIT=NONE] -->
    <string name="location_category_recent_location_work_requests">Recent work app location requests</string>
    <!-- Security & location settings screen, section header for settings relating to location -->
    <string name="location_title">My Location</string>
+2 −1
Original line number Diff line number Diff line
@@ -72,7 +72,8 @@
        <!-- This preference gets removed if there is no managed profile -->
        <PreferenceCategory
            android:key="location_services_managed_profile"
            android:title="@string/managed_profile_location_services"/>
            android:title="@string/managed_profile_location_services"
            settings:controller="com.android.settings.location.LocationServiceForWorkPreferenceController"/>

    </PreferenceCategory>

+71 −0
Original line number Diff line number Diff line
<?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
  -->

<PreferenceScreen
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:settings="http://schemas.android.com/apk/res-auto"
    android:key="location_settings"
    android:title="@string/location_settings_title"
    settings:keywords="@string/keywords_location">

    <PreferenceCategory
        android:key="recent_location_requests"
        android:title="@string/location_category_recent_location_requests"
        settings:controller="com.android.settings.location.RecentLocationRequestPreferenceController"/>

    <Preference
        android:key="recent_location_requests_see_all_button"
        android:title="@string/location_recent_location_requests_see_all"
        android:icon="@drawable/ic_chevron_right_24dp"
        android:fragment="com.android.settings.location.RecentLocationRequestSeeAllFragment"
        settings:searchable="false"/>

    <PreferenceCategory
        android:key="location_advanced_settings"
        android:layout="@layout/preference_category_no_label"
        settings:initialExpandedChildrenCount="2">

        <!-- This preference category gets removed if new_recent_location_ui is disabled -->
        <Preference
            android:key="app_level_permissions"
            android:title="@string/location_app_level_permissions"
            settings:controller="com.android.settings.location.AppLocationPermissionPreferenceController">
        <intent android:action="android.intent.action.MANAGE_PERMISSION_APPS">
                <extra android:name="android.intent.extra.PERMISSION_NAME"
                       android:value="android.permission-group.LOCATION"/>
            </intent>
        </Preference>

        <Preference
            android:key="location_scanning"
            android:title="@string/location_scanning_screen_title"
            android:fragment="com.android.settings.location.ScanningSettings"
            settings:controller="com.android.settings.location.LocationScanningPreferenceController"/>

        <PreferenceCategory
            android:key="location_services"
            android:layout="@layout/preference_category_no_label"
            settings:controller="com.android.settings.location.LocationServicePreferenceController"/>

    </PreferenceCategory>

    <PreferenceCategory
        android:key="location_footer"
        android:layout="@layout/preference_category_no_label"
        settings:allowDividerAbove="false"
        settings:controller="com.android.settings.location.LocationFooterPreferenceController"/>
</PreferenceScreen>
+74 −0
Original line number Diff line number Diff line
<?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
  -->

<PreferenceScreen
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:settings="http://schemas.android.com/apk/res-auto"
    android:key="location_settings"
    android:title="@string/location_settings_title"
    settings:keywords="@string/keywords_location">

    <com.android.settingslib.RestrictedSwitchPreference
        android:key="managed_profile_location_switch"
        android:title="@string/managed_profile_location_switch_title"
        settings:useAdminDisabledSummary="true"
        settings:controller="com.android.settings.location.LocationForWorkPreferenceController"
        android:enabled="false"
        android:selectable="true"/>

    <PreferenceCategory
        android:key="recent_location_requests"
        android:title="@string/location_category_recent_location_work_requests"
        settings:controller="com.android.settings.location.RecentLocationRequestPreferenceController"/>

    <Preference
        android:key="recent_location_requests_see_all_button"
        android:title="@string/location_recent_location_requests_see_all"
        android:icon="@drawable/ic_chevron_right_24dp"
        android:fragment="com.android.settings.location.RecentLocationRequestSeeAllFragment"
        settings:searchable="false"/>

    <PreferenceCategory
        android:key="location_advanced_settings"
        android:layout="@layout/preference_category_no_label"
        settings:initialExpandedChildrenCount="2">

        <!-- This preference category gets removed if new_recent_location_ui is disabled -->
        <Preference
            android:key="app_level_permissions"
            android:title="@string/location_app_level_permissions"
            settings:controller="com.android.settings.location.AppLocationPermissionPreferenceController">
            <intent android:action="android.intent.action.MANAGE_PERMISSION_APPS">
                <extra android:name="android.intent.extra.PERMISSION_NAME"
                       android:value="android.permission-group.LOCATION"/>
            </intent>
        </Preference>

        <PreferenceCategory
            android:title="@string/managed_profile_location_services"
            android:layout="@layout/preference_category_no_label"
            android:key="location_services_managed_profile"
            settings:controller="com.android.settings.location.LocationServiceForWorkPreferenceController"/>

    </PreferenceCategory>

    <PreferenceCategory
        android:key="location_footer"
        android:layout="@layout/preference_category_no_label"
        settings:allowDividerAbove="false"
        settings:controller="com.android.settings.location.LocationFooterPreferenceController"/>
</PreferenceScreen>
+1 −1
Original line number Diff line number Diff line
@@ -41,7 +41,7 @@ public class AccountWorkProfileDashboardFragment extends DashboardFragment {

    @Override
    public int getMetricsCategory() {
        return SettingsEnums.ACCOUNT;
        return SettingsEnums.ACCOUNT_WORK;
    }

    @Override
Loading