File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
firebase-perf/src/main/java/com/google/firebase/perf/application Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -108,14 +108,17 @@ public Optional<PerfFrameMetrics> stop() {
108
108
}
109
109
Optional <PerfFrameMetrics > data = this .snapshot ();
110
110
try {
111
+ // No reliable way to check for hardware-acceleration, so we must catch retroactively (#2736).
111
112
frameMetricsAggregator .remove (activity );
112
113
} catch (IllegalArgumentException | NullPointerException ex ) {
113
114
// Both of these exceptions result from android.view.View.addFrameMetricsListener silently
114
115
// failing when the view is not hardware-accelerated. Successful addFrameMetricsListener
115
116
// stores an observer in a list, and initializes the list if it was uninitialized. Invoking
116
117
// View.removeFrameMetricsListener(listener) throws IAE if it doesn't exist in the list, or
117
- // throws NPE if the list itself was never initialized. This NPE is fixed in API 29 .
118
+ // throws NPE if the list itself was never initialized (#4184) .
118
119
if (ex instanceof NullPointerException && Build .VERSION .SDK_INT > Build .VERSION_CODES .P ) {
120
+ // Re-throw above API 28, since the NPE is fixed in API 29:
121
+ // https://android.googlesource.com/platform/frameworks/base/+/140ff5ea8e2d99edc3fbe63a43239e459334c76b
119
122
throw ex ;
120
123
}
121
124
logger .warn (
You can’t perform that action at this time.
0 commit comments