Skip to content

Commit

Permalink
check password protection when using from tile
Browse files Browse the repository at this point in the history
  • Loading branch information
ukanth committed Oct 22, 2018
1 parent 8d3f9b2 commit b2576f4
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@
import android.service.quicksettings.Tile;
import android.service.quicksettings.TileService;
import android.support.annotation.RequiresApi;
import android.widget.Toast;

import dev.ukanth.ufirewall.Api;
import dev.ukanth.ufirewall.R;
import dev.ukanth.ufirewall.util.G;

@RequiresApi(api = Build.VERSION_CODES.N)
public class ToggleTileService extends TileService {
Expand Down Expand Up @@ -60,6 +62,11 @@ public void onClick() {
final boolean enabled = !prefs.getBoolean(Api.PREF_ENABLED, true);


if (!G.protectionLevel().equals("p0") || G.enableDeviceCheck()) {
Toast.makeText(context, R.string.widget_disable_fail, Toast.LENGTH_SHORT).show();
return;
}

Tile tile = getQsTile();

if (enabled) {
Expand Down

0 comments on commit b2576f4

Please sign in to comment.