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

Commit 26387474 authored by Sudheer Shanka's avatar Sudheer Shanka Committed by Android (Google) Code Review
Browse files

Merge "Add padlocks to more qs tiles."

parents f2021435 b6fc9312
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package com.android.systemui.qs;

import android.app.ActivityManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
@@ -23,7 +24,6 @@ import android.graphics.drawable.Drawable;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.os.UserHandle;
import android.util.Log;
import android.util.SparseArray;
import android.view.View;
@@ -271,7 +271,7 @@ public abstract class QSTile<TState extends State> implements Listenable {

    protected void checkIfRestrictionEnforced(State state, String userRestriction) {
        EnforcedAdmin admin = RestrictedLockUtils.checkIfRestrictionEnforced(mContext,
                userRestriction, UserHandle.myUserId());
                userRestriction, ActivityManager.getCurrentUser());
        if (admin != null) {
            state.disabledByPolicy = true;
            state.enforcedAdmin = admin;
+4 −0
Original line number Diff line number Diff line
@@ -78,6 +78,10 @@ public class BluetoothTile extends QSTile<QSTile.BooleanState> {

    @Override
    protected void handleClick() {
        if (!mController.canConfigBluetooth()) {
            mHost.startActivityDismissingKeyguard(new Intent(Settings.ACTION_BLUETOOTH_SETTINGS));
            return;
        }
        if (!mState.value) {
            mState.value = true;
            mController.setBluetoothEnabled(true);
+4 −0
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@

package com.android.systemui.qs.tiles;

import android.os.UserManager;

import com.android.internal.logging.MetricsLogger;
import com.android.internal.logging.MetricsProto.MetricsEvent;
import com.android.systemui.R;
@@ -66,6 +68,8 @@ public class HotspotTile extends QSTile<QSTile.BooleanState> {
    protected void handleUpdateState(BooleanState state, Object arg) {
        state.label = mContext.getString(R.string.quick_settings_hotspot_label);

        state.disabledByPolicy = mController.isTetheringAllowed();
        checkIfRestrictionEnforced(state, UserManager.DISALLOW_CONFIG_TETHERING);
        if (arg instanceof Boolean) {
            state.value = (boolean) arg;
        } else {
+4 −0
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@

package com.android.systemui.qs.tiles;

import android.os.UserManager;

import com.android.internal.logging.MetricsLogger;
import com.android.internal.logging.MetricsProto.MetricsEvent;
import com.android.systemui.R;
@@ -85,6 +87,8 @@ public class LocationTile extends QSTile<QSTile.BooleanState> {
        // bug is fixed, this should be reverted to only hiding it on secure lock screens:
        // state.visible = !(mKeyguard.isSecure() && mKeyguard.isShowing());
        state.value = locationEnabled;
        state.disabledByPolicy = mController.isUserLocationRestricted();
        checkIfRestrictionEnforced(state, UserManager.DISALLOW_SHARE_LOCATION);
        if (locationEnabled) {
            state.icon = mEnable;
            state.label = mContext.getString(R.string.quick_settings_location_label);
+1 −0
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@ public interface BluetoothController {
    Collection<CachedBluetoothDevice> getDevices();
    void connect(CachedBluetoothDevice device);
    void disconnect(CachedBluetoothDevice device);
    boolean canConfigBluetooth();

    public interface Callback {
        void onBluetoothStateChange(boolean enabled);
Loading