Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Intent for launching a specific App In CommCare #2710

Merged
merged 7 commits into from
Sep 24, 2023
Merged

Conversation

shubham1g5
Copy link
Contributor

@shubham1g5 shubham1g5 commented Sep 22, 2023

Summary

Adds a way to launch a particular CC app using an intent as -

val intent = Intent("org.commcare.dalvik.action.CommCareSession")
intent.putExtra(DispatchActivity.SESSION_ENDPOINT_APP_ID, appId)
startActivity(intent)

commit by commit

Safety Assurance

  • If the PR is high risk, "High Risk" label is set
  • I have confidence that this PR will not introduce a regression for the reasons below
  • Do we need to enhance manual QA test coverage ? If yes, "QA Note" label is set correctly

Automated test coverage

coverage for new functionality is in PR, installs and logins have ample tests.

Safety story

Tests should cover for any regressions on the dipatch and login pages.

@shubham1g5 shubham1g5 marked this pull request as ready for review September 22, 2023 01:35
OrangeAndGreen
OrangeAndGreen previously approved these changes Sep 22, 2023
Copy link
Contributor

@OrangeAndGreen OrangeAndGreen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One or two minor comments but otherwise this looks great!

if (sesssionEndpointAppID != null) {
CommCareApp currentApp = CommCareApplication.instance().getCurrentApp();
if (currentApp != null) {
return !currentApp.getUniqueId().contentEquals(sesssionEndpointAppID);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious about the use of contentEquals() here instead of just equals(). From what I understand contentEquals() just calls equals() under the hood when the passed input is a String, so functionally there should be no difference. So this may just be a consistency nit.

But in LoginActivity line 561 I see we're only calling equals(). When I search for "getUniqueId." I see 4 times that we use equals() and one that we use contentEquals(). Okay to ignore this if you don't think it's worth changing.

String presetAppId = activity.getPresetAppID();
if (presetAppId != null) {
for (ApplicationRecord readyApp : readyApps) {
if (readyApp.getUniqueId().contentEquals(presetAppId)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

contentEquals() again, see above comment.

@shubham1g5 shubham1g5 merged commit 8a6037f into master Sep 24, 2023
5 of 10 checks passed
@shubham1g5 shubham1g5 deleted the launchCcWithAppId branch September 24, 2023 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants