Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dde3c674 authored by Mark Harman's avatar Mark Harman
Browse files

Android warnings - use Log instead of printStackTrace.

parent 15b676ac
Loading
Loading
Loading
Loading
+17 −17
Original line number Diff line number Diff line
@@ -153,7 +153,7 @@ public class InstrumentedTest {
        try {
            Thread.sleep(100); // sleep a bit just to be safe
        } catch (InterruptedException e) {
            e.printStackTrace();
            Log.e(TAG, "InterruptedException from sleep", e);
        }

        if( wait_for_preview ) {
@@ -176,7 +176,7 @@ public class InstrumentedTest {
        try {
            Thread.sleep(100); // sleep a bit just to be safe
        } catch (InterruptedException e) {
            e.printStackTrace();
            Log.e(TAG, "InterruptedException from sleep", e);
        }
    }

@@ -235,7 +235,7 @@ public class InstrumentedTest {
            Thread.sleep(DrawPreview.dim_effect_time_c+50); // wait for updateForSettings
        }
        catch(InterruptedException e) {
            e.printStackTrace();
            Log.e(TAG, "InterruptedException from sleep", e);
        }
    }

@@ -357,7 +357,7 @@ public class InstrumentedTest {
                //this.getInstrumentation().waitForIdleSync();
            }
            catch(InterruptedException e) {
                e.printStackTrace();
                Log.e(TAG, "InterruptedException from sleep", e);
            }
            iso = getActivityValue(activity -> activity.getPreview().getCameraController().getISO());
            Log.d(TAG, "changed iso to: "+ iso);
@@ -390,7 +390,7 @@ public class InstrumentedTest {
            Thread.sleep(200);
        }
        catch (InterruptedException e) {
            e.printStackTrace();
            Log.e(TAG, "InterruptedException from sleep", e);
        }
    }

@@ -421,7 +421,7 @@ public class InstrumentedTest {
                Thread.sleep(1000); // wait for camera to open
            }
            catch(InterruptedException e) {
                e.printStackTrace();
                Log.e(TAG, "InterruptedException from sleep", e);
            }

            List<Bitmap> inputs = new ArrayList<>();
@@ -430,7 +430,7 @@ public class InstrumentedTest {
                activity.getApplicationInterface().getHDRProcessor().processHDR(inputs, true, null, true, null, 0.0f, 4, true, HDRProcessor.TonemappingAlgorithm.TONEMAPALGORITHM_REINHARD, HDRProcessor.DROTonemappingAlgorithm.DROALGORITHM_NONE);
            }
            catch(HDRProcessorException e) {
                e.printStackTrace();
                Log.e(TAG, "processHDR failed", e);
                throw new RuntimeException();
            }

@@ -465,7 +465,7 @@ public class InstrumentedTest {
                Thread.sleep(500);
            }
            catch(InterruptedException e) {
                e.printStackTrace();
                Log.e(TAG, "InterruptedException from sleep", e);
            }
        });
    }
@@ -5126,7 +5126,7 @@ public class InstrumentedTest {
                Thread.sleep(1000); // need to wait for debug images to be saved/broadcast?
            }
            catch(InterruptedException e) {
                e.printStackTrace();
                Log.e(TAG, "InterruptedException from sleep", e);
            }
        });
    }
@@ -6488,7 +6488,7 @@ public class InstrumentedTest {
                TestUtils.checkFilesAfterTakePhoto(activity, is_raw, test_wait_capture_result, files);
            }
            catch(InterruptedException e) {
                e.printStackTrace();
                Log.e(TAG, "InterruptedException from checkFilesAfterTakePhoto", e);
            }

            TestUtils.checkFocusAfterTakePhoto2(activity, touch_to_focus, single_tap_photo, double_tap_photo, test_wait_capture_result, locked_focus, info.can_auto_focus, info.can_focus_area, saved_count);
