Skip to content

Commit

Permalink
fix code
Browse files Browse the repository at this point in the history
  • Loading branch information
Hugo committed May 29, 2017
1 parent 8906606 commit 40eb29f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions watcher/src/main/java/com/hugo/watcher/Watcher.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import android.app.Application;
import android.content.Context;
import android.content.Intent;
import android.os.Build;
import android.provider.Settings;
import android.util.Log;
import com.hugo.watcher.config.AppBackground;
Expand Down Expand Up @@ -42,7 +41,7 @@ public void start(Context context) {
if (!mWatcherConfig.isDebug) {
return;
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && !Settings.canDrawOverlays(context)) {
if (!mWatcherConfig.enableSkipPermission() && !Settings.canDrawOverlays(context)) {
Log.e("Watcher", "!!! ---> Can't start Watcher : permission denied for window type");
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class WatcherConfig implements Parcelable {
public boolean enableShowCurrentActivity = true;

public boolean enableSkipPermission() {
return Build.VERSION.SDK_INT < Build.VERSION_CODES.M;
return Build.VERSION.SDK_INT < Build.VERSION_CODES.N;
}

/**
Expand Down

0 comments on commit 40eb29f

Please sign in to comment.