Skip to content

Commit

Permalink
修复某些机型检查权限问题错误
Browse files Browse the repository at this point in the history
  • Loading branch information
丁德高 committed Apr 29, 2020
1 parent f2da88b commit 3ba314f
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
import android.content.SharedPreferences;
import android.content.pm.PackageManager;

import androidx.core.content.ContextCompat;

import com.alibaba.fastjson.JSON;
import com.ding.library.internal.CaptureEntity;
import com.ding.library.internal.DiskIOThreadExecutor;
Expand Down Expand Up @@ -37,7 +39,7 @@ public class CacheUtils {

private CacheUtils() {
File file;
if (FileUtil.sdcardAvailable() && CaptureContext.appContext.checkSelfPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE)
if (FileUtil.sdcardAvailable() && ContextCompat.checkSelfPermission(CaptureContext.appContext,Manifest.permission.WRITE_EXTERNAL_STORAGE)
== PackageManager.PERMISSION_GRANTED) {
file = new File(CaptureContext.appContext.getExternalCacheDir(), "capture");
} else {
Expand Down

0 comments on commit 3ba314f

Please sign in to comment.