HomePhabricator
Diffusion Comm 78223f2dd741

[native] [33/40] RN 0.70: Replace old AndroidLifecycleModule with new Expo one

Description

[native] [33/40] RN 0.70: Replace old AndroidLifecycleModule with new Expo one

Summary:
Context about this new Expo module in D5932.

Depends on D5933

Test Plan:
I patched the following into native/root.react.js:

import * as AndroidLifecycleModule from './lifecycle/lifecycle-module';

if (Platform.OS === 'android') {
  console.log(`androidLifecycle.ACTIVE: ${AndroidLifecycleModule.ACTIVE ?? 'null or undefined'}`);
  console.log(`androidLifecycle.initialStatus: ${AndroidLifecycleModule.initialStatus ?? 'null or undefined'}`);
  addLifecycleListener(status => { console.log(`onChange ${status ?? 'null or undefined'}`) });
}

It resulted in the following output after I started, then backgrounded, and then foregrounded the app:

LOG  androidLifecycle.ACTIVE: active
LOG  androidLifecycle.initialStatus: active
LOG  onChange background
LOG  onChange active

Reviewers: bartek!, tomek

Subscribers: atul

Differential Revision: https://phab.comm.dev/D5934