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

Change permission UI on Android to enable / expose "permission until X" ability #14128

Closed
pes10k opened this issue Feb 12, 2021 · 16 comments · Fixed by brave/brave-core#8466
Closed
Labels
design/needs-mock-up needs-mockup A feature which needs design mockup to be implemented. OS/Android Fixes related to Android browser functionality privacy/feature User-facing privacy- & security-focused feature work. privacy/permissions privacy features related to limiting, lifetime or other permissions privacy privacy-pod Feature work for the Privacy & Web Compatibility pod QA Pass - Android ARM QA Pass - Android Tab QA/Yes release-notes/exclude

Comments

@pes10k
Copy link
Contributor

pes10k commented Feb 12, 2021

This issue is follow up work for #14126

This issue is specifically to track the design and implementation of UI for brave-android, to enable / expose the new capabilities defined in #14126

@pes10k pes10k added OS/Android Fixes related to Android browser functionality privacy privacy-pod Feature work for the Privacy & Web Compatibility pod privacy/feature User-facing privacy- & security-focused feature work. privacy/permissions privacy features related to limiting, lifetime or other permissions design/needs-mock-up needs-mockup A feature which needs design mockup to be implemented. labels Feb 12, 2021
@deeppandya
Copy link

In android, we can't change the permission UI android system provides. and we have to use the default android system UI for runtime permissions. and the options we get on the permission it depends on android OS version.

@iefremov
Copy link
Contributor

@deeppandya Can you elaborate more? Do you mean that dialogs shown by the browser on, say, https://permission.site/ do depend on Android UIs?

@deeppandya
Copy link

@iefremov we can update below UI,
Screenshot_20210316-205221
But UI below, we can't update as it's from the android system and the options differs in different OS. Below UI is from android 11,
Screenshot_20210316-205231
Below UI is from android 10,
Screenshot_20210316-210009
Below is the UI from android 7.1.2,
Screenshot_20210316-210304

@iefremov
Copy link
Contributor

gotcha, thanks @deeppandya - this was basically my understanding as well

@goodov goodov added this to the 1.24.x - Nightly milestone Apr 1, 2021
@goodov
Copy link
Member

goodov commented Apr 7, 2021

@karenkliu I'm currently adding this into Android UI, made a quick demo. Can you take a look please? wdyt?

r258bmipIV.mp4

@deeppandya
Copy link

@goodov how would it work with default android permissions ?

@karenkliu
Copy link

karenkliu commented Apr 7, 2021

@goodov Can we use the radio button selection on Android instead of a dropdown interaction? Radio buttons seem more mobile-friendly and suitable for this kind of Android dialog. We're also missing a "Give permission:" title above the selection, to make it clear the options go wit the "Allow" button.

@goodov
Copy link
Member

goodov commented Apr 8, 2021

how would it work with default android permissions ?

@deeppandya you mean those dialogs that Android OS shows to the user? they will be the same, we don't touch them.

Can we use the radio button selection on Android instead of a dropdown interaction? Radio buttons seem more mobile-friendly and suitable for this kind of Android dialog. We're also missing a "Give permission:" title above the selection, to make it clear the options go wit the "Allow" button.

@karenkliu thanks! Yeah, you're right, will try radio buttons, but I'm worried if the dialog will be too big in this case. Good catch about "Give permission:" text!

@deeppandya
Copy link

how would it work with default android permissions ?

@deeppandya you mean those dialogs that Android OS shows to the user? they will be the same, we don't touch them.

@karenkliu thanks! Yeah, you're right, will try radio buttons, but I'm worried if the dialog will be too big in this case. Good catch about "Give permission:" text!

Okay but in that case, wouldn't it be confusing for users ? Because on this dialog user allow to use location for 24 hours but in the app it would be enabled once user allows it.

@goodov
Copy link
Member

goodov commented Apr 8, 2021

Okay but in that case, wouldn't it be confusing for users ? Because on this dialog user allow to use location for 24 hours but in the app it would be enabled once user allows it.

I think in the first dialog the user should see that the permission is for the app Brave, and in the second is for the website browserleaks.com. For me it's quite clear. Maybe people from UX/UI can comment more on this.

@goodov
Copy link
Member

goodov commented Apr 8, 2021

@karenkliu take a look? Maybe you can make a design mock for this if we're not quite there yet?

zkOul6iU63.mp4

@karenkliu
Copy link

@goodov This looks good to me 👍 According to Deep different Android OS supports different permission lifetimes. So we should make sure the dialog permission options match what is supported by the OS.

@goodov
Copy link
Member

goodov commented Apr 22, 2021

This is currently in nightly. An uplift to 1.24.x will be created after "origin-based permission lifetime support" uplift is merged (brave/brave-core#8585).

@goodov
Copy link
Member

goodov commented Apr 26, 2021

Uplift PR is created, but we need some testing on nightly so we can be safe to uplift it.
brave/brave-core#8639

@stephendonner
Copy link

Uplift PR is created, but we need some testing on nightly so we can be safe to uplift it.
brave/brave-core#8639

I'll grab this tomorrow; just verified desktop's #14126 on macOS-Intel 🥳

@srirambv
Copy link
Contributor

Verification passed on OnePlus 6T with Android 10 running 1.24.81 x64 build

Time Based checks

20 Sec timer - Allow (Camera + Microphone)
  • Verified passing argument to set permission timer to 20 sec shows up as an option
  • Verified selecting 20 sec option and allow enables the Camera + Microphone on the site and system notification shows up
  • Verified site is added under allow list for both Camera + Microphone
  • Verified after 20 sec the site permissions are removed automatically
  • Verified reloading the page and selecting Camera on the page triggers the permission prompt again
20 Sec option Select 20 sec timer Site requesting permission Site added to allow list
image image image image
20 Sec timer - Block Forever (Camera + Microphone)
  • Verified setting permission to Block Forever adds an entry under blocked list for the site

Origin-based cases

Origin-based behaviour, multiple tabs (Location)
  • Verified visiting browserleaks.com/geo triggers permission prompt
  • Verified selecting Until I close this page and select allow sets the permission for the page and detects location
  • Verified visiting permission.site on a second tab and selecting location triggers prompt
  • Verified selecting Block Forever adds the site to blocked list
  • Verified site settings shows both sites under allowed/blocked respectively
  • Verified closing browserleaks.com/geo tab resets the site permission from site settings
  • Verified revisiting the page on a new tab triggers the prompt again

24-hour / 1-week cases

23 hrs test
  • Verified allowing permission on a site for 24hrs works fine
  • Verified restarting the browser and loading the page doesn't trigger permission prompt
  • Verified moving device date ahead to 23hrs and reloading the page/opening in a new tab doesn't trigger the permission prompt
25 hrs test
  • Verified allowing permission on a site for 24hrs works fine
  • Verified restarting the browser and loading the page doesn't trigger permission prompt
  • Verified moving device date ahead to 25hrs and reloading the page/opening in a new tab trigger the permission prompt
6 Days 12hrs test
  • Verified allowing permission on a site for 1 week works fine
  • Verified restarting the browser and loading the page doesn't trigger permission prompt
  • Verified moving device date ahead to 6 days & 12 hrs ahead and reloading the page/opening in a new tab doesn't trigger the permission prompt
8 days Test
  • Verified allowing permission on a site for 1 week works fine
  • Verified restarting the browser and loading the page doesn't trigger permission prompt
  • Verified moving device date ahead to 8days and reloading the page/opening in a new tab trigger the permission prompt

Allow/Block forever cases


Allow forever (Location)
  • Verified selecting location on https://permission.site triggers permission prompt
  • Verified able to set the permission to forever
  • Verified reloading the page doesn't trigger the prompt
  • Verified site settings adds the site to allow list
  • Verified moving device date ahead by a month and revisiting the page in a new tab doesn't trigger the notification
Block Forever (Notifications)
  • Verified selecting location on https://permission.site triggers permission prompt
  • Verified able to set the permission to Block Forever
  • Verified site settings adds the site to block list
  • Verified moving device date ahead by a month and revisiting the page in a new tab doesn't trigger the notification

Consecutive-revocation cases

10 sec repeat permission
  • Verified launching with command line --permission-lifetime-test-seconds=10 shows 10 sec option in permission prompt
  • Verified setting the prompt for 10 sec on https://permission.site works
  • Opening a new tab and visiting https://browserleaks.com/geo triggers the prompt and set it to 10 sec option
  • Wait for 10sec and navigate back to permission site via bottom toolbar swipe prompts again to set permission
  • Swipe back to browserleaks tab prompts on that page as well

Private tab test

Permission on private tabs
  • Verified permission prompt shows up on private tab as well
  • Verified setting persmisson forever works on private tab
  • Verified closing the private tab and opening a new one and visiting the same page triggers the permission prompt
  • Verified during an active session, setting permisson on private tab is only valid for the session
  • Verified during an active session, setting permission forever and opening the same page on normal tab still prompts for permission setting
  • Verified clearing site setting via clear data resets all permissions set on any page

Verification passed on Samsung Tab A with Android 10 running 1.24.81 x64 build

Time Based checks

20 Sec timer - Allow (Camera + Microphone)
  • Verified passing argument to set permission timer to 20 sec shows up as an option
  • Verified selecting 20 sec option and allow enables the Camera + Microphone on the site and system notification shows up
  • Verified site is added under allow list for both Camera + Microphone
  • Verified after 20 sec the site permissions are removed automatically
  • Verified reloading the page and selecting Camera on the page triggers the permission prompt again
20 Sec option Select 20 sec timer Site requesting permission Site added to allow list
20 Sec timer - Block Forever (Camera + Microphone)
  • Verified setting permission to Block Forever adds an entry under blocked list for the site
    <img width=300 src=>

Origin-based cases

Origin-based behaviour, multiple tabs (Location)
  • Verified visiting browserleaks.com/geo triggers permission prompt
  • Verified selecting Until I close this page and select allow sets the permission for the page and detects location
  • Verified visiting permission.site on a second tab and selecting location triggers prompt
  • Verified selecting Block Forever adds the site to blocked list
  • Verified site settings shows both sites under allowed/blocked respectively
  • Verified closing browserleaks.com/geo tab resets the site permission from site settings
  • Verified revisiting the page on a new tab triggers the prompt again

24-hour / 1-week cases

23 hrs test
  • Verified allowing permission on a site for 24hrs works fine
  • Verified restarting the browser and loading the page doesn't trigger permission prompt
  • Verified moving device date ahead to 23hrs and reloading the page/opening in a new tab doesn't trigger the permission prompt
25 hrs test
  • Verified allowing permission on a site for 24hrs works fine
  • Verified restarting the browser and loading the page doesn't trigger permission prompt
  • Verified moving device date ahead to 25hrs and reloading the page/opening in a new tab trigger the permission prompt
6 Days 12hrs test
  • Verified allowing permission on a site for 1 week works fine
  • Verified restarting the browser and loading the page doesn't trigger permission prompt
  • Verified moving device date ahead to 6 days & 12 hrs ahead and reloading the page/opening in a new tab doesn't trigger the permission prompt
8 days Test
  • Verified allowing permission on a site for 1 week works fine
  • Verified restarting the browser and loading the page doesn't trigger permission prompt
  • Verified moving device date ahead to 8days and reloading the page/opening in a new tab trigger the permission prompt

Allow/Block forever cases


Allow forever (Location)
  • Verified selecting location on https://permission.site triggers permission prompt
  • Verified able to set the permission to forever
  • Verified reloading the page doesn't trigger the prompt
  • Verified site settings adds the site to allow list
  • Verified moving device date ahead by a month and revisiting the page in a new tab doesn't trigger the notification
Block Forever (Notifications)
  • Verified selecting location on https://permission.site triggers permission prompt
  • Verified able to set the permission to Block Forever
  • Verified site settings adds the site to block list
  • Verified moving device date ahead by a month and revisiting the page in a new tab doesn't trigger the notification

Consecutive-revocation cases

10 sec repeat permission
  • Verified launching with command line --permission-lifetime-test-seconds=10 shows 10 sec option in permission prompt
  • Verified setting the prompt for 10 sec on https://permission.site works
  • Opening a new tab and visiting https://browserleaks.com/geo triggers the prompt and set it to 10 sec option
  • Wait for 10sec and navigate back to permission site via bottom toolbar swipe prompts again to set permission
  • Swipe back to browserleaks tab prompts on that page as well

Private tab test

Permission on private tabs
  • Verified permission prompt shows up on private tab as well
  • Verified setting persmisson forever works on private tab
  • Verified closing the private tab and opening a new one and visiting the same page triggers the permission prompt
  • Verified during an active session, setting permisson on private tab is only valid for the session
  • Verified during an active session, setting permission forever and opening the same page on normal tab still prompts for permission setting
  • Verified clearing site setting via clear data resets all permissions set on any page

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design/needs-mock-up needs-mockup A feature which needs design mockup to be implemented. OS/Android Fixes related to Android browser functionality privacy/feature User-facing privacy- & security-focused feature work. privacy/permissions privacy features related to limiting, lifetime or other permissions privacy privacy-pod Feature work for the Privacy & Web Compatibility pod QA Pass - Android ARM QA Pass - Android Tab QA/Yes release-notes/exclude
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants