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

Add Enable/Disable functionality to Android #36

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

technizor
Copy link

@technizor technizor commented Oct 19, 2016

Description

Leverage Android SharedPreferences to allow an Android application to programmatically enable/disable the privacy screen by setting the boolean value of PrivacyScreenPlugin.KEY_PRIVACY_SCREEN_ENABLED. The default value is true.

Note that an application restart is required for changes to take effect on the main activity.

Related Issue

#26 Android counterpart

Motivation and Context

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Using the Cordova activity's default SharedPreferences, read the boolean value of the key constant KEY_PRIVACY_SCREEN_ENABLED to determine whether to enable the privacy screen. Default value is true.
Allow retrieval and modification of preference using CordovaPlugin.onMessage: "isPrivacyScreenEnabled", "setPrivacyScreenEnabled".
Handle error case where the SharedPreference value is not a Boolean.
Add optional bad value recovery: "true" -> true; "false" -> false; all other cases return the default value of true and replace the value stored.
@johnroper100
Copy link

I like this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants