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

Commit fe9420f7 authored by Lifu Tang's avatar Lifu Tang
Browse files

Shows LGAAYL when launching Location Settings

- Partial fix of b/10897468

Change-Id: Iec96909b87e71869c5a020ce848c6cf4fada3616
parent e2b0278f
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;
        }
    }