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

Commit 741bc054 authored by Lifu Tang's avatar Lifu Tang Committed by Android (Google) Code Review
Browse files

Merge "Shows LGAAYL when launching Location Settings" into klp-dev

parents 5b7111d0 fe9420f7
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -55,11 +55,15 @@ import java.util.HashSet;
/** Manages settings for Google Account. */
public class ManageAccountsSettings extends AccountPreferenceBase
        implements OnAccountsUpdateListener {

    private static final String ACCOUNT_KEY = "account"; // to pass to auth settings
    public static final String KEY_ACCOUNT_TYPE = "account_type";
    public static final String KEY_ACCOUNT_LABEL = "account_label";

    // Action name for the broadcast intent when the Google account preferences page is launching
    // the location settings.
    private static final String LAUNCHING_LOCATION_SETTINGS =
            "com.android.settings.accounts.LAUNCHING_LOCATION_SETTINGS";

    private static final int MENU_SYNC_NOW_ID = Menu.FIRST;
    private static final int MENU_SYNC_CANCEL_ID    = Menu.FIRST + 1;

@@ -366,6 +370,13 @@ public class ManageAccountsSettings extends AccountPreferenceBase
        public boolean onPreferenceClick(Preference preference) {
            ((PreferenceActivity) getActivity()).startPreferencePanel(
                    mClass, null, mTitleRes, null, null, 0);
            // Hack: announce that the Google account preferences page is launching the location
            // settings
            if (mClass.equals(LocationSettings.class.getName())) {
                Intent intent = new Intent(LAUNCHING_LOCATION_SETTINGS);
                getActivity().sendBroadcast(
                        intent, android.Manifest.permission.WRITE_SECURE_SETTINGS);
            }
            return true;
        }
    }