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

Disable SMS feature #2892

Merged
merged 3 commits into from
Feb 20, 2019
Merged

Disable SMS feature #2892

merged 3 commits into from
Feb 20, 2019

Conversation

grzesiek2010
Copy link
Member

@grzesiek2010 grzesiek2010 commented Feb 19, 2019

It's a temporarrly change we need to make because of #2738

What has been done to verify that this works as intended?

I tested settings in General Settings -> Server to be sure we are not able to have SMS feature enabled.
I also tested the dialog which should be displayed if I had SMS feature enabled in the previous version.

Why is this the best possible solution? Were any other approaches considered?

I just disable the feature keeping the whole code in order to bring it back in the feature if possible.
I also added a dialog which is displayed if a user had SMS feature enabled in the previous version.

How does this change affect users? Describe intentional changes to behavior and behavior that could have accidentally been affected by code changes. In other words, what are the regression risks?

It removes SMS options from General Settings -> Server so users are not able to send forms via SMS anymore.

Do we need any specific form for testing your changes? If so, please attach one.

No.

Does this change require updates to documentation? If so, please file an issue here and include the link below.

No, because we haven't documented SMS feature yet getodk/docs#781

Before submitting this PR, please make sure you have:

  • run ./gradlew checkAll and confirmed all checks still pass OR confirm CircleCI build passes and run ./gradlew connectedDebugAndroidTest locally.
  • verified that any code or assets from external sources are properly credited in comments and/or in the about file.
  • verified that any new UI elements use theme colors. UI Components Style guidelines

@grzesiek2010 grzesiek2010 requested a review from yanokwa February 19, 2019 15:26
@yanokwa yanokwa requested a review from cooperka February 19, 2019 22:49
Copy link
Contributor

@cooperka cooperka left a comment

Choose a reason for hiding this comment

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

FYI quoting from this comment:

The goal here isn't to comment the code, but rather the most minimal change to disable the call to the SMS permission

It would be great if all this code could be kept as-is, but put behind a "feature flag" so that if true => SMS works perfectly and if false => SMS permission is not required by the app.

An additional benefit is that we won't have to make any tricky reverts (potentially months from now) in order to get things working again; just flip the switch.

@@ -648,4 +654,13 @@ public void onChange(boolean selfChange) {
}
}

private void showSMSFeatureDisabledDialogIfNeeded() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Can we rename to e.g. disableSmsIfNeeded to clarify that this has side-effects?

@@ -664,4 +664,6 @@
<string name="background_location_disabled">This form wants to track your location but tracking is disabled. Please enable in the \u0020\u0020⋮\u0020\u0020 menu above.</string>
<string name="background_location_enabled">This form tracks your location. You can disable tracking in the \u0020\u0020⋮\u0020\u0020 menu above.</string>
<string name="open_file">Open file</string>
<string name="sms_feature_disabled_dialog_title">SMS feature disabled</string>
<string name="sms_feature_disabled_dialog_message">Sending forms via SMS has been disabled in v1.20.0 due to the new Google\'s permission policy. We will try to bring the feature back soon.</string>
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if we can be more helpful here, e.g. Sending forms via SMS has been temporarily disabled due to Google\'s new permission policy as of Collect version 1.20.0. We will try to bring the feature back soon. If you depend on this feature, you can downgrade to version 1.19.0

Does ODK host downloadable APKs anywhere for users without access to the play store?

Copy link
Member

Choose a reason for hiding this comment

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

We did a dialog for the removal of current() that I thought was great. You can find the PR https://github.com/opendatakit/collect/pull/2524/files.

In this case, the title should be "Sending via SMS Disabled" and the message should be "Sending submissions via SMS has been disabled due to Google Play Store restrictions. \n\nPlease make sure the person who configured this device reads the details below and takes action."

Then link to https://forum.opendatakit.org/t/17973 (the ID of a post that I'll write). This will allow us to put whatever actions people need to take there (including linking to APKs).

@yanokwa yanokwa added this to the v1.20 milestone Feb 20, 2019
Copy link
Member

@yanokwa yanokwa left a comment

Choose a reason for hiding this comment

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

Overall, I think this is great, @grzesiek2010. Just the dialog change then I think it should go into testing.

We do lose some data (e.g., people who upgrade will have to re-enable the setting), but it's not the worst thing in the world.

@@ -664,4 +664,6 @@
<string name="background_location_disabled">This form wants to track your location but tracking is disabled. Please enable in the \u0020\u0020⋮\u0020\u0020 menu above.</string>
<string name="background_location_enabled">This form tracks your location. You can disable tracking in the \u0020\u0020⋮\u0020\u0020 menu above.</string>
<string name="open_file">Open file</string>
<string name="sms_feature_disabled_dialog_title">SMS feature disabled</string>
<string name="sms_feature_disabled_dialog_message">Sending forms via SMS has been disabled in v1.20.0 due to the new Google\'s permission policy. We will try to bring the feature back soon.</string>
Copy link
Member

Choose a reason for hiding this comment

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

We did a dialog for the removal of current() that I thought was great. You can find the PR https://github.com/opendatakit/collect/pull/2524/files.

In this case, the title should be "Sending via SMS Disabled" and the message should be "Sending submissions via SMS has been disabled due to Google Play Store restrictions. \n\nPlease make sure the person who configured this device reads the details below and takes action."

Then link to https://forum.opendatakit.org/t/17973 (the ID of a post that I'll write). This will allow us to put whatever actions people need to take there (including linking to APKs).

@mmarciniak90
Copy link
Contributor

Tested with success

Verified on Android: 4.2, 4.4, 5.1, 6.0, 7.0, 8.1

Verified cases:

  • Dialog
  • Verified cases when sending via SMS was set and was not set on the previous version
  • Read details is clickable but topic needs to be created on forum
  • Rotating
  • Light/Dark theme
  • Sending SMS during filling form via Launch button is still possible

@opendatakit-bot unlabel "needs testing"
@opendatakit-bot label "behavior verified"

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.

5 participants