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

Commit 19410862 authored by William Escande's avatar William Escande Committed by Gerrit Code Review
Browse files

Merge "Errorprone fix & enforce CatchAndPrintStackTrace" into main

parents df136c49 c0329da2
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -328,6 +328,7 @@ android_app {
            "-Xep:AndroidFrameworkEfficientStrings:ERROR",
            "-Xep:AndroidFrameworkRequiresPermission:ERROR",
            "-Xep:BadImport:ERROR",
            "-Xep:CatchAndPrintStackTrace:ERROR",
            "-Xep:ClassCanBeStatic:ERROR",
            "-Xep:DateFormatConstant:ERROR",
            "-Xep:EmptyBlockTag:ERROR",
+23 −10
Original line number Diff line number Diff line
@@ -124,8 +124,9 @@ public class HidDeviceService extends ProfileService {
                                break;
                            }
                        } catch (RemoteException e) {
                            Log.e(TAG, "e=" + e.toString());
                            e.printStackTrace();
                            Log.e(
                                    TAG,
                                    e.toString() + "\n" + Log.getStackTraceString(new Throwable()));
                        }

                        if (success) {
@@ -137,7 +138,11 @@ public class HidDeviceService extends ProfileService {
                                    binder.linkToDeath(mDeathRcpt, 0);
                                    Log.i(TAG, "IBinder.linkToDeath() ok");
                                } catch (RemoteException e) {
                                    e.printStackTrace();
                                    Log.e(
                                            TAG,
                                            e.toString()
                                                    + "\n"
                                                    + Log.getStackTraceString(new Throwable()));
                                }
                            }
                        } else if (mDeathRcpt != null) {
@@ -147,7 +152,11 @@ public class HidDeviceService extends ProfileService {
                                    binder.unlinkToDeath(mDeathRcpt, 0);
                                    Log.i(TAG, "IBinder.unlinkToDeath() ok");
                                } catch (NoSuchElementException e) {
                                    e.printStackTrace();
                                    Log.e(
                                            TAG,
                                            e.toString()
                                                    + "\n"
                                                    + Log.getStackTraceString(new Throwable()));
                                }
                                mDeathRcpt.cleanup();
                                mDeathRcpt = null;
@@ -178,7 +187,9 @@ public class HidDeviceService extends ProfileService {
                                mCallback.onConnectionStateChanged(device, state);
                            }
                        } catch (RemoteException e) {
                            e.printStackTrace();
                            Log.e(
                                    TAG,
                                    e.toString() + "\n" + Log.getStackTraceString(new Throwable()));
                        }
                        break;
                    }
@@ -193,7 +204,7 @@ public class HidDeviceService extends ProfileService {
                            mCallback.onGetReport(mHidDevice, type, id, bufferSize);
                        }
                    } catch (RemoteException e) {
                        e.printStackTrace();
                        Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable()));
                    }
                    break;

@@ -208,7 +219,9 @@ public class HidDeviceService extends ProfileService {
                                mCallback.onSetReport(mHidDevice, reportType, reportId, data);
                            }
                        } catch (RemoteException e) {
                            e.printStackTrace();
                            Log.e(
                                    TAG,
                                    e.toString() + "\n" + Log.getStackTraceString(new Throwable()));
                        }
                        break;
                    }
@@ -221,7 +234,7 @@ public class HidDeviceService extends ProfileService {
                            mCallback.onSetProtocol(mHidDevice, protocol);
                        }
                    } catch (RemoteException e) {
                        e.printStackTrace();
                        Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable()));
                    }
                    break;

@@ -234,7 +247,7 @@ public class HidDeviceService extends ProfileService {
                            mCallback.onInterruptData(mHidDevice, reportId, data);
                        }
                    } catch (RemoteException e) {
                        e.printStackTrace();
                        Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable()));
                    }
                    break;

@@ -244,7 +257,7 @@ public class HidDeviceService extends ProfileService {
                            mCallback.onVirtualCableUnplug(mHidDevice);
                        }
                    } catch (RemoteException e) {
                        e.printStackTrace();
                        Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable()));
                    }
                    mHidDevice = null;
                    break;
+1 −1
Original line number Diff line number Diff line
@@ -761,7 +761,7 @@ public class MediaControlProfile implements MediaControlServiceCallbacks {
            ApplicationInfo info = pm.getApplicationInfo(player.getPackageName(), 0);
            player_name = info.loadLabel(pm).toString();
        } catch (PackageManager.NameNotFoundException e) {
            e.printStackTrace();
            Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable()));
        }
        return player_name;
    }
+2 −3
Original line number Diff line number Diff line
@@ -416,8 +416,7 @@ public class BluetoothOppLauncherActivity extends Activity {
                    BluetoothProtoEnums.BLUETOOTH_OPP_LAUNCHER_ACTIVITY,
                    BluetoothStatsLog.BLUETOOTH_CONTENT_PROFILE_ERROR_REPORTED__TYPE__EXCEPTION,
                    6);
            Log.e(TAG, "FileNotFoundException: " + e.toString());
            e.printStackTrace();
            Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable()));
        } catch (IOException e) {
            ContentProfileErrorReportUtils.report(
                    BluetoothProfile.OPP,
@@ -443,7 +442,7 @@ public class BluetoothOppLauncherActivity extends Activity {
                        BluetoothProtoEnums.BLUETOOTH_OPP_LAUNCHER_ACTIVITY,
                        BluetoothStatsLog.BLUETOOTH_CONTENT_PROFILE_ERROR_REPORTED__TYPE__EXCEPTION,
                        9);
                e.printStackTrace();
                Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable()));
            }
        }
        return fileUri;
+3 −5
Original line number Diff line number Diff line
@@ -169,7 +169,7 @@ public class BluetoothOppTransfer implements BluetoothOppBatch.BluetoothOppBatch
                            BluetoothStatsLog
                                    .BLUETOOTH_CONTENT_PROFILE_ERROR_REPORTED__TYPE__EXCEPTION,
                            2);
                    e.printStackTrace();
                    Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable()));
                }
            } else if (action.equals(BluetoothDevice.ACTION_SDP_RECORD)) {
                ParcelUuid uuid = intent.getParcelableExtra(BluetoothDevice.EXTRA_UUID);
@@ -358,8 +358,7 @@ public class BluetoothOppTransfer implements BluetoothOppBatch.BluetoothOppBatch
                                BluetoothStatsLog
                                        .BLUETOOTH_CONTENT_PROFILE_ERROR_REPORTED__TYPE__EXCEPTION,
                                6);
                        Log.e(TAG, "Exception while handling MSG_SESSION_ERROR");
                        e.printStackTrace();
                        Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable()));
                    }
                    break;

@@ -1014,8 +1013,7 @@ public class BluetoothOppTransfer implements BluetoothOppBatch.BluetoothOppBatch
                        BluetoothProtoEnums.BLUETOOTH_OPP_TRANSFER,
                        BluetoothStatsLog.BLUETOOTH_CONTENT_PROFILE_ERROR_REPORTED__TYPE__EXCEPTION,
                        23);
                Log.e(TAG, "Exception:unregisterReceiver");
                e.printStackTrace();
                Log.e(TAG, e.toString() + "\n" + Log.getStackTraceString(new Throwable()));
            }
        }
    }
Loading