Notes on the sound separation into LP, MM, N
This is not manna in its pure form, it is guidance (tips) for a more complete understanding;)
We all know that the volume of the ringtone is rigidly connected to the system with the volume of notifications and system sounds, below we will focus on how to divide them and add management settings, the result can be obtained similar to the following (before changes were standard - three progressbar Multimedia Alarm Ringtone )
1. To begin, return to this mana:
The Sony Xperia Fashion Club Club (Post ivan-68 # 54553264)and write out the available types of our volume a little differently
0x0 Voice Conversation # STREAM_VOICE_CALL #
0x1 System sounds # STREAM_SYSTEM #
0x2 Ringtone # STREAM_RING #
0x3 Multimedia (music, video, etc.) # STREAM_MUSIC #
0x4 Alarm clock # STREAM_ALARM #
0x5 Notifications # STREAM_NOTIFICATION #
0x6 Voice when speaking via bluetooth # STREAM_BLUETOOTH_SCO #
0x7 ----- # STREAM_SYSTEM_ENFORCED #
0x8 ----- # STREAM_DTMF #
0x9 ----- # STREAM_TTS # These values
0x0, 0x1, 0x2 etc. and it is for the system markers corresponding volume of species, using this knowledge to manipulate them easily in the future
2. For example, the volume share ringtones, notifications, and system sounds
We are looking for a file
AudioService.smali (For LP framework \ smali \ android \ media \ AudioService.smali, for MM and N services \ smali \ com \ android \ server \ audio \ AudioService.smali)
search it on
: array_0 We find three arrays
: array_0
.array-data 4
0x0
0x2
0x2
0x3
0x4
0x2
0x6
0x2
0x2
0x3
0x0
.end array-data
.line 336
: array_1
.array-data 4
0x3
0x3
0x3
0x3
0x3
0x3
0x3
0x3
0x3
0x3
0x3
.end array-data
.line 349
: array_2
.array-data 4
0x0
0x2
0x2
0x3
0x4
0x2
0x6
0x2
0x2
0x3
0x0
.end array-data
and the first and third (: array_0 and: array_2) change the ringtone (0x2) in the system (0x1) and notifications (0h5), so will
: array_0
.array-data 4
0x0
0x1
0x2
0x3
0x4
0x5
0x6
0x2
0x2
0x3
.end array-data
: array_1
.array-data 4
0x3
0x3
0x3
0x3
0x3
0x3
0x3
0x3
0x3
0x3
.end array-data
: array_2
.array-data 4
0x0
0x1
0x2
0x3
0x4
0x5
0x6
0x2
0x2
0x3
.end array-data
3. Now, in addition to the final separation ringtone and updates go to
framework \ smali \ android \ preference \
SeekBarVolumizer.smali .method private static isNotificationOrRing (I) Z and there I
on
then I will explain why 0h8 - if you register here such as 0x3, the ringtone will contact Multimedia, 0h8 I have not used (STREAM_DTMF)
4. In some cases it is necessary to change the Bulls
SettingsProvider \ res \ values ​​\ bools.xml <bool name = "def_notifications_use_ring_volume">true</ bool>
on
<bool name = "def_notifications_use_ring_volume">false</ bool>
I is not running on the bare Androide (ie just do not care or labor there Fals), but on separate bodies and Sony including may affect
All we shared volume, you can now add them individually in the Settings. Here literate and modders will understand, a little tip - for the progress bar in the setting data, a special
VolumeSeekBarPreference.smali and method
initVolumePreference (Ljava / lang / String; II) Lcom / android / settings / notification / VolumeSeekBarPreference; , That's like adding code system sounds (the path and IDs might differ, I have a clean Android, Sony on a placement other)
<com.android.settings.notification.VolumeSeekBarPreference android: icon = "@ android: drawable / ic_audio_vol" android: title = "@ string / system_volume_option_title" android: key = "system_volume" />
const-string v2, "system_volume"
const / 4 v3, 0x1
const v4, 0x1080300
invoke-direct {p0, v2, v3, v4}, Lcom / android / settings / notification / NotificationSettings; ->initVolumePreference (Ljava / lang / String; II) Lcom / android / settings / notification / VolumeSeekBarPreference;
"System_volume" - Key of CML may be any of your choice
0x1 - Our marker system sounds
0x1080300 - ID pictures ic_audio_vol
Added in Post has been editedivan-68 - 29.01.17, 13:14