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

Commit e4f75f0e authored by Han Wang's avatar Han Wang Committed by Rashed Abdel-Tawab
Browse files

LiveDisplayTile: Report unavailable on HWC2

Change-Id: Ic10381e25046a2338bc6bda36ecbb5d5cefc1ab8
parent 710ae2ec
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
/*
 * Copyright (C) 2015 The CyanogenMod Project
 * Copyright (C) 2018 The LineageOS Project
 * Copyright (C) 2018-2019 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.
@@ -32,6 +32,7 @@ import android.os.UserHandle;
import android.provider.Settings;
import android.service.quicksettings.Tile;

import com.android.internal.app.ColorDisplayController;
import com.android.internal.util.ArrayUtils;
import com.android.systemui.plugins.qs.QSTile.LiveDisplayState;
import com.android.systemui.qs.QSHost;
@@ -103,6 +104,11 @@ public class LiveDisplayTile extends QSTileImpl<LiveDisplayState> {
        mValues = res.getStringArray(R.array.live_display_values);
    }

    @Override
    public boolean isAvailable() {
        return !ColorDisplayController.isAvailable(mContext);
    }

    @Override
    public LiveDisplayState newTileState() {
        return new LiveDisplayState();