@@ -6532,7 +6532,7 @@ public class InstrumentedTest {
                TestUtils.testExif(activity, activity.test_last_saved_image, activity.test_last_saved_imageuri, false, false, false);
            }
            catch(IOException e) {
                e.printStackTrace();
                Log.e(TAG, "testExif failed", e);
                fail();
            }
        });
@@ -6563,7 +6563,7 @@ public class InstrumentedTest {
                TestUtils.testExif(activity, activity.test_last_saved_image, activity.test_last_saved_imageuri, false, false, false);
            }
            catch(IOException e) {
                e.printStackTrace();
                Log.e(TAG, "testExif failed", e);
                fail();
            }
        });
@@ -6592,7 +6592,7 @@ public class InstrumentedTest {
                TestUtils.testExif(activity, activity.test_last_saved_image, activity.test_last_saved_imageuri, false, true, false);
            }
            catch(IOException e) {
                e.printStackTrace();
                Log.e(TAG, "testExif failed", e);
                fail();
            }
        });
@@ -6648,7 +6648,7 @@ public class InstrumentedTest {
                        TestUtils.testExif(activity, activity.test_last_saved_image, activity.test_last_saved_imageuri, true, true, false);
                    }
                    catch(IOException e) {
                        e.printStackTrace();
                        Log.e(TAG, "testExif failed", e);
                        fail();
                    }
                });
@@ -6689,7 +6689,7 @@ public class InstrumentedTest {
                            TestUtils.testExif(activity, activity.test_last_saved_image, activity.test_last_saved_imageuri, true, true, false);
                        }
                        catch(IOException e) {
                            e.printStackTrace();
                            Log.e(TAG, "testExif failed", e);
                            fail();
                        }
                    });
