Make the show/hide system setting for recent location acccesses sticky.

This is in order to align the location indicator with the list of recent
accesses shown in Settings.

Bug: 191503437
Test: manual
Change-Id: I7aaa65390567ca644e7137de15c558cdcdb29935
This commit is contained in:
Kate Montgomery
2022-01-19 18:15:28 +00:00
parent d0e27f8dbd
commit 14e6c73687
6 changed files with 64 additions and 16 deletions

View File

@@ -20,6 +20,7 @@ import static com.android.settings.location.RecentLocationAccessPreferenceContro
import android.content.Context;
import android.os.UserManager;
import android.provider.Settings;
import androidx.preference.Preference;
import androidx.preference.PreferenceScreen;
@@ -43,6 +44,8 @@ public class RecentLocationAccessSeeAllPreferenceController
public RecentLocationAccessSeeAllPreferenceController(Context context, String key) {
super(context, key);
mShowSystem = Settings.Secure.getInt(mContext.getContentResolver(),
Settings.Secure.LOCATION_SHOW_SYSTEM_OPS, 0) == 1;
mRecentLocationAccesses = RecentAppOpsAccess.createForLocation(context);
}