Commit Graph

16 Commits

Author SHA1 Message Date
Valentin Iftime
323fbda20e Validate ringtone URIs before setting
Add checks URIs for content from other users.
 Fail for users that are not profiles of the current user.

Test: atest DefaultRingtonePreferenceTest
Bug: 299614635
Change-Id: Ib266b285a3a1c6c5265ae2321159e61e08e349f6
2023-10-06 15:44:17 +02:00
Tsung-Mao Fang
40fbcf333f Fix can't change notification sound for work profile.
Use correct user id context to query the type,
so we won't get empty result unexpectedly.

If we get the null result, then we won't set sound sucessfully.

Fix: 233580016
Test: Manual test and set work profile sound works.
Change-Id: I7f8fb737a7c6f77a380f3f075a5c89a1970e39ad
2022-05-27 21:13:33 +08:00
Arc Wang
ec3ae8bb17 Fix Settings crash when setting a null ringtone
Ringtone picker may callback a null ringtone Uri
if users select None.

This change pass null ringtone Uri to RingtoneManager
and return.

Bug: 232502532
Bug: 221041256
Test: maunal
      Settings - Sound & Vibration -> Phone ringtone
      -> My Sounds -> None
Change-Id: I044b680871472a3c272f6264c4ef272df542112e
2022-05-16 14:36:19 +08:00
Arc Wang
e4c22580c9 Verify ringtone from ringtone picker is audio
To improve privacy.

Bug: 221041256
Test: atest com.android.settings.DefaultRingtonePreferenceTest
Change-Id: I0a9ca163f5ae91b67c9f957fde4c6db326b8718d
2022-05-06 17:42:30 +08:00
Tony Mak
007dc1abe6 Show RingtonePickerActivity in work user instead
Test: make RunSettingsRoboTests
Test: Try to import custom ringtone in work profile, no crash observed
Test: Set the custom ringtone as default. Tested both work gmail and
      calendar can play that ringtone.
Test: Try to import the peresonal ringtone, it is still working.

Bug: 37197930
Change-Id: I2b662247d7e70b59bae08e082e9682d74d797484
2017-04-12 15:12:44 +01:00
Robin Lee
cccf3244b6 Prompt credentials for installing/deleting sounds
Actually we probably want to confirm credentials in all locked cases
not just when starting the user -- fewer corners to special case.

Fix: 34734809
Test: manual. set a work profile lock, screen off/on, open sound settings, try to set a work ringtone. first attempt should prompt for credentials, second attempt should not until next screen-off.
Change-Id: I1fea94f3b0d1b768b22741b887d9891f5e318549
2017-02-10 15:34:53 +00:00
Robin Lee
2953f31b61 Prompt to start user before choosing a new ringtone
Dead users can't hear, nor see, ringtones. Let's wake them up and give
them a good shake first.

Until then, show a nice friendly "work profile isn't available" message.
Or depending on locale something confusing, egregious, and mismatched
like "work profile isn't available" instead.

Fix: 34735015
Bug: 34734809
Test: make RunSettingsRoboTests && make Settings && adb install -r $OUT/system/priv-app/Settings/Settings.apk && then reboot the device to see what happens
Change-Id: I86e61a7f3f654d7f38f04c43227a31e2f288e18f
2017-01-26 18:20:45 +00:00
Julia Reynolds
b5ec2d71a2 Add notification channel settings.
If a user has set a preference at an app wide level, it cannot be
undone at a channel level, but channels can be more restrictive.

Tests: changing settings for apps and channels.

Change-Id: I7907b8179ffc24d68197c917f182e63d8e1ff7a7
2016-09-15 21:46:17 -04:00
Andre Lago
3e398c87f2 [Settings] Set different ringtones at work profile
Updated the Settings app to allow setting different default system
ringtones for work profile apps

Bug: 30658854
Change-Id: I7461be070bd4e8d86bf1fd724039e53d500094ad
2016-08-15 11:11:56 +01:00
Jason Monk
39b467482d Depend on support lib preferences
Bug: 24576551
Change-Id: Ic6190bacd3f7582c9bbc8de972da4612bd92421e
2015-10-13 10:12:20 -04:00
John Spurlock
9a23adf69d Settings: Remove all unused imports.
Change-Id: Iebfa52cb849d69974c94902b0b020893cf5618a3
2015-03-18 15:51:15 -04:00
Joe Onorato
cedfdd9d17 Remove the deprecated things from Config.java. These havent been working since before 1.0.
Change-Id: I88ea860fd6edf7c128cf1a201329f09428ab382c
2011-04-07 18:41:13 -07:00
Marco Nelissen
0399617744 Allow setting a silent ringtone (bug 1600056). 2009-09-10 12:11:33 -07:00
The Android Open Source Project
afc4ab2ffb auto import from //depot/cupcake/@135843 2009-03-03 19:32:34 -08:00
The Android Open Source Project
4e14e5ccbf auto import from //depot/cupcake/@135843 2009-03-03 18:28:52 -08:00
The Android Open Source Project
de2d9f5f10 Initial Contribution 2008-10-21 07:00:00 -07:00