Skip to content

Commit fe5d1a3

Browse files
committed
Merge branch 'main' into fix/66842
2 parents 4148ccb + 8dcc9d3 commit fe5d1a3

201 files changed

Lines changed: 5767 additions & 1290 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/deployBlocker.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ jobs:
99
updateChecklist:
1010
if: github.event.label.name == 'DeployBlockerCash'
1111
uses: ./.github/workflows/createDeployChecklist.yml
12+
secrets: inherit
1213

1314
deployBlocker:
1415
if: github.event.label.name == 'DeployBlockerCash'

Mobile-Expensify

android/app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ android {
114114
minSdkVersion rootProject.ext.minSdkVersion
115115
targetSdkVersion rootProject.ext.targetSdkVersion
116116
multiDexEnabled rootProject.ext.multiDexEnabled
117-
versionCode 1009019205
118-
versionName "9.1.92-5"
117+
versionCode 1009019303
118+
versionName "9.1.93-3"
119119
// Supported language variants must be declared here to avoid from being removed during the compilation.
120120
// This also helps us to not include unnecessary language variants in the APK.
121121
resConfigs "en", "es"

android/app/src/main/AndroidManifest.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,11 @@
155155
</intent-filter>
156156
</activity>
157157

158+
<activity
159+
android:name="com.plaid.internal.link.LinkActivity"
160+
android:launchMode="singleTask"
161+
tools:replace="android:launchMode"/>
162+
158163
<meta-data
159164
android:name="com.urbanairship.reactnative.AIRSHIP_EXTENDER"
160165
android:value="com.expensify.chat.customairshipextender.CustomAirshipExtender" />

android/app/src/main/java/com/expensify/chat/AppStateTrackerModule.java

Lines changed: 0 additions & 34 deletions
This file was deleted.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package com.expensify.chat
2+
3+
import com.facebook.react.bridge.Promise
4+
import com.facebook.react.bridge.ReactApplicationContext
5+
import com.facebook.react.bridge.ReactContextBaseJavaModule
6+
import com.facebook.react.bridge.ReactMethod
7+
8+
import com.expensify.chat.MainActivity
9+
10+
/**
11+
* Checks whether the app was relaunched from the app icon in app drawer, not from recent apps.
12+
*/
13+
class AppStateTrackerModule(reactContext: ReactApplicationContext) : ReactContextBaseJavaModule(
14+
reactContext
15+
) {
16+
override fun getName(): String = "AppStateTracker"
17+
18+
@ReactMethod
19+
fun getWasAppRelaunchedFromIcon(promise: Promise) {
20+
val activity = currentActivity
21+
if (activity is MainActivity) {
22+
promise.resolve(activity.wasAppRelaunchedFromIcon)
23+
activity.wasAppRelaunchedFromIcon = false
24+
} else {
25+
promise.resolve(false)
26+
}
27+
}
28+
}

android/app/src/main/java/com/expensify/chat/MainActivity.kt

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ class MainActivity : ReactActivity() {
2525
*/
2626
override fun getMainComponentName() = "NewExpensify"
2727

28+
var wasAppRelaunchedFromIcon: Boolean = false
29+
2830
/**
2931
* Returns the instance of the [ReactActivityDelegate]. Here we use a util class [ ] which allows you to easily enable Fabric and Concurrent React
3032
* (aka React 18) with two boolean flags.
@@ -62,6 +64,13 @@ class MainActivity : ReactActivity() {
6264

6365
override fun onNewIntent(intent: Intent) {
6466
super.onNewIntent(intent)
67+
68+
if (intent.hasCategory(Intent.CATEGORY_LAUNCHER)
69+
&& intent.getAction() != null
70+
&& intent.getAction().equals(Intent.ACTION_MAIN)) {
71+
wasAppRelaunchedFromIcon = true
72+
}
73+
6574
setIntent(intent) // Must store the new intent unless getIntent() will return the old one
6675
handleIntent(intent)
6776
}
@@ -108,6 +117,6 @@ class MainActivity : ReactActivity() {
108117

109118
override fun onStart() {
110119
super.onStart()
111-
RNPerformance.getInstance().mark("appCreationEnd", false);
120+
RNPerformance.getInstance().mark("appCreationEnd", false)
112121
}
113122
}

android/app/src/main/java/com/expensify/chat/MainApplication.kt

Lines changed: 1 addition & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
package com.expensify.chat
22

3-
import android.app.Activity
43
import com.facebook.react.common.assets.ReactFontManager
54

65
import android.app.ActivityManager
7-
import android.app.ActivityManager.RunningAppProcessInfo
8-
import android.content.Context
96
import android.content.res.Configuration
107
import android.database.CursorWindow
11-
import android.os.Bundle
128
import android.os.Process
139
import androidx.multidex.MultiDexApplication
1410
import com.expensify.chat.bootsplash.BootSplashPackage
@@ -31,15 +27,10 @@ import expo.modules.ApplicationLifecycleDispatcher
3127
import expo.modules.ReactNativeHostWrapper
3228

3329
class MainApplication : MultiDexApplication(), ReactApplication {
34-
var currentState: String = "active"
35-
private set
36-
var prevState: String = "inactive"
37-
private set
38-
3930
override val reactNativeHost: ReactNativeHost = ReactNativeHostWrapper(this, object : DefaultReactNativeHost(this) {
4031
override fun getUseDeveloperSupport() = BuildConfig.DEBUG
4132

42-
override fun getPackages(): List<ReactPackage> =
33+
override fun getPackages(): List<ReactPackage> =
4334
PackageList(this).packages.apply {
4435
// Packages that cannot be autolinked yet can be added manually here, for example:
4536
// add(MyReactNativePackage());
@@ -73,30 +64,6 @@ class MainApplication : MultiDexApplication(), ReactApplication {
7364
return
7465
}
7566

76-
registerActivityLifecycleCallbacks(object: ActivityLifecycleCallbacks {
77-
override fun onActivityStarted(p0: Activity) {
78-
prevState = currentState
79-
currentState = "active"
80-
}
81-
82-
override fun onActivityStopped(p0: Activity) {
83-
val isOnForeground = isAppOnForeground()
84-
prevState = currentState
85-
currentState = if (isOnForeground) "active" else "background"
86-
}
87-
88-
override fun onActivityDestroyed(p0: Activity) {
89-
val isOnForeground = isAppOnForeground()
90-
prevState = currentState
91-
currentState = if (isOnForeground) "active" else "background"
92-
}
93-
94-
override fun onActivityCreated(p0: Activity, p1: Bundle?) {}
95-
override fun onActivityResumed(p0: Activity) {}
96-
override fun onActivityPaused(p0: Activity) {}
97-
override fun onActivitySaveInstanceState(p0: Activity, p1: Bundle) {}
98-
})
99-
10067
SoLoader.init(this, OpenSourceMergedSoMapping)
10168
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
10269
// If you opted-in for the New Architecture, we load the native entry point for this app.
@@ -139,22 +106,4 @@ class MainApplication : MultiDexApplication(), ReactApplication {
139106
it.pid == pid && it.processName.endsWith(":onfido_process")
140107
}
141108
}
142-
143-
/**
144-
* Checks if the application is currently running in the foreground.
145-
* https://stackoverflow.com/a/8490088/8398300
146-
*/
147-
private fun isAppOnForeground(): Boolean {
148-
val activityManager = applicationContext.getSystemService(Context.ACTIVITY_SERVICE) as ActivityManager
149-
val appProcesses = activityManager.runningAppProcesses ?: return false
150-
val packageName: String = applicationContext.getPackageName()
151-
for (appProcess in appProcesses) {
152-
if (appProcess.importance == RunningAppProcessInfo.IMPORTANCE_FOREGROUND &&
153-
appProcess.processName == packageName
154-
) {
155-
return true
156-
}
157-
}
158-
return false
159-
}
160109
}
Lines changed: 105 additions & 0 deletions
Loading

babel.config.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ if (!process.env.ELECTRON_ENV && process.env.npm_lifecycle_event !== 'desktop')
5555
defaultPluginsForWebpack.push([
5656
'@fullstory/babel-plugin-annotate-react',
5757
{
58-
'react-native-web': true,
5958
native: true,
6059
},
6160
]);

0 commit comments

Comments
 (0)