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

Commit 0758f9ac authored by tim peng's avatar tim peng Committed by Android (Google) Code Review
Browse files

Merge "Add volume controll interface in settinglib"

parents a6f6b403 59a21577
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -73,6 +73,21 @@ public class InfoMediaDevice extends MediaDevice {
        return true;
    }

    @Override
    public void requestSetVolume(int volume) {
        mRouterManager.requestSetVolume(mRouteInfo, volume);
    }

    @Override
    public int getMaxVolume() {
        return mRouteInfo.getVolumeMax();
    }

    @Override
    public int getCurrentVolume() {
        return mRouteInfo.getVolume();
    }

    @Override
    public void disconnect() {
        //TODO(b/144535188): disconnected last select device
+53 −0
Original line number Diff line number Diff line
@@ -108,6 +108,59 @@ public abstract class MediaDevice implements Comparable<MediaDevice> {
     */
    public abstract boolean isConnected();

    /**
     * Request to set volume.
     *
     * @param volume is the new value.
     */
    public void requestSetVolume(int volume) {
    }

    /**
     * Get max volume from MediaDevice.
     *
     * @return max volume.
     */
    public int getMaxVolume() {
        return 100;
    }

    /**
     * Get current volume from MediaDevice.
     *
     * @return current volume.
     */
    public int getCurrentVolume() {
        return 0;
    }

    /**
     * Get application package name.
     *
     * @return package name.
     */
    public String getClientPackageName() {
        return null;
    }

    /**
     * Get application label from MediaDevice.
     *
     * @return application label.
     */
    public String getClientAppLabel() {
        return null;
    }

    /**
     * Get application label from MediaDevice.
     *
     * @return application label.
     */
    public int getDeviceType() {
        return mType;
    }

    /**
     * Rules:
     * 1. If there is one of the connected devices identified as a carkit, this carkit will