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

Commit a6a57637 authored by Michael W's avatar Michael W Committed by Harry Youd
Browse files

LocationTile: Behave like other tiles

* Behave equal to WiFi and Bluetooth Tiles:
  Secondary click enables and disables location

Change-Id: I9767b9f2e812f85c664ff7721ff3d8dc9ba54aca
parent f61b7786
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2014 The Android Open Source Project
 * Copyright (C) 2016 The ParanoidAndroid Project
 * Copyright (C) 2017 The LineageOS Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
@@ -109,6 +110,13 @@ public class LocationTile extends QSTile<QSTile.BooleanState> {
        showDetail(true);
    }

    @Override
    protected void handleSecondaryClick() {
        final boolean wasEnabled = mState.value;
        MetricsLogger.action(mContext, getMetricsCategory(), !wasEnabled);
        mController.setLocationEnabled(!wasEnabled);
    }

    @Override
    public CharSequence getTileLabel() {
        return mContext.getString(R.string.quick_settings_location_label);