Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f100968c authored by Jin Seok Park's avatar Jin Seok Park
Browse files

Improve documentation

Test: N/A
Change-Id: Id7a81e86535c4da261babd625bf30ade309e9f19
parent 04eebb6f
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -32,7 +32,7 @@ import com.android.internal.annotations.GuardedBy;
import java.io.PrintWriter;

/**
 * Keeps the record of {@link Session2Token} helps to send command to the corresponding session.
 * Keeps the record of {@link Session2Token} to help send command to the corresponding session.
 */
// TODO(jaewan): Do not call service method directly -- introduce listener instead.
public class MediaSession2Record implements MediaSessionRecordImpl {
@@ -87,7 +87,7 @@ public class MediaSession2Record implements MediaSessionRecordImpl {

    @Override
    public boolean isSystemPriority() {
        // System priority session is currently only allowed for telephony, and it's OK to stick to
        // System priority session is currently only allowed for telephony, so it's OK to stick to
        // the media1 API at this moment.
        return false;
    }
@@ -122,7 +122,7 @@ public class MediaSession2Record implements MediaSessionRecordImpl {
    public void close() {
        synchronized (mLock) {
            mIsClosed = true;
            // Call close regardless of the mIsAvailable. This may be called when it's not yet
            // Call close regardless of the mIsConnected. This may be called when it's not yet
            // connected.
            mController.close();
        }
+2 −1
Original line number Diff line number Diff line
@@ -271,7 +271,8 @@ public class MediaSessionRecord implements IBinder.DeathRecipient, MediaSessionR
     *          activity. {@code false} otherwise to tell session about the real caller.
     * @param direction The direction to adjust volume in.
     * @param flags Any of the flags from {@link AudioManager}.
     * @param useSuggested True to use adjustSuggestedStreamVolume instead of
     * @param useSuggested True to use adjustSuggestedStreamVolumeForUid instead of
     *          adjustStreamVolumeForUid
     */
    public void adjustVolume(String packageName, String opPackageName, int pid, int uid,
            boolean asSystemService, int direction, int flags, boolean useSuggested) {
+12 −11
Original line number Diff line number Diff line
@@ -51,8 +51,8 @@ public interface MediaSessionRecordImpl extends AutoCloseable {
    int getUserId();

    /**
     * Check if this session has system priorty and should receive media buttons
     * before any other sessions.
     * Check if this session has system priority and should receive media buttons before any other
     * sessions.
     *
     * @return True if this is a system priority session, false otherwise
     */
@@ -74,7 +74,8 @@ public interface MediaSessionRecordImpl extends AutoCloseable {
     *          activity. {@code false} otherwise to tell session about the real caller.
     * @param direction The direction to adjust volume in.
     * @param flags Any of the flags from {@link AudioManager}.
     * @param useSuggested True to use adjustSuggestedStreamVolume instead of
     * @param useSuggested True to use adjustSuggestedStreamVolumeForUid instead of
     *          adjustStreamVolumeForUid
     */
    void adjustVolume(String packageName, String opPackageName, int pid, int uid,
            boolean asSystemService, int direction, int flags, boolean useSuggested);
@@ -89,12 +90,12 @@ public interface MediaSessionRecordImpl extends AutoCloseable {
    boolean isActive();

    /**
     * Check if the session's playback active state matches with the expectation. This always return
     * {@code false} if the playback state is unknown (e.g. {@code null}), where we cannot know the
     * actual playback state associated with the session.
     * Check if the session's playback active state matches with the expectation. This always
     * returns {@code false} if the playback state is unknown (e.g. {@code null}), where we cannot
     * know the actual playback state associated with the session.
     *
     * @param expected True if playback is expected to be active. false otherwise.
     * @return True if the session's playback matches with the expectation. false otherwise.
     * @param expected True if playback is expected to be active. False otherwise.
     * @return True if the session's playback matches with the expectation. False otherwise.
     */
    boolean checkPlaybackActiveState(boolean expected);

@@ -103,8 +104,8 @@ public interface MediaSessionRecordImpl extends AutoCloseable {
     * <p>
     * <ul>
     *   <li>Local: volume changes the stream volume because playback happens on this device.</li>
     *   <li>Remote: volume is sent to the apps callback because playback happens on the remote
     *     device and we cannot know how to control the volume of it.</li>
     *   <li>Remote: volume is sent to the app's callback because playback happens on a remote
     *     device and we cannot know how to control its volume.</li>
     * </ul>
     *
     * @return {@code true} if the playback is local. {@code false} if the playback is remote.
@@ -150,7 +151,7 @@ public interface MediaSessionRecordImpl extends AutoCloseable {
    void dump(PrintWriter pw, String prefix);

    /**
     * Override {@link AutoCloseable#close} to tell not to throw exception.
     * Override {@link AutoCloseable#close} to tell it not to throw exception.
     */
    @Override
    void close();