mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-29 05:43:55 +01:00
Fix log reporting for release builds (#1916)
* Fix log reporting for release builds * Fix logs for release builds * wip * Clean up the branch to exclude unrelated changes * With java docs * Uncomment quiz checker * Check for external storage permissions before sending logs * With more java docs * Fix crash while zipping log files * Do not log token and cookies * Add instruction to restart app
This commit is contained in:
parent
02fe0044a6
commit
b0b4b08100
28 changed files with 761 additions and 136 deletions
|
|
@ -8,7 +8,6 @@ import android.graphics.Color;
|
|||
import android.graphics.Rect;
|
||||
import android.net.Uri;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.util.Log;
|
||||
|
||||
import com.facebook.common.executors.CallerThreadExecutor;
|
||||
import com.facebook.common.references.CloseableReference;
|
||||
|
|
@ -89,7 +88,7 @@ public class ImageUtils {
|
|||
|
||||
int allPixelsCount = bitmapWidth * bitmapHeight;
|
||||
int[] bitmapPixels = new int[allPixelsCount];
|
||||
Log.e("total", Integer.toString(allPixelsCount));
|
||||
Timber.d("total %s", Integer.toString(allPixelsCount));
|
||||
|
||||
bitmap.getPixels(bitmapPixels,0,bitmapWidth,0,0,bitmapWidth,bitmapHeight);
|
||||
int numberOfBrightPixels = 0;
|
||||
|
|
|
|||
|
|
@ -2,8 +2,10 @@ package fr.free.nrw.commons.utils;
|
|||
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.net.Uri;
|
||||
import android.provider.Settings;
|
||||
import android.support.v4.content.ContextCompat;
|
||||
|
||||
import fr.free.nrw.commons.CommonsApplication;
|
||||
|
||||
|
|
@ -21,4 +23,16 @@ public class PermissionUtils {
|
|||
intent.setData(uri);
|
||||
activity.startActivityForResult(intent,CommonsApplication.OPEN_APPLICATION_DETAIL_SETTINGS);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether the app already has a particular permission
|
||||
*
|
||||
* @param activity
|
||||
* @param permission permission to be checked
|
||||
* @return
|
||||
*/
|
||||
public static boolean hasPermission(Activity activity, String permission) {
|
||||
return ContextCompat.checkSelfPermission(activity, permission) == PackageManager.PERMISSION_GRANTED;
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue