Improve internal API of MediaSession

Change-Id: Iae4aa84673677ce088a8d9a53fb75f2923c3cafa