Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix check for whether to gather read logs. Has permission if either READ_LOGS_PERMISSION or API >= 16. #241

Merged
merged 1 commit into from
Feb 24, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/main/java/org/acra/collector/CrashReportDataFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -312,9 +312,8 @@ public CrashReportData createCrashData(String msg, Throwable th, Map<String, Str
// Before JellyBean, this required the READ_LOGS permission
// Since JellyBean, READ_LOGS is not granted to third-party apps anymore for security reasons.
// Though, we can call logcat without any permission and still get traces related to our app.
if (prefs.getBoolean(ACRA.PREF_ENABLE_SYSTEM_LOGS, true)
&& (pm.hasPermission(Manifest.permission.READ_LOGS))
|| Compatibility.getAPILevel() >= 16) {
final boolean hasReadLogsPermission = pm.hasPermission(Manifest.permission.READ_LOGS) || (Compatibility.getAPILevel() >= 16);
if (prefs.getBoolean(ACRA.PREF_ENABLE_SYSTEM_LOGS, true) && hasReadLogsPermission) {
Log.i(ACRA.LOG_TAG, "READ_LOGS granted! ACRA can include LogCat and DropBox data.");
if (crashReportFields.contains(LOGCAT)) {
crashReportData.put(LOGCAT, LogCatCollector.collectLogCat(null));
Expand Down