@@ -338,19 +338,20 @@ public void registerLifecycleCallbacks(final @NotNull Application application) {
338338 appLaunchedInForeground .resetValue ();
339339 application .registerActivityLifecycleCallbacks (instance );
340340
341- final @ Nullable ActivityManager activityManager =
342- (ActivityManager ) application .getSystemService (Context .ACTIVITY_SERVICE );
343-
344- if (activityManager != null && Build .VERSION .SDK_INT >= Build .VERSION_CODES .VANILLA_ICE_CREAM ) {
345- final List <ApplicationStartInfo > historicalProcessStartReasons =
346- activityManager .getHistoricalProcessStartReasons (1 );
347- if (!historicalProcessStartReasons .isEmpty ()) {
348- final @ NotNull ApplicationStartInfo info = historicalProcessStartReasons .get (0 );
349- if (info .getStartupState () == ApplicationStartInfo .STARTUP_STATE_STARTED ) {
350- if (info .getStartType () == ApplicationStartInfo .START_TYPE_COLD ) {
351- appStartType = AppStartType .COLD ;
352- } else {
353- appStartType = AppStartType .WARM ;
341+ if (Build .VERSION .SDK_INT >= Build .VERSION_CODES .VANILLA_ICE_CREAM ) {
342+ final @ Nullable ActivityManager activityManager =
343+ (ActivityManager ) application .getSystemService (Context .ACTIVITY_SERVICE );
344+ if (activityManager != null ) {
345+ final List <ApplicationStartInfo > historicalProcessStartReasons =
346+ activityManager .getHistoricalProcessStartReasons (1 );
347+ if (!historicalProcessStartReasons .isEmpty ()) {
348+ final @ NotNull ApplicationStartInfo info = historicalProcessStartReasons .get (0 );
349+ if (info .getStartupState () == ApplicationStartInfo .STARTUP_STATE_STARTED ) {
350+ if (info .getStartType () == ApplicationStartInfo .START_TYPE_COLD ) {
351+ appStartType = AppStartType .COLD ;
352+ } else {
353+ appStartType = AppStartType .WARM ;
354+ }
354355 }
355356 }
356357 }
0 commit comments