-
Notifications
You must be signed in to change notification settings - Fork 113
[MBL-19874][All] Privacy Consent dialog #3613
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
Merged
Merged
Changes from 4 commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
870e1b6
[MBL-19875][All] Add mobile_consent flag to auth session
hermannakos bec6f0d
fix tests
hermannakos e055f34
[MBL-19874][All] Add cookie consent dialog
hermannakos 8f4c3de
Merge branch 'master' into MBL-19874-privacy-consent-dialog
hermannakos 2d5f5b7
CRs
hermannakos cc614fe
fix tests
hermannakos 41a0c92
Merge branch 'master' into MBL-19874-privacy-consent-dialog
tamaskozmer f6a266d
Conflict resolution.
tamaskozmer bda5b34
Fixed horizon build.
tamaskozmer a49a57e
Removed consent storage on the web.
tamaskozmer 4fd0b99
Fixed oauth api call.
tamaskozmer b4b7b27
Restart Pendo tracking when consent is accepted in the settings.
tamaskozmer 7f39dec
Fixed UI issues.
tamaskozmer 2b3d6cf
Merge branch 'master' into MBL-19874-privacy-consent-dialog
tamaskozmer 030b281
Fixed tests.
tamaskozmer 389b546
Merge branch 'master' into MBL-19874-privacy-consent-dialog
tamaskozmer e04475b
Removed feature flag dependency for pandata.
tamaskozmer bf4230c
Correctly handle change user consent.
tamaskozmer 025a7fa
Fixed routing to NGC.
tamaskozmer 08166fd
Fixed QR login.
tamaskozmer d8271fa
New UI for changing the privacy settings.
tamaskozmer 8305085
Fixed review items
tamaskozmer b604990
Changed description and title order.
tamaskozmer 4d406d5
Fixed tests
tamaskozmer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
48 changes: 48 additions & 0 deletions
48
apps/parent/src/main/java/com/instructure/parentapp/di/feature/CookieConsentModule.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| /* | ||
| * Copyright (C) 2026 - present Instructure, Inc. | ||
| * | ||
| * This program is free software: you can redistribute it and/or modify | ||
| * it under the terms of the GNU General Public License as published by | ||
| * the Free Software Foundation, version 3 of the License. | ||
| * | ||
| * This program is distributed in the hope that it will be useful, | ||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| * GNU General Public License for more details. | ||
| * | ||
| * You should have received a copy of the GNU General Public License | ||
| * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| */ | ||
| package com.instructure.parentapp.di.feature | ||
|
|
||
| import com.instructure.pandautils.features.cookieconsent.AnalyticsConsentHandler | ||
| import com.instructure.pandautils.features.cookieconsent.CookieConsentNamespace | ||
| import dagger.Module | ||
| import dagger.Provides | ||
| import dagger.hilt.InstallIn | ||
| import dagger.hilt.components.SingletonComponent | ||
| import sdk.pendo.io.Pendo | ||
|
|
||
| @Module | ||
| @InstallIn(SingletonComponent::class) | ||
| class CookieConsentModule { | ||
|
|
||
| @Provides | ||
| fun provideCookieConsentNamespace(): CookieConsentNamespace { | ||
| return CookieConsentNamespace.PARENT | ||
| } | ||
|
|
||
| @Provides | ||
| fun provideAnalyticsConsentHandler(): AnalyticsConsentHandler { | ||
| return object : AnalyticsConsentHandler { | ||
| override fun onConsentGranted() { | ||
| // Parent app does not schedule pandata upload | ||
| // Pendo session will be started on next app launch via SplashViewModel | ||
| } | ||
|
|
||
| override fun onConsentRevoked() { | ||
| Pendo.endSession() | ||
| } | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
...arent/src/main/java/com/instructure/parentapp/features/login/ParentCookieConsentRouter.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| /* | ||
| * Copyright (C) 2026 - present Instructure, Inc. | ||
| * | ||
| * This program is free software: you can redistribute it and/or modify | ||
| * it under the terms of the GNU General Public License as published by | ||
| * the Free Software Foundation, version 3 of the License. | ||
| * | ||
| * This program is distributed in the hope that it will be useful, | ||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| * GNU General Public License for more details. | ||
| * | ||
| * You should have received a copy of the GNU General Public License | ||
| * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| */ | ||
| package com.instructure.parentapp.features.login | ||
|
|
||
| import android.content.Intent | ||
| import androidx.fragment.app.FragmentActivity | ||
| import com.instructure.loginapi.login.features.cookieconsent.CookieConsentRouter | ||
| import com.instructure.parentapp.features.main.MainActivity | ||
|
|
||
| class ParentCookieConsentRouter( | ||
| private val activity: FragmentActivity | ||
| ) : CookieConsentRouter { | ||
|
|
||
| override fun startApp() { | ||
| val intent = Intent(activity, MainActivity::class.java) | ||
| activity.intent?.extras?.let { intent.putExtras(it) } | ||
| intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK | ||
| activity.startActivity(intent) | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 65 additions & 0 deletions
65
apps/student/src/main/java/com/instructure/student/di/feature/CookieConsentModule.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| /* | ||
| * Copyright (C) 2026 - present Instructure, Inc. | ||
| * | ||
| * This program is free software: you can redistribute it and/or modify | ||
| * it under the terms of the GNU General Public License as published by | ||
| * the Free Software Foundation, version 3 of the License. | ||
| * | ||
| * This program is distributed in the hope that it will be useful, | ||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| * GNU General Public License for more details. | ||
| * | ||
| * You should have received a copy of the GNU General Public License | ||
| * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| */ | ||
| package com.instructure.student.di.feature | ||
|
|
||
| import android.content.Context | ||
| import androidx.work.WorkManager | ||
| import com.instructure.pandautils.features.cookieconsent.AnalyticsConsentHandler | ||
| import com.instructure.pandautils.features.cookieconsent.CookieConsentNamespace | ||
| import dagger.Module | ||
| import dagger.Provides | ||
| import dagger.hilt.InstallIn | ||
| import dagger.hilt.android.qualifiers.ApplicationContext | ||
| import dagger.hilt.components.SingletonComponent | ||
| import sdk.pendo.io.Pendo | ||
|
|
||
| @Module | ||
| @InstallIn(SingletonComponent::class) | ||
| class CookieConsentModule { | ||
|
|
||
| @Provides | ||
| fun provideCookieConsentNamespace(): CookieConsentNamespace { | ||
| return CookieConsentNamespace.STUDENT | ||
| } | ||
|
|
||
| @Provides | ||
| fun provideAnalyticsConsentHandler(@ApplicationContext context: Context): AnalyticsConsentHandler { | ||
| return object : AnalyticsConsentHandler { | ||
| override fun onConsentGranted() { | ||
| // Pendo session will be started on next app launch via CallbackActivity | ||
| // Re-schedule pandata upload | ||
| val workManager = WorkManager.getInstance(context) | ||
| val workRequest = androidx.work.PeriodicWorkRequestBuilder<com.instructure.pandautils.analytics.pageview.PageViewUploadWorker>( | ||
| 15, java.util.concurrent.TimeUnit.MINUTES | ||
| ).setConstraints( | ||
| androidx.work.Constraints.Builder() | ||
| .setRequiredNetworkType(androidx.work.NetworkType.CONNECTED) | ||
| .build() | ||
| ).build() | ||
| workManager.enqueueUniquePeriodicWork( | ||
| "pageView-student", | ||
| androidx.work.ExistingPeriodicWorkPolicy.KEEP, | ||
| workRequest | ||
| ) | ||
| } | ||
|
|
||
| override fun onConsentRevoked() { | ||
| Pendo.endSession() | ||
| WorkManager.getInstance(context).cancelUniqueWork("pageView-student") | ||
| } | ||
| } | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
...tudent/src/main/java/com/instructure/student/features/login/StudentCookieConsentRouter.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| /* | ||
| * Copyright (C) 2026 - present Instructure, Inc. | ||
| * | ||
| * This program is free software: you can redistribute it and/or modify | ||
| * it under the terms of the GNU General Public License as published by | ||
| * the Free Software Foundation, version 3 of the License. | ||
| * | ||
| * This program is distributed in the hope that it will be useful, | ||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| * GNU General Public License for more details. | ||
| * | ||
| * You should have received a copy of the GNU General Public License | ||
| * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| */ | ||
| package com.instructure.student.features.login | ||
|
|
||
| import android.content.Intent | ||
| import androidx.fragment.app.FragmentActivity | ||
| import com.instructure.horizon.HorizonActivity | ||
| import com.instructure.loginapi.login.CANVAS_CAREER | ||
| import com.instructure.loginapi.login.features.cookieconsent.CookieConsentRouter | ||
| import com.instructure.student.activity.NavigationActivity | ||
|
|
||
| class StudentCookieConsentRouter( | ||
| private val activity: FragmentActivity | ||
| ) : CookieConsentRouter { | ||
|
|
||
| override fun startApp() { | ||
| val isCanvasCareer = activity.intent?.getBooleanExtra(CANVAS_CAREER, false) ?: false | ||
| val intent = if (isCanvasCareer) { | ||
| Intent(activity, HorizonActivity::class.java) | ||
| } else { | ||
| Intent(activity, NavigationActivity.startActivityClass) | ||
| } | ||
|
|
||
| activity.intent?.extras?.let { extras -> | ||
| intent.putExtras(extras) | ||
| } | ||
|
|
||
| intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK | ||
| activity.startActivity(intent) | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.