mirror of
https://github.com/oxen-io/session-android.git
synced 2025-10-23 17:48:50 +00:00
Reduce usage of Log.w()
This commit is contained in:
@@ -257,7 +257,7 @@ public class AudioView extends FrameLayout implements AudioSlidePlayer.Listener
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
try {
|
||||
Log.w(TAG, "playbutton onClick");
|
||||
Log.d(TAG, "playbutton onClick");
|
||||
if (audioSlidePlayer != null) {
|
||||
togglePlayToPause();
|
||||
audioSlidePlayer.play(getProgress());
|
||||
@@ -272,7 +272,7 @@ public class AudioView extends FrameLayout implements AudioSlidePlayer.Listener
|
||||
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Log.w(TAG, "pausebutton onClick");
|
||||
Log.d(TAG, "pausebutton onClick");
|
||||
if (audioSlidePlayer != null) {
|
||||
togglePauseToPlay();
|
||||
audioSlidePlayer.stop();
|
||||
|
@@ -122,7 +122,7 @@ public class CustomDefaultPreference extends DialogPreference {
|
||||
|
||||
@Override
|
||||
protected void onBindDialogView(@NonNull View view) {
|
||||
Log.w(TAG, "onBindDialogView");
|
||||
Log.i(TAG, "onBindDialogView");
|
||||
super.onBindDialogView(view);
|
||||
|
||||
CustomDefaultPreference preference = (CustomDefaultPreference)getPreference();
|
||||
|
@@ -164,7 +164,7 @@ public class InputPanel extends LinearLayout
|
||||
long elapsedTime = onRecordHideEvent(x);
|
||||
|
||||
if (listener != null) {
|
||||
Log.w(TAG, "Elapsed time: " + elapsedTime);
|
||||
Log.d(TAG, "Elapsed time: " + elapsedTime);
|
||||
if (elapsedTime > 1000) {
|
||||
listener.onRecorderFinished();
|
||||
} else {
|
||||
|
@@ -86,7 +86,7 @@ public class KeyboardAwareLinearLayout extends LinearLayoutCompat {
|
||||
int oldRotation = rotation;
|
||||
rotation = getDeviceRotation();
|
||||
if (oldRotation != rotation) {
|
||||
Log.w(TAG, "rotation changed");
|
||||
Log.i(TAG, "rotation changed");
|
||||
onKeyboardClose();
|
||||
}
|
||||
}
|
||||
@@ -132,14 +132,14 @@ public class KeyboardAwareLinearLayout extends LinearLayoutCompat {
|
||||
}
|
||||
|
||||
protected void onKeyboardOpen(int keyboardHeight) {
|
||||
Log.w(TAG, "onKeyboardOpen(" + keyboardHeight + ")");
|
||||
Log.i(TAG, "onKeyboardOpen(" + keyboardHeight + ")");
|
||||
keyboardOpen = true;
|
||||
|
||||
notifyShownListeners();
|
||||
}
|
||||
|
||||
protected void onKeyboardClose() {
|
||||
Log.w(TAG, "onKeyboardClose()");
|
||||
Log.i(TAG, "onKeyboardClose()");
|
||||
keyboardOpen = false;
|
||||
notifyHiddenListeners();
|
||||
}
|
||||
|
@@ -249,19 +249,19 @@ public class ThumbnailView extends FrameLayout {
|
||||
}
|
||||
|
||||
if (Util.equals(slide, this.slide)) {
|
||||
Log.w(TAG, "Not re-loading slide " + slide.asAttachment().getDataUri());
|
||||
Log.i(TAG, "Not re-loading slide " + slide.asAttachment().getDataUri());
|
||||
return new SettableFuture<>(false);
|
||||
}
|
||||
|
||||
if (this.slide != null && this.slide.getFastPreflightId() != null &&
|
||||
this.slide.getFastPreflightId().equals(slide.getFastPreflightId()))
|
||||
{
|
||||
Log.w(TAG, "Not re-loading slide for fast preflight: " + slide.getFastPreflightId());
|
||||
Log.i(TAG, "Not re-loading slide for fast preflight: " + slide.getFastPreflightId());
|
||||
this.slide = slide;
|
||||
return new SettableFuture<>(false);
|
||||
}
|
||||
|
||||
Log.w(TAG, "loading part with id " + slide.asAttachment().getDataUri()
|
||||
Log.i(TAG, "loading part with id " + slide.asAttachment().getDataUri()
|
||||
+ ", progress " + slide.getTransferState() + ", fast preflight id: " +
|
||||
slide.asAttachment().getFastPreflightId());
|
||||
|
||||
|
@@ -65,7 +65,7 @@ public class ZoomingImageView extends FrameLayout {
|
||||
final Context context = getContext();
|
||||
final int maxTextureSize = BitmapUtil.getMaxTextureSize();
|
||||
|
||||
Log.w(TAG, "Max texture size: " + maxTextureSize);
|
||||
Log.i(TAG, "Max texture size: " + maxTextureSize);
|
||||
|
||||
new AsyncTask<Void, Void, Pair<Integer, Integer>>() {
|
||||
@Override
|
||||
@@ -82,13 +82,13 @@ public class ZoomingImageView extends FrameLayout {
|
||||
}
|
||||
|
||||
protected void onPostExecute(@Nullable Pair<Integer, Integer> dimensions) {
|
||||
Log.w(TAG, "Dimensions: " + (dimensions == null ? "(null)" : dimensions.first + ", " + dimensions.second));
|
||||
Log.i(TAG, "Dimensions: " + (dimensions == null ? "(null)" : dimensions.first + ", " + dimensions.second));
|
||||
|
||||
if (dimensions == null || (dimensions.first <= maxTextureSize && dimensions.second <= maxTextureSize)) {
|
||||
Log.w(TAG, "Loading in standard image view...");
|
||||
Log.i(TAG, "Loading in standard image view...");
|
||||
setImageViewUri(glideRequests, uri);
|
||||
} else {
|
||||
Log.w(TAG, "Loading in subsampling image view...");
|
||||
Log.i(TAG, "Loading in subsampling image view...");
|
||||
setSubsamplingImageViewUri(uri);
|
||||
}
|
||||
}
|
||||
|
@@ -30,7 +30,7 @@ public class CameraUtils {
|
||||
final int targetHeight = displayOrientation % 180 == 90 ? width : height;
|
||||
final double targetRatio = (double) targetWidth / targetHeight;
|
||||
|
||||
Log.w(TAG, String.format("getPreferredPreviewSize(%d, %d, %d) -> target %dx%d, AR %.02f",
|
||||
Log.d(TAG, String.format("getPreferredPreviewSize(%d, %d, %d) -> target %dx%d, AR %.02f",
|
||||
displayOrientation, width, height,
|
||||
targetWidth, targetHeight, targetRatio));
|
||||
|
||||
@@ -39,14 +39,14 @@ public class CameraUtils {
|
||||
List<Size> bigEnough = new LinkedList<>();
|
||||
|
||||
for (Size size : sizes) {
|
||||
Log.w(TAG, String.format(" %dx%d (%.02f)", size.width, size.height, (float)size.width / size.height));
|
||||
Log.d(TAG, String.format(" %dx%d (%.02f)", size.width, size.height, (float)size.width / size.height));
|
||||
|
||||
if (size.height == size.width * targetRatio && size.height >= targetHeight && size.width >= targetWidth) {
|
||||
ideals.add(size);
|
||||
Log.w(TAG, " (ideal ratio)");
|
||||
Log.d(TAG, " (ideal ratio)");
|
||||
} else if (size.width >= targetWidth && size.height >= targetHeight) {
|
||||
bigEnough.add(size);
|
||||
Log.w(TAG, " (good size, suboptimal ratio)");
|
||||
Log.d(TAG, " (good size, suboptimal ratio)");
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -97,7 +97,7 @@ public class CameraView extends ViewGroup {
|
||||
public void onResume() {
|
||||
if (state != State.PAUSED) return;
|
||||
state = State.RESUMED;
|
||||
Log.w(TAG, "onResume() queued");
|
||||
Log.i(TAG, "onResume() queued");
|
||||
enqueueTask(new SerialAsyncTask<Void>() {
|
||||
@Override
|
||||
protected
|
||||
@@ -106,7 +106,7 @@ public class CameraView extends ViewGroup {
|
||||
try {
|
||||
long openStartMillis = System.currentTimeMillis();
|
||||
camera = Optional.fromNullable(Camera.open(cameraId));
|
||||
Log.w(TAG, "camera.open() -> " + (System.currentTimeMillis() - openStartMillis) + "ms");
|
||||
Log.i(TAG, "camera.open() -> " + (System.currentTimeMillis() - openStartMillis) + "ms");
|
||||
synchronized (CameraView.this) {
|
||||
CameraView.this.notifyAll();
|
||||
}
|
||||
@@ -130,7 +130,7 @@ public class CameraView extends ViewGroup {
|
||||
if (getActivity().getRequestedOrientation() != ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED) {
|
||||
onOrientationChange.enable();
|
||||
}
|
||||
Log.w(TAG, "onResume() completed");
|
||||
Log.i(TAG, "onResume() completed");
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -138,7 +138,7 @@ public class CameraView extends ViewGroup {
|
||||
public void onPause() {
|
||||
if (state == State.PAUSED) return;
|
||||
state = State.PAUSED;
|
||||
Log.w(TAG, "onPause() queued");
|
||||
Log.i(TAG, "onPause() queued");
|
||||
|
||||
enqueueTask(new SerialAsyncTask<Void>() {
|
||||
private Optional<Camera> cameraToDestroy;
|
||||
@@ -170,7 +170,7 @@ public class CameraView extends ViewGroup {
|
||||
outputOrientation = -1;
|
||||
removeView(surface);
|
||||
addView(surface);
|
||||
Log.w(TAG, "onPause() completed");
|
||||
Log.i(TAG, "onPause() completed");
|
||||
}
|
||||
});
|
||||
|
||||
@@ -220,7 +220,7 @@ public class CameraView extends ViewGroup {
|
||||
|
||||
@Override
|
||||
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
|
||||
Log.w(TAG, "onSizeChanged(" + oldw + "x" + oldh + " -> " + w + "x" + h + ")");
|
||||
Log.i(TAG, "onSizeChanged(" + oldw + "x" + oldh + " -> " + w + "x" + h + ")");
|
||||
super.onSizeChanged(w, h, oldw, oldh);
|
||||
if (camera.isPresent()) startPreview(camera.get().getParameters());
|
||||
}
|
||||
@@ -310,7 +310,7 @@ public class CameraView extends ViewGroup {
|
||||
final Size preferredPreviewSize = getPreferredPreviewSize(parameters);
|
||||
|
||||
if (preferredPreviewSize != null && !parameters.getPreviewSize().equals(preferredPreviewSize)) {
|
||||
Log.w(TAG, "starting preview with size " + preferredPreviewSize.width + "x" + preferredPreviewSize.height);
|
||||
Log.i(TAG, "starting preview with size " + preferredPreviewSize.width + "x" + preferredPreviewSize.height);
|
||||
if (state == State.ACTIVE) stopPreview();
|
||||
previewSize = preferredPreviewSize;
|
||||
parameters.setPreviewSize(preferredPreviewSize.width, preferredPreviewSize.height);
|
||||
@@ -320,7 +320,7 @@ public class CameraView extends ViewGroup {
|
||||
}
|
||||
long previewStartMillis = System.currentTimeMillis();
|
||||
camera.startPreview();
|
||||
Log.w(TAG, "camera.startPreview() -> " + (System.currentTimeMillis() - previewStartMillis) + "ms");
|
||||
Log.i(TAG, "camera.startPreview() -> " + (System.currentTimeMillis() - previewStartMillis) + "ms");
|
||||
state = State.ACTIVE;
|
||||
Util.runOnMain(new Runnable() {
|
||||
@Override
|
||||
@@ -445,11 +445,11 @@ public class CameraView extends ViewGroup {
|
||||
final Size previewSize = camera.getParameters().getPreviewSize();
|
||||
final Rect croppingRect = getCroppedRect(previewSize, previewRect, rotation);
|
||||
|
||||
Log.w(TAG, "previewSize: " + previewSize.width + "x" + previewSize.height);
|
||||
Log.w(TAG, "data bytes: " + data.length);
|
||||
Log.w(TAG, "previewFormat: " + camera.getParameters().getPreviewFormat());
|
||||
Log.w(TAG, "croppingRect: " + croppingRect.toString());
|
||||
Log.w(TAG, "rotation: " + rotation);
|
||||
Log.i(TAG, "previewSize: " + previewSize.width + "x" + previewSize.height);
|
||||
Log.i(TAG, "data bytes: " + data.length);
|
||||
Log.i(TAG, "previewFormat: " + camera.getParameters().getPreviewFormat());
|
||||
Log.i(TAG, "croppingRect: " + croppingRect.toString());
|
||||
Log.i(TAG, "rotation: " + rotation);
|
||||
new CaptureTask(previewSize, rotation, croppingRect).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, data);
|
||||
}
|
||||
});
|
||||
@@ -536,7 +536,7 @@ public class CameraView extends ViewGroup {
|
||||
throw new PreconditionsNotMetException();
|
||||
}
|
||||
while (getMeasuredHeight() <= 0 || getMeasuredWidth() <= 0 || !surface.isReady()) {
|
||||
Log.w(TAG, String.format("waiting. surface ready? %s", surface.isReady()));
|
||||
Log.i(TAG, String.format("waiting. surface ready? %s", surface.isReady()));
|
||||
Util.wait(CameraView.this, 0);
|
||||
}
|
||||
}
|
||||
|
@@ -117,7 +117,7 @@ public class QuickAttachmentDrawer extends ViewGroup implements InputView, Camer
|
||||
}
|
||||
|
||||
private void updateControlsView() {
|
||||
Log.w(TAG, "updateControlsView()");
|
||||
Log.i(TAG, "updateControlsView()");
|
||||
View controls = LayoutInflater.from(getContext()).inflate(isLandscape() ? R.layout.quick_camera_controls_land
|
||||
: R.layout.quick_camera_controls,
|
||||
this, false);
|
||||
|
@@ -28,6 +28,9 @@ import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
public class EmojiDrawer extends LinearLayout implements InputView {
|
||||
|
||||
private static final String TAG = EmojiDrawer.class.getSimpleName();
|
||||
|
||||
private static final KeyEvent DELETE_KEY_EVENT = new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_DEL);
|
||||
|
||||
private ViewPager pager;
|
||||
@@ -62,7 +65,7 @@ public class EmojiDrawer extends LinearLayout implements InputView {
|
||||
}
|
||||
|
||||
private void initializeResources(View v) {
|
||||
Log.w("EmojiDrawer", "initializeResources()");
|
||||
Log.i(TAG, "initializeResources()");
|
||||
this.pager = (ViewPager) v.findViewById(R.id.emoji_pager);
|
||||
this.strip = (PagerSlidingTabStrip) v.findViewById(R.id.tabs);
|
||||
|
||||
@@ -85,7 +88,7 @@ public class EmojiDrawer extends LinearLayout implements InputView {
|
||||
if (this.pager == null) initView();
|
||||
ViewGroup.LayoutParams params = getLayoutParams();
|
||||
params.height = height;
|
||||
Log.w("EmojiDrawer", "showing emoji drawer with height " + params.height);
|
||||
Log.i(TAG, "showing emoji drawer with height " + params.height);
|
||||
setLayoutParams(params);
|
||||
setVisibility(VISIBLE);
|
||||
if (drawerListener != null) drawerListener.onShown();
|
||||
@@ -95,7 +98,7 @@ public class EmojiDrawer extends LinearLayout implements InputView {
|
||||
public void hide(boolean immediate) {
|
||||
setVisibility(GONE);
|
||||
if (drawerListener != null) drawerListener.onHidden();
|
||||
Log.w("EmojiDrawer", "hide()");
|
||||
Log.i(TAG, "hide()");
|
||||
}
|
||||
|
||||
private void initializeEmojiGrid() {
|
||||
@@ -104,7 +107,7 @@ public class EmojiDrawer extends LinearLayout implements InputView {
|
||||
new EmojiSelectionListener() {
|
||||
@Override
|
||||
public void onEmojiSelected(String emoji) {
|
||||
Log.w("EmojiDrawer", "onEmojiSelected()");
|
||||
Log.i(TAG, "onEmojiSelected()");
|
||||
recentModel.onCodePointSelected(emoji);
|
||||
if (listener != null) listener.onEmojiSelected(emoji);
|
||||
}
|
||||
|
@@ -63,7 +63,7 @@ public class RecentEmojiPageModel implements EmojiPageModel {
|
||||
}
|
||||
|
||||
public void onCodePointSelected(String emoji) {
|
||||
Log.w(TAG, "onCodePointSelected(" + emoji + ")");
|
||||
Log.i(TAG, "onCodePointSelected(" + emoji + ")");
|
||||
recentlyUsed.remove(emoji);
|
||||
recentlyUsed.add(emoji);
|
||||
|
||||
|
@@ -45,7 +45,7 @@ public class EmojiPageBitmap {
|
||||
} else {
|
||||
Callable<Bitmap> callable = () -> {
|
||||
try {
|
||||
Log.w(TAG, "loading page " + model.getSprite());
|
||||
Log.i(TAG, "loading page " + model.getSprite());
|
||||
return loadPage();
|
||||
} catch (IOException ioe) {
|
||||
Log.w(TAG, ioe);
|
||||
@@ -82,7 +82,7 @@ public class EmojiPageBitmap {
|
||||
Bitmap scaledBitmap = Bitmap.createScaledBitmap(originalBitmap, (int)(originalBitmap.getWidth() * decodeScale), (int)(originalBitmap.getHeight() * decodeScale), false);
|
||||
|
||||
bitmapReference = new SoftReference<>(scaledBitmap);
|
||||
Log.w(TAG, "onPageLoaded(" + model.getSprite() + ")");
|
||||
Log.i(TAG, "onPageLoaded(" + model.getSprite() + ")");
|
||||
return scaledBitmap;
|
||||
} catch (InterruptedException e) {
|
||||
Log.w(TAG, e);
|
||||
|
@@ -68,7 +68,7 @@ public class UnverifiedBannerView extends LinearLayout {
|
||||
this.container.setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
Log.w(TAG, "onClick()");
|
||||
Log.i(TAG, "onClick()");
|
||||
clickListener.onClicked(unverifiedIdentities);
|
||||
}
|
||||
});
|
||||
|
@@ -27,7 +27,7 @@ public class AttachmentRegionDecoder implements ImageRegionDecoder {
|
||||
|
||||
@Override
|
||||
public Point init(Context context, Uri uri) throws Exception {
|
||||
Log.w(TAG, "Init!");
|
||||
Log.d(TAG, "Init!");
|
||||
if (!PartAuthority.isLocalUri(uri)) {
|
||||
passthrough = new SkiaImageRegionDecoder();
|
||||
return passthrough.init(context, uri);
|
||||
@@ -43,7 +43,7 @@ public class AttachmentRegionDecoder implements ImageRegionDecoder {
|
||||
|
||||
@Override
|
||||
public Bitmap decodeRegion(Rect rect, int sampleSize) {
|
||||
Log.w(TAG, "Decode region: " + rect);
|
||||
Log.d(TAG, "Decode region: " + rect);
|
||||
|
||||
if (passthrough != null) {
|
||||
return passthrough.decodeRegion(rect, sampleSize);
|
||||
@@ -65,7 +65,7 @@ public class AttachmentRegionDecoder implements ImageRegionDecoder {
|
||||
}
|
||||
|
||||
public boolean isReady() {
|
||||
Log.w(TAG, "isReady");
|
||||
Log.d(TAG, "isReady");
|
||||
return (passthrough != null && passthrough.isReady()) ||
|
||||
(bitmapRegionDecoder != null && !bitmapRegionDecoder.isRecycled());
|
||||
}
|
||||
|
Reference in New Issue
Block a user