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

Unverified Commit 9b41d790 authored by LuK1337's avatar LuK1337
Browse files

PowerShareTile: Mark is unavailable if enabled state can't be read

Change-Id: I6e043a9fd4e440377691f94ca83946f3e213e672
parent efa267fe
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -142,7 +142,13 @@ public class PowerShareTile extends QSTileImpl<BooleanState>

    @Override
    public boolean isAvailable() {
        return mPowerShare != null;
        try {
            // Will throw NPE or some other exception if HAL is either missing or broken.
            mPowerShare.isEnabled();
            return true;
        } catch (Exception ex) {
            return false;
        }
    }

    @Override