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

Commit 522c74f5 authored by Yi Kong's avatar Yi Kong
Browse files

profcollet: Fix possible NPE

If an exception contains no message, Log.e will throw NPE.

Test: presubmit
Bug: 223235958
Change-Id: Ie754776d3ef830dddbbb90dcc88e081706e96e6a
parent 0f839e53
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -112,7 +112,7 @@ public final class ProfcollectForwardingService extends SystemService {
        try {
            mIProfcollect.registerProviderStatusCallback(mProviderStatusCallback);
        } catch (RemoteException e) {
            Log.e(LOG_TAG, e.getMessage());
            Log.e(LOG_TAG, "Failed to register provider status callback: " + e.getMessage());
        }
    }

@@ -123,7 +123,7 @@ public final class ProfcollectForwardingService extends SystemService {
        try {
            return !mIProfcollect.get_supported_provider().isEmpty();
        } catch (RemoteException e) {
            Log.e(LOG_TAG, e.getMessage());
            Log.e(LOG_TAG, "Failed to get supported provider: " + e.getMessage());
            return false;
        }
    }
@@ -219,7 +219,8 @@ public final class ProfcollectForwardingService extends SystemService {
                        try {
                            sSelfService.mIProfcollect.process();
                        } catch (RemoteException e) {
                            Log.e(LOG_TAG, e.getMessage());
                            Log.e(LOG_TAG, "Failed to process profiles in background: "
                                    + e.getMessage());
                        }
                    });
            return true;
@@ -264,7 +265,7 @@ public final class ProfcollectForwardingService extends SystemService {
                try {
                    mIProfcollect.trace_once("applaunch");
                } catch (RemoteException e) {
                    Log.e(LOG_TAG, e.getMessage());
                    Log.e(LOG_TAG, "Failed to initiate trace: " + e.getMessage());
                }
            });
        }
@@ -348,7 +349,7 @@ public final class ProfcollectForwardingService extends SystemService {
                        .putExtra("filename", reportName);
                context.sendBroadcast(intent);
            } catch (RemoteException e) {
                Log.e(LOG_TAG, e.getMessage());
                Log.e(LOG_TAG, "Failed to upload report: " + e.getMessage());
            }
        });
    }