diff options
author | Daniel Gultsch <daniel@gultsch.de> | 2016-02-27 11:26:09 +0100 |
---|---|---|
committer | Daniel Gultsch <daniel@gultsch.de> | 2016-02-27 11:26:09 +0100 |
commit | 2c224d0f188127df2ea8d398ccb5904fa6561654 (patch) | |
tree | aa356b11f936b14e14466a7254e151c728417fb2 /src/main/java/eu/siacs/conversations/ui/ExportLogsPreference.java | |
parent | 60ab03afb119a61503f101da91f54f15124f9373 (diff) | |
parent | 3cf21e2d3712f40659afbf44296c8ea571d9f7a3 (diff) |
Merge branch 'master' of github.com:siacs/Conversations
Diffstat (limited to 'src/main/java/eu/siacs/conversations/ui/ExportLogsPreference.java')
-rw-r--r-- | src/main/java/eu/siacs/conversations/ui/ExportLogsPreference.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/main/java/eu/siacs/conversations/ui/ExportLogsPreference.java b/src/main/java/eu/siacs/conversations/ui/ExportLogsPreference.java index a4e178bd..bedb4172 100644 --- a/src/main/java/eu/siacs/conversations/ui/ExportLogsPreference.java +++ b/src/main/java/eu/siacs/conversations/ui/ExportLogsPreference.java @@ -1,7 +1,10 @@ package eu.siacs.conversations.ui; +import android.Manifest; import android.content.Context; import android.content.Intent; +import android.content.pm.PackageManager; +import android.os.Build; import android.preference.Preference; import android.util.AttributeSet; @@ -22,6 +25,10 @@ public class ExportLogsPreference extends Preference { } protected void onClick() { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M + && getContext().checkSelfPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) { + return; + } final Intent startIntent = new Intent(getContext(), ExportLogsService.class); getContext().startService(startIntent); super.onClick(); |