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

Commit 95c64a35 authored by William Escande's avatar William Escande
Browse files

Errorprone Fix & enforce EmptyCatch

Bug: 344658662
Test: m Bluetooth
Flag: Exempt build warning
Change-Id: I43a21e8cbb5e6986837dd3156839362f84227ef2
parent b0f38f32
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -331,6 +331,7 @@ android_app {
            "-Xep:ClassCanBeStatic:ERROR",
            "-Xep:DateFormatConstant:ERROR",
            "-Xep:EmptyBlockTag:ERROR",
            "-Xep:EmptyCatch:ERROR",
            "-Xep:EqualsGetClass:ERROR",
            "-Xep:FallThrough:ERROR",
            "-Xep:HidingField:ERROR",
+1 −0
Original line number Diff line number Diff line
@@ -328,6 +328,7 @@ public class AvrcpBipObexServer extends ServerRequestHandler {
                    try {
                        outStream.close();
                    } catch (IOException e) {
                        warn("An exception occurred while closing e=" + e);
                    }
                }
            }
+1 −0
Original line number Diff line number Diff line
@@ -736,6 +736,7 @@ public class TransitionalScanHelper {
                    sendResultsByPendingIntent(
                            app.mInfo, permittedResults, ScanSettings.CALLBACK_TYPE_ALL_MATCHES);
                } catch (PendingIntent.CanceledException e) {
                    Log.d(TAG, "Exception while sending result", e);
                }
            }
        } else {
+5 −0
Original line number Diff line number Diff line
@@ -520,6 +520,7 @@ public class SapServer extends Thread implements Handler.Callback {
                    mHandlerThread.join(HANDLER_THREAD_JOIN_TIMEOUT_MS);
                    mHandlerThread = null;
                } catch (InterruptedException e) {
                    Log.d(TAG, "Interrupted while joining", e);
                }
            }
            if (mRilBtReceiver != null) {
@@ -533,6 +534,7 @@ public class SapServer extends Thread implements Handler.Callback {
                    mRfcommIn.close();
                    mRfcommIn = null;
                } catch (IOException e) {
                    Log.d(TAG, "Exception while closing rfcommIn", e);
                }
            }

@@ -542,6 +544,7 @@ public class SapServer extends Thread implements Handler.Callback {
                    mRfcommOut.close();
                    mRfcommOut = null;
                } catch (IOException e) {
                    Log.d(TAG, "Exception while closing rfcommOut", e);
                }
            }

@@ -733,12 +736,14 @@ public class SapServer extends Thread implements Handler.Callback {
                mRfcommOut.close();
            }
        } catch (IOException e) {
            Log.d(TAG, "Exception while closing rfcommOut", e);
        }
        try {
            if (mRfcommIn != null) {
                mRfcommIn.close();
            }
        } catch (IOException e) {
            Log.d(TAG, "Exception while closing rfcommIn", e);
        }
        mRfcommIn = null;
        mRfcommOut = null;