@@ -146,6 +146,7 @@ public class FormEntryActivity extends SaveSessionCommCareActivity<FormEntryActi
146146 private SecretKeySpec symetricKey = null ;
147147
148148 public static AndroidFormController mFormController ;
149+ private static volatile boolean isFormEntryActive = false ;
149150
150151 private boolean mIncompleteEnabled = true ;
151152 private boolean instanceIsReadOnly = false ;
@@ -1027,6 +1028,7 @@ private void restorePriorStates() {
10271028
10281029 private void loadForm () {
10291030 mFormController = null ;
1031+ isFormEntryActive = false ;
10301032 instanceState .setFormRecordPath (null );
10311033 InterruptedFormState savedFormSession = null ;
10321034
@@ -1131,6 +1133,7 @@ private void handleFormLoadCompletion(AndroidFormController fc) {
11311133 }
11321134
11331135 mFormController = fc ;
1136+ isFormEntryActive = true ;
11341137 FirebaseAnalyticsUtil .reportFormEntry (getCurrentFormXmlnsFailSafe ());
11351138
11361139 // Newer menus may have already built the menu, before all data was ready
@@ -1253,7 +1256,7 @@ protected void onDestroy() {
12531256 }
12541257
12551258 if (!isChangingConfigurations ()) {
1256- mFormController = null ;
1259+ isFormEntryActive = false ;
12571260 }
12581261
12591262 TextToSpeechConverter .INSTANCE .shutDown ();
@@ -1722,4 +1725,8 @@ public CommCareActivityUIController getUIController() {
17221725 public SecretKeySpec getSymetricKey () {
17231726 return symetricKey ;
17241727 }
1728+
1729+ public static boolean isFormEntryInProgress () {
1730+ return isFormEntryActive ;
1731+ }
17251732}
0 commit comments