CameraView surface is leaked on Android 4.2.2 and older
A few seconds after leaving the CameraView on the Y330 I get the following warning:
09-28 12:04:36.925 17763-17773/org.briarproject E/StrictMode: A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding resource leaks.
java.lang.Throwable: Explicit termination method 'release' not called
at dalvik.system.CloseGuard.open(CloseGuard.java:184)
at android.view.Surface.<init>(Surface.java:291)
at android.view.SurfaceView.<init>(SurfaceView.java:102)
at org.briarproject.android.view.CameraView.<init>(CameraView.java:51)
at java.lang.reflect.Constructor.constructNative(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
at android.view.LayoutInflater.createView(LayoutInflater.java:587)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:687)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
at org.briarproject.android.keyagreement.ShowQrCodeFragment.onCreateView(ShowQrCodeFragment.java:111)
The cause appears to be this bug, which was fixed some time after Android 4.2.2: https://code.google.com/p/android/issues/detail?id=54285
The bug can be worked around by manually releasing the surface.