Regulations require that an app must not call sensitive APIs before a user clicks the Agree button in the privacy policy dialog. To meet this requirement, mPaaS for Android supports this feature in all versions of the 10.1.68 baseline, version 10.1.60.5 and later of the 10.1.60 baseline, and version 10.1.32.16 and later of the 10.1.32 baseline. If your project uses the Framework component, follow the instructions in this document to modify your project.
Usage instructions
Display a privacy permission dialog in your application. After the user agrees, call the framework API to send an Agree broadcast. When the framework receives the broadcast, it completes the initialization and records the user's consent in sharedpreference. After the initialization is complete, the framework notifies your application through a callback. You can use the features of mPaaS components only after you receive this callback.
Procedure
The Activity that displays the privacy dialog must not inherit from the mPaaS BaseActivity. This is because the BaseActivity performs instrumentation for data collection, which would cause the app to collect private data before the user agrees to the privacy policy.
In
meta-data, configure the switch for the privacy permission dialog. This feature is disabled by default.<meta-data android:name="privacy_switcher" android:value="true"></meta-data>Use the following API to send the Agree broadcast.
NoteSend the broadcast only after the user clicks Agree.
QuinoxlessPrivacyUtil.sendPrivacyAgreedBroadcast(Context context);Check if the user has agreed to the privacy permissions.
NoteBefore calling this API, initialize the mPaaS framework.
QuinoxlessPrivacyUtil.isUserAgreed(Context context);Update the user consent flag for privacy permissions. This lets you display the dialog again in specific scenarios.
QuinoxlessPrivacyUtil.setUserAgreedState(Context context, **boolean **agreed);The callback is invoked when the framework initialization is complete.
If you use
QuinoxlessApplicationLike, use mPaaS features after theonMPaaSFrameworkInitFinishedcallback.NoteYou must use
QuinoxlessApplicationLikeif you need the hotpatching feature.If you do not use
QuinoxlessApplicationLike, use mPaaS features after theonPostInitmethod in theIInitCallbackcallback.QuinoxlessFramework.setup(this, new IInitCallback() { @Override public void onPostInit() { } });
If you use baseline version 10.1.68.42 or later and need to clear the privacy status, call
QuinoxlessPrivacyUtil.clearPrivacyState(context);before making any of the other API calls mentioned in this procedure.