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

Commit f383cb44 authored by Wei Wang's avatar Wei Wang
Browse files

Use location access for recent location apps.

Bug: 177685444
Test: Manual

Change-Id: Id22ce156b20b66cf0607879ea0f9f874b621894d
parent 478db865
Loading
Loading
Loading
Loading
+4 −10
Original line number Diff line number Diff line
@@ -22,16 +22,10 @@
    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"/>
        android:key="recent_location_access"
        android:title="@string/location_category_recent_location_access"
        settings:controller=
            "com.android.settings.location.RecentLocationAccessPreferenceController"/>

    <PreferenceCategory
        android:key="location_advanced_settings"
+2 −8
Original line number Diff line number Diff line
@@ -25,14 +25,8 @@
    <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"/>
        settings:controller=
            "com.android.settings.location.RecentLocationAccessPreferenceController"/>

    <!-- This preference category gets removed if new_recent_location_ui is disabled -->
    <Preference
+2 −10
Original line number Diff line number Diff line
@@ -25,16 +25,8 @@
    <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:controller="com.android.settings.core.WorkPreferenceController"
        settings:forWork="true"
        settings:searchable="false"/>
        settings:controller=
            "com.android.settings.location.RecentLocationAccessPreferenceController"/>

    <com.android.settingslib.RestrictedSwitchPreference
        android:key="managed_profile_location_switch"
+1 −1
Original line number Diff line number Diff line
@@ -82,7 +82,7 @@ public class LocationSettings extends DashboardFragment {
        super.onAttach(context);

        use(AppLocationPermissionPreferenceController.class).init(this);
        use(RecentLocationRequestPreferenceController.class).init(this);
        use(RecentLocationAccessPreferenceController.class).init(this);
        use(LocationServicePreferenceController.class).init(this);
        use(LocationFooterPreferenceController.class).init(this);
        use(LocationForWorkPreferenceController.class).init(this);
+2 −5
Original line number Diff line number Diff line
@@ -21,7 +21,6 @@ import android.content.Context;

import com.android.settings.R;
import com.android.settings.dashboard.DashboardFragment;
import com.android.settings.dashboard.profileselector.ProfileSelectFragment;

/**
 * Location Setting page for managed profile.
@@ -54,11 +53,9 @@ public class LocationWorkProfileSettings extends DashboardFragment {
        use(LocationFooterPreferenceController.class).init(this);
        use(LocationForWorkPreferenceController.class).init(this);

        final int profileType = getArguments().getInt(ProfileSelectFragment.EXTRA_PROFILE);
        final RecentLocationRequestPreferenceController controller = use(
                RecentLocationRequestPreferenceController.class);
        final RecentLocationAccessPreferenceController controller =
                use(RecentLocationAccessPreferenceController.class);
        controller.init(this);
        controller.setProfileType(profileType);
    }

    @Override
Loading