.
This commit is contained in:
8
.idea/deploymentTargetDropDown.xml
generated
8
.idea/deploymentTargetDropDown.xml
generated
@@ -4,9 +4,9 @@
|
||||
<value>
|
||||
<entry key="app">
|
||||
<State>
|
||||
<targetSelectedWithDropDown>
|
||||
<runningDeviceTargetSelectedWithDropDown>
|
||||
<Target>
|
||||
<type value="QUICK_BOOT_TARGET" />
|
||||
<type value="RUNNING_DEVICE_TARGET" />
|
||||
<deviceKey>
|
||||
<Key>
|
||||
<type value="VIRTUAL_DEVICE_PATH" />
|
||||
@@ -14,8 +14,8 @@
|
||||
</Key>
|
||||
</deviceKey>
|
||||
</Target>
|
||||
</targetSelectedWithDropDown>
|
||||
<timeTargetWasSelectedWithDropDown value="2024-04-09T14:08:33.683278Z" />
|
||||
</runningDeviceTargetSelectedWithDropDown>
|
||||
<timeTargetWasSelectedWithDropDown value="2024-04-11T12:23:07.193709Z" />
|
||||
</State>
|
||||
</entry>
|
||||
</value>
|
||||
|
||||
@@ -192,7 +192,7 @@ public class LocationService extends Service implements LocationClient.DefaultLo
|
||||
.setOngoing(true)
|
||||
.build();
|
||||
|
||||
NotificationManager notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
|
||||
// NotificationManager notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
|
||||
|
||||
try {
|
||||
locationClient.getLocationUpdates(minInterval, this);
|
||||
@@ -201,7 +201,7 @@ public class LocationService extends Service implements LocationClient.DefaultLo
|
||||
}
|
||||
|
||||
startForeground(LOCATION_UPDATES_NOTIFICATION_ID, notification);
|
||||
notificationManager.notify(LOCATION_UPDATES_NOTIFICATION_ID, notification);
|
||||
// notificationManager.notify(LOCATION_UPDATES_NOTIFICATION_ID, notification);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -38,7 +38,11 @@ public class FoodReminderNotifyingService extends Service {
|
||||
|
||||
@Override
|
||||
public int onStartCommand(Intent intent, int flags, int startId) {
|
||||
int which_meal = intent.getIntExtra(WHICH_FOOD_REMINDER, -1);
|
||||
int which_meal = -1;
|
||||
|
||||
if (intent != null) {
|
||||
which_meal = intent.getIntExtra(WHICH_FOOD_REMINDER, -1);
|
||||
}
|
||||
|
||||
if (which_meal != -1){
|
||||
Log.d(TAG, "NO clicked for " + which_meal);
|
||||
|
||||
@@ -122,6 +122,7 @@ public class SplashFragment extends Fragment
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// do nothing
|
||||
return;
|
||||
}
|
||||
|
||||
binding.newUpdateView.getRoot().setVisibility(View.VISIBLE);
|
||||
@@ -149,7 +150,11 @@ public class SplashFragment extends Fragment
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<CallResponse<NewUpdate>> call, Throwable t) {
|
||||
Toast.makeText(requireContext(), "Couldn't connect.", Toast.LENGTH_SHORT).show();
|
||||
try {
|
||||
Toast.makeText(requireContext(), "Couldn't connect.", Toast.LENGTH_SHORT).show();
|
||||
} catch (Exception e) {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
binding.retry.setVisibility(View.VISIBLE);
|
||||
binding.loadAnim.setVisibility(View.GONE);
|
||||
@@ -162,9 +167,16 @@ public class SplashFragment extends Fragment
|
||||
binding.retry.setVisibility(View.GONE);
|
||||
binding.loadAnim.setVisibility(View.VISIBLE);
|
||||
|
||||
String patient_token = AppUtil.getPatientToken(requireContext());
|
||||
String cg_token = AppUtil.getCgToken(requireContext());
|
||||
boolean is_patient_logged_in = AppUtil.isPatientLoggedIn(requireContext());
|
||||
String patient_token = null;
|
||||
String cg_token = null;
|
||||
boolean is_patient_logged_in = false;
|
||||
try {
|
||||
patient_token = AppUtil.getPatientToken(requireContext());
|
||||
cg_token = AppUtil.getCgToken(requireContext());
|
||||
is_patient_logged_in = AppUtil.isPatientLoggedIn(requireContext());
|
||||
} catch (Exception e) {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
if (patient_token != null && !patient_token.isEmpty() && is_patient_logged_in){
|
||||
// user is already logged in as PATIENT
|
||||
@@ -238,17 +250,21 @@ public class SplashFragment extends Fragment
|
||||
binding.retry.setVisibility(View.VISIBLE);
|
||||
binding.loadAnim.setVisibility(View.GONE);
|
||||
|
||||
new AlertDialog.Builder(requireContext())
|
||||
.setTitle("Session Expired")
|
||||
.setMessage("Your login session has expired.\nPlease login again.")
|
||||
.setCancelable(true)
|
||||
.setPositiveButton("OKAY", (dialogInterface, i) -> {
|
||||
AppUtil.patientSignOut(requireContext());
|
||||
AppUtil.cgSignOut(requireContext());
|
||||
try {
|
||||
new AlertDialog.Builder(requireContext())
|
||||
.setTitle("Session Expired")
|
||||
.setMessage("Your login session has expired.\nPlease login again.")
|
||||
.setCancelable(true)
|
||||
.setPositiveButton("OKAY", (dialogInterface, i) -> {
|
||||
AppUtil.patientSignOut(requireContext());
|
||||
AppUtil.cgSignOut(requireContext());
|
||||
|
||||
gotoWelcomeFragment();
|
||||
})
|
||||
.show();
|
||||
gotoWelcomeFragment();
|
||||
})
|
||||
.show();
|
||||
} catch (Exception e) {
|
||||
// do nothing
|
||||
}
|
||||
}
|
||||
|
||||
private void gotoReActivateScreen(String cg_status, String token, int cg_xid, boolean is_caregiver){
|
||||
@@ -286,24 +302,36 @@ public class SplashFragment extends Fragment
|
||||
}
|
||||
|
||||
private void gotoPatientDashBoard() {
|
||||
Intent intent = new Intent(requireActivity(), DashBoardActivity.class);
|
||||
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
||||
startActivity(intent);
|
||||
requireActivity().finish();
|
||||
try {
|
||||
Intent intent = new Intent(requireActivity(), DashBoardActivity.class);
|
||||
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
||||
startActivity(intent);
|
||||
requireActivity().finish();
|
||||
} catch (Exception e) {
|
||||
// do nothing
|
||||
}
|
||||
}
|
||||
|
||||
private void gotoCgAuthScreen(){
|
||||
Intent intent = new Intent(requireActivity(), CgAuthActivity.class);
|
||||
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
||||
startActivity(intent);
|
||||
requireActivity().finish();
|
||||
try {
|
||||
Intent intent = new Intent(requireActivity(), CgAuthActivity.class);
|
||||
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
||||
startActivity(intent);
|
||||
requireActivity().finish();
|
||||
} catch (Exception e) {
|
||||
// do nothing
|
||||
}
|
||||
}
|
||||
|
||||
private void gotoCgDashBoard(){
|
||||
Intent intent = new Intent(requireActivity(), CaregiverDashActivity.class);
|
||||
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
||||
startActivity(intent);
|
||||
requireActivity().finish();
|
||||
try {
|
||||
Intent intent = new Intent(requireActivity(), CaregiverDashActivity.class);
|
||||
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
||||
startActivity(intent);
|
||||
requireActivity().finish();
|
||||
} catch (Exception e) {
|
||||
// do nothing
|
||||
}
|
||||
}
|
||||
|
||||
// get cg user data callback
|
||||
@@ -315,8 +343,12 @@ public class SplashFragment extends Fragment
|
||||
if (!careGiverData.caregiver_status.equals(AccountPresenter.ACC_ACTIVE_STR)){
|
||||
// account is not active
|
||||
|
||||
gotoReActivateScreen(careGiverData.caregiver_status, AppUtil.getCgToken(requireContext()),
|
||||
careGiverData.caregiver_xid, true);
|
||||
try {
|
||||
gotoReActivateScreen(careGiverData.caregiver_status, AppUtil.getCgToken(requireContext()),
|
||||
careGiverData.caregiver_xid, true);
|
||||
} catch (Exception e) {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -326,7 +358,12 @@ public class SplashFragment extends Fragment
|
||||
|
||||
if (careGiverData.isPatientAndCareGiverConnected == 1){
|
||||
// patient is linked with the caregiver
|
||||
int cg_security = AppUtil.getWantSecurityFlag(requireContext());
|
||||
int cg_security = 0;
|
||||
try {
|
||||
cg_security = AppUtil.getWantSecurityFlag(requireContext());
|
||||
} catch (Exception e) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (cg_security == AppUtil.NOT_ASKED_CG_SECURITY || cg_security == AppUtil.CG_SECURITY_NEEDED){
|
||||
// user want their app to be secure
|
||||
@@ -354,7 +391,11 @@ public class SplashFragment extends Fragment
|
||||
|
||||
@Override
|
||||
public void onCgDataFetchFailed(Throwable t, String message) {
|
||||
Toast.makeText(requireContext(), "Couldn't connect.", Toast.LENGTH_SHORT).show();
|
||||
try {
|
||||
Toast.makeText(requireContext(), "Couldn't connect.", Toast.LENGTH_SHORT).show();
|
||||
} catch (Exception e) {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
binding.retry.setVisibility(View.VISIBLE);
|
||||
binding.loadAnim.setVisibility(View.GONE);
|
||||
@@ -372,9 +413,13 @@ public class SplashFragment extends Fragment
|
||||
if (!patientData.caregiver_status.equals(AccountPresenter.DEFAULT_ACTIVE_STATUS)) {
|
||||
// account is in default state
|
||||
|
||||
gotoReActivateScreen(patientData.caregiver_status,
|
||||
AppUtil.getPatientToken(requireContext()),
|
||||
-1, false);
|
||||
try {
|
||||
gotoReActivateScreen(patientData.caregiver_status,
|
||||
AppUtil.getPatientToken(requireContext()),
|
||||
-1, false);
|
||||
} catch (Exception e) {
|
||||
// do nothing
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -385,7 +430,7 @@ public class SplashFragment extends Fragment
|
||||
try {
|
||||
AppUtil.setUserSubscribed(requireContext(), patientData.isCaregiverTakeSubscription == 1);
|
||||
} catch (Exception e) {
|
||||
// do nothing
|
||||
return;
|
||||
}
|
||||
|
||||
if (patientData.isCareGiverConnectedWithPatient == 1 && patientData.isCaregiverTakeSubscription == 1){
|
||||
@@ -414,7 +459,11 @@ public class SplashFragment extends Fragment
|
||||
@Override
|
||||
public void onProfileProgressFetchFailed(Throwable t, String message) {
|
||||
|
||||
Toast.makeText(requireContext(), "Couldn't connect.", Toast.LENGTH_SHORT).show();
|
||||
try {
|
||||
Toast.makeText(requireContext(), "Couldn't connect.", Toast.LENGTH_SHORT).show();
|
||||
} catch (Exception e) {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
binding.retry.setVisibility(View.VISIBLE);
|
||||
binding.loadAnim.setVisibility(View.GONE);
|
||||
|
||||
Reference in New Issue
Block a user