@@ -7203,7 +7203,7 @@ public class InstrumentedTest {
                    Thread.sleep(3000);
                }
                catch(InterruptedException e) {
                    e.printStackTrace();
                    Log.e(TAG, "InterruptedException from sleep", e);
                    fail();
                }
                mActivityRule.getScenario().onActivity(activity -> {
@@ -7236,7 +7236,7 @@ public class InstrumentedTest {
                    Thread.sleep(3000);
                }
                catch(InterruptedException e) {
                    e.printStackTrace();
                    Log.e(TAG, "InterruptedException from sleep", e);
                    fail();
                }
                mActivityRule.getScenario().onActivity(activity -> {
+17 −19
Original line number Diff line number Diff line
@@ -121,7 +121,7 @@ public class TestUtils {
            return getBitmapFromFileCore(activity, filename, inSampleSize);
        }
        catch(FileNotFoundException e) {
            e.printStackTrace();
            Log.e(TAG, "FileNotFoundException loading: " + filename, e);
            fail("FileNotFoundException loading: " + filename);
            return null;
        }
@@ -155,7 +155,7 @@ public class TestUtils {
                is.close();
            }
            catch(IOException e) {
                e.printStackTrace();
                Log.e(TAG, "failed to close input stream", e);
            }
        }
        else {
@@ -221,7 +221,7 @@ public class TestUtils {
            }
        }
        catch(IOException e) {
            e.printStackTrace();
            Log.e(TAG, "failed to load bitmap", e);
        }
        finally {
            if( parcelFileDescriptor != null ) {
@@ -229,7 +229,7 @@ public class TestUtils {
                    parcelFileDescriptor.close();
                }
                catch(IOException e) {
                    e.printStackTrace();
                    Log.e(TAG, "failed to close parcelFileDescriptor", e);
                }
            }
        }
@@ -262,8 +262,7 @@ public class TestUtils {
            }
        }
        catch(Exception e) {
            Log.e(TAG, "Exception trying to find uri from filename");
            e.printStackTrace();
            Log.e(TAG, "exception trying to find uri from filename", e);
        }
        finally {
            if( cursor != null ) {
@@ -278,7 +277,7 @@ public class TestUtils {
            saveBitmapCore(activity, bitmap, name);
        }
        catch(IOException e) {
            e.printStackTrace();
            Log.e(TAG, "IOException saving: " + name, e);
            fail("IOException saving: " + name);
        }
    }
@@ -411,7 +410,7 @@ public class TestUtils {
            Thread.sleep(1000); // wait for camera to open
        }
        catch(InterruptedException e) {
            e.printStackTrace();
            Log.e(TAG, "InterruptedException from sleep", e);
        }

        Bitmap dro_bitmap_in = null;
@@ -432,7 +431,7 @@ public class TestUtils {
                //test_callback.doHDR(inputs, tonemapping_algorithm, hdr_alpha);
            }
            catch(HDRProcessorException e) {
                e.printStackTrace();
                Log.e(TAG, "processHDR failed", e);
                throw new RuntimeException();
            }
            Log.d(TAG, "HDR time: " + (System.currentTimeMillis() - time_s));
@@ -451,7 +450,7 @@ public class TestUtils {
                //test_callback.doHDR(inputs, HDRProcessor.TonemappingAlgorithm.TONEMAPALGORITHM_REINHARD, 0.5f);
            }
            catch(HDRProcessorException e) {
                e.printStackTrace();
                Log.e(TAG, "processHDR failed", e);
                throw new RuntimeException();
            }
            Log.d(TAG, "DRO time: " + (System.currentTimeMillis() - time_s));
@@ -465,7 +464,7 @@ public class TestUtils {
            Thread.sleep(500);
        }
        catch(InterruptedException e) {
            e.printStackTrace();
            Log.e(TAG, "InterruptedException from sleep", e);
        }

        return hdrHistogramDetails;
@@ -518,7 +517,7 @@ public class TestUtils {
            Thread.sleep(1000); // wait for camera to open
        }
        catch(InterruptedException e) {
            e.printStackTrace();
            Log.e(TAG, "InterruptedException from sleep", e);
        }

        /*Bitmap nr_bitmap = getBitmapFromFile(activity, inputs.get(0));
@@ -538,7 +537,7 @@ public class TestUtils {
            //activity.getApplicationInterface().getHDRProcessor().processAvgMulti(inputs, hdr_strength, 4);
        }
        catch(HDRProcessorException e) {
            e.printStackTrace();
            Log.e(TAG, "processAvg failed", e);
            throw new RuntimeException();
        }
        Log.d(TAG, "Avg time: " + (System.currentTimeMillis() - time_s));
@@ -599,7 +598,7 @@ public class TestUtils {
            Log.d(TAG, "    total: " + total_time);
        }
        catch(HDRProcessorException e) {
            e.printStackTrace();
            Log.e(TAG, "HDRProcessorException", e);
            throw new RuntimeException();
        }

@@ -613,7 +612,7 @@ public class TestUtils {
            Thread.sleep(500);
        }
        catch(InterruptedException e) {
            e.printStackTrace();
            Log.e(TAG, "InterruptedException from sleep", e);
        }

        return hdrHistogramDetails;
@@ -679,8 +678,7 @@ public class TestUtils {
                inputStream = new FileInputStream(gyro_debug_info_filename);
            }
            catch(FileNotFoundException e) {
                Log.e(TAG, "failed to load gyro debug info file: " + gyro_debug_info_filename);
                e.printStackTrace();
                Log.e(TAG, "failed to load gyro debug info file: " + gyro_debug_info_filename, e);
                throw new RuntimeException();
            }

@@ -703,7 +701,7 @@ public class TestUtils {
            panorama = activity.getApplicationInterface().getPanoramaProcessor().panorama(bitmaps, panorama_pics_per_screen, camera_angle_y, crop);
        }
        catch(PanoramaProcessorException e) {
            e.printStackTrace();
            Log.e(TAG, "panorama failed", e);
            fail();
        }

@@ -712,7 +710,7 @@ public class TestUtils {
            Thread.sleep(500);
        }
        catch(InterruptedException e) {
            e.printStackTrace();
            Log.e(TAG, "InterruptedException from sleep", e);
        }

        // check we've cropped correctly:
+27 −27
Original line number Diff line number Diff line
@@ -156,7 +156,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv
        try {
            Thread.sleep(100); // sleep a bit just to be safe
        } catch (InterruptedException e) {
            e.printStackTrace();
            Log.e(TAG, "InterruptedException from sleep", e);
        }
        if( wait_for_preview ) {
@@ -176,7 +176,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv
        try {
            Thread.sleep(100); // sleep a bit just to be safe
        } catch (InterruptedException e) {
            e.printStackTrace();
            Log.e(TAG, "InterruptedException from sleep", e);
        }
    }
@@ -250,7 +250,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv
            Thread.sleep(DrawPreview.dim_effect_time_c+50); // wait for updateForSettings
        }
        catch(InterruptedException e) {
            e.printStackTrace();
            Log.e(TAG, "InterruptedException from sleep", e);
        }
        this.getInstrumentation().waitForIdleSync();
@@ -388,7 +388,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv
                this.getInstrumentation().waitForIdleSync();
            }
            catch(InterruptedException e) {
                e.printStackTrace();
                Log.e(TAG, "InterruptedException from sleep", e);
            }
            iso = mPreview.getCameraController().getISO();
            Log.d(TAG, "changed iso to: "+ iso);
@@ -429,7 +429,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv
            Thread.sleep(200);
        }
        catch (InterruptedException e) {
            e.printStackTrace();
            Log.e(TAG, "InterruptedException from sleep", e);
        }
    }
@@ -6162,7 +6162,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv
                    Thread.sleep(2000);
                }
                catch(InterruptedException e) {
                    e.printStackTrace();
                    Log.e(TAG, "InterruptedException from sleep", e);
                    fail();
                }
@@ -6174,7 +6174,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv
                    Thread.sleep(2000);
                }
                catch(InterruptedException e) {
                    e.printStackTrace();
                    Log.e(TAG, "InterruptedException from sleep", e);
                    fail();
                }
@@ -6209,7 +6209,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv
                    Thread.sleep(3000);
                }
                catch(InterruptedException e) {
                    e.printStackTrace();
                    Log.e(TAG, "InterruptedException from sleep", e);
                    fail();
                }
                assertEquals(takePhotoButton.getContentDescription(), mActivity.getResources().getString(net.sourceforge.opencamera.R.string.stop_video));
@@ -6238,7 +6238,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv
                    Thread.sleep(3000);
                }
                catch(InterruptedException e) {
                    e.printStackTrace();
                    Log.e(TAG, "InterruptedException from sleep", e);
                    fail();
                }
                assertEquals(pauseVideoButton.getContentDescription(), mActivity.getResources().getString(net.sourceforge.opencamera.R.string.resume_video));
@@ -6266,7 +6266,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv
                    Thread.sleep(3000);
                }
                catch(InterruptedException e) {
                    e.printStackTrace();
                    Log.e(TAG, "InterruptedException from sleep", e);
                    fail();
                }
                Log.d(TAG, "takePhotoButton description: " + takePhotoButton.getContentDescription());
@@ -6317,7 +6317,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv
                    Thread.sleep(3000);
                }
                catch(InterruptedException e) {
                    e.printStackTrace();
                    Log.e(TAG, "InterruptedException from sleep", e);
                    fail();
                }
                assertEquals(takePhotoButton.getContentDescription(), mActivity.getResources().getString(net.sourceforge.opencamera.R.string.stop_video));
@@ -6346,7 +6346,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv
                    Thread.sleep(3000);
                }
                catch(InterruptedException e) {
                    e.printStackTrace();
                    Log.e(TAG, "InterruptedException from sleep", e);
                    fail();
                }
                Log.d(TAG, "takePhotoButton description: " + takePhotoButton.getContentDescription());
@@ -6387,7 +6387,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv
                    Thread.sleep(3000);
                }
                catch(InterruptedException e) {
                    e.printStackTrace();
                    Log.e(TAG, "InterruptedException from sleep", e);
                    fail();
                }
                assertEquals(takePhotoButton.getContentDescription(), mActivity.getResources().getString(net.sourceforge.opencamera.R.string.stop_video));
@@ -6412,7 +6412,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv
                    Thread.sleep(3000);
                }
                catch(InterruptedException e) {
                    e.printStackTrace();
                    Log.e(TAG, "InterruptedException from sleep", e);
                    fail();
                }
                assertEquals(takePhotoButton.getContentDescription(), mActivity.getResources().getString(net.sourceforge.opencamera.R.string.stop_video));
@@ -6557,7 +6557,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv
                    Thread.sleep(1000);
                }
                catch(InterruptedException e) {
                    e.printStackTrace();
                    Log.e(TAG, "InterruptedException from sleep", e);
                    fail();
                }
                Log.d(TAG, "done waiting");
@@ -6638,7 +6638,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv
                        Thread.sleep(10000);
                    }
                    catch(InterruptedException e) {
                        e.printStackTrace();
                        Log.e(TAG, "InterruptedException from sleep", e);
                        fail();
                    }
                    Log.d(TAG, "check still recording");
@@ -6697,7 +6697,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv
                    Thread.sleep(1000);
                }
                catch(InterruptedException e) {
                    e.printStackTrace();
                    Log.e(TAG, "InterruptedException from sleep", e);
                    fail();
                }
@@ -6706,7 +6706,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv
                    Thread.sleep(1000);
                }
                catch(InterruptedException e) {
                    e.printStackTrace();
                    Log.e(TAG, "InterruptedException from sleep", e);
                    fail();
                }
                View takePhotoButton = mActivity.findViewById(net.sourceforge.opencamera.R.id.take_photo);
@@ -6720,7 +6720,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv
                    Thread.sleep(1000);
                }
                catch(InterruptedException e) {
                    e.printStackTrace();
                    Log.e(TAG, "InterruptedException from sleep", e);
                    fail();
                }
                Log.d(TAG, "done wait for stop");
@@ -6816,7 +6816,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv
                    Thread.sleep(38000);
                }
                catch(InterruptedException e) {
                    e.printStackTrace();
                    Log.e(TAG, "InterruptedException from sleep", e);
                    fail();
                }
                Log.d(TAG, "ensure we've really stopped");
@@ -6859,7 +6859,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv
                        Thread.sleep(100);
                    }
                    catch(InterruptedException e) {
                        e.printStackTrace();
                        Log.e(TAG, "InterruptedException from sleep", e);
                        fail();
                    }
                }
@@ -6877,7 +6877,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv
                    Thread.sleep(100);
                }
                catch(InterruptedException e) {
                    e.printStackTrace();
                    Log.e(TAG, "InterruptedException from sleep", e);
                    fail();
                }
@@ -8120,7 +8120,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv
            assertEquals(2, n_new_files);
        }
        catch(InterruptedException e) {
            e.printStackTrace();
            Log.e(TAG, "InterruptedException from sleep", e);
            fail();
        }
    }
@@ -8194,7 +8194,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv
            assertFalse(mPreview.isOnTimer());
        }
        catch(InterruptedException e) {
            e.printStackTrace();
            Log.e(TAG, "InterruptedException from sleep", e);
            fail();
        }
    }
@@ -8503,7 +8503,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv
        }
        catch(InterruptedException e) {
            e.printStackTrace();
            Log.e(TAG, "InterruptedException from sleep", e);
            fail();
        }
@@ -8911,7 +8911,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv
            assertEquals(8, n_new_files);
        }
        catch(InterruptedException e) {
            e.printStackTrace();
            Log.e(TAG, "InterruptedException from sleep", e);
            fail();
        }
    }
@@ -14004,7 +14004,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv
            mActivity.getApplicationInterface().getHDRProcessor().processHDR(inputs, true, null, true, null, 0.0f, 4, true, HDRProcessor.TonemappingAlgorithm.TONEMAPALGORITHM_REINHARD, HDRProcessor.DROTonemappingAlgorithm.DROALGORITHM_NONE);
        }
        catch(HDRProcessorException e) {
            e.printStackTrace();
            Log.e(TAG, "processHDR failed", e);
            throw new RuntimeException();
        }