File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
firebase-perf/src/main/java/com/google/firebase/perf/application Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change 15
15
package com .google .firebase .perf .application ;
16
16
17
17
import android .app .Activity ;
18
+ import android .os .Build ;
18
19
import android .util .SparseIntArray ;
19
20
import androidx .core .app .FrameMetricsAggregator ;
20
21
import androidx .fragment .app .Fragment ;
@@ -113,7 +114,10 @@ public Optional<PerfFrameMetrics> stop() {
113
114
// failing when the view is not hardware-accelerated. Successful addFrameMetricsListener
114
115
// stores an observer in a list, and initializes the list if it was uninitialized. Invoking
115
116
// View.removeFrameMetricsListener(listener) throws IAE if it doesn't exist in the list, or
116
- // throws NPE if the list itself was never initialized.
117
+ // throws NPE if the list itself was never initialized. This NPE is fixed in API 29.
118
+ if (ex instanceof NullPointerException && Build .VERSION .SDK_INT > Build .VERSION_CODES .P ) {
119
+ throw ex ;
120
+ }
117
121
logger .warn (
118
122
"View not hardware accelerated. Unable to collect FrameMetrics. %s" , ex .toString ());
119
123
data = Optional .absent ();
You can’t perform that action at this time.
0 commit comments