Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
halo
packages_providers_MediaProvider
Commits
52ef3271
Commit
52ef3271
authored
10 years ago
by
Jean-Michel Trivi
Committed by
Android (Google) Code Review
10 years ago
Browse files
Options
Download
Plain Diff
Merge "Add support for AudioAttributes flags in RingtonePickerActivity" into mnc-dev
parents
fe6f4c2a
8f8174a5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
0 deletions
+13
-0
src/com/android/providers/media/RingtonePickerActivity.java
src/com/android/providers/media/RingtonePickerActivity.java
+13
-0
No files found.
src/com/android/providers/media/RingtonePickerActivity.java
View file @
52ef3271
...
...
@@ -19,6 +19,7 @@ package com.android.providers.media;
import
android.content.DialogInterface
;
import
android.content.Intent
;
import
android.database.Cursor
;
import
android.media.AudioAttributes
;
import
android.media.Ringtone
;
import
android.media.RingtoneManager
;
import
android.net.Uri
;
...
...
@@ -99,6 +100,8 @@ public final class RingtonePickerActivity extends AlertActivity implements
*/
private
Ringtone
mCurrentRingtone
;
private
int
mAttributesFlags
;
/**
* Keep the currently playing ringtone around when changing orientation, so that it
* can be stopped later, after the activity is recreated.
...
...
@@ -144,6 +147,10 @@ public final class RingtonePickerActivity extends AlertActivity implements
}
// Get whether to show the 'Silent' item
mHasSilentItem
=
intent
.
getBooleanExtra
(
RingtoneManager
.
EXTRA_RINGTONE_SHOW_SILENT
,
true
);
// AudioAttributes flags
mAttributesFlags
|=
intent
.
getIntExtra
(
RingtoneManager
.
EXTRA_RINGTONE_AUDIO_ATTRIBUTES_FLAGS
,
0
/*defaultValue == no flags*/
);
// Give the Activity so it can do managed queries
mRingtoneManager
=
new
RingtoneManager
(
this
);
...
...
@@ -326,6 +333,12 @@ public final class RingtonePickerActivity extends AlertActivity implements
}
if
(
ringtone
!=
null
)
{
if
(
mAttributesFlags
!=
0
)
{
ringtone
.
setAudioAttributes
(
new
AudioAttributes
.
Builder
(
ringtone
.
getAudioAttributes
())
.
setFlags
(
mAttributesFlags
)
.
build
());
}
ringtone
.
play
();
}
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment