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

Commit f43cea00 authored by Jinsuk Kim's avatar Jinsuk Kim Committed by Android (Google) Code Review
Browse files

Merge "Remove HdmiCecService" into lmp-preview-dev

parents ba4b4322 3f48068d
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -146,8 +146,6 @@ LOCAL_SRC_FILES += \
	core/java/android/hardware/ISerialManager.aidl \
	core/java/android/hardware/display/IDisplayManager.aidl \
	core/java/android/hardware/display/IDisplayManagerCallback.aidl \
	core/java/android/hardware/hdmi/IHdmiCecListener.aidl \
	core/java/android/hardware/hdmi/IHdmiCecService.aidl \
	core/java/android/hardware/hdmi/IHdmiControlCallback.aidl \
	core/java/android/hardware/hdmi/IHdmiControlService.aidl \
	core/java/android/hardware/hdmi/IHdmiHotplugEventListener.aidl \
+0 −20
Original line number Diff line number Diff line
@@ -6993,7 +6993,6 @@ package android.content {
    field public static final java.lang.String DISPLAY_SERVICE = "display";
    field public static final java.lang.String DOWNLOAD_SERVICE = "download";
    field public static final java.lang.String DROPBOX_SERVICE = "dropbox";
    field public static final java.lang.String HDMI_CEC_SERVICE = "hdmi_cec";
    field public static final java.lang.String HDMI_CONTROL_SERVICE = "hdmi_control";
    field public static final java.lang.String INPUT_METHOD_SERVICE = "input_method";
    field public static final java.lang.String INPUT_SERVICE = "input";
@@ -12828,21 +12827,6 @@ package android.hardware.hdmi {
    field public static final int UNKNOWN_VENDOR_ID = 16777215; // 0xffffff
  }
  public final class HdmiCecClient {
    method public boolean isTvOn();
    method public void sendActiveSource();
    method public void sendGiveDevicePowerStatus(int);
    method public void sendImageViewOn();
    method public void sendInactiveSource();
    method public void sendTextViewOn();
  }
  public static abstract class HdmiCecClient.Listener {
    ctor public HdmiCecClient.Listener();
    method public void onCableStatusChanged(boolean);
    method public void onMessageReceived(android.hardware.hdmi.HdmiCecMessage);
  }
  public final class HdmiCecDeviceInfo implements android.os.Parcelable {
    method public int describeContents();
    method public int getDeviceType();
@@ -12854,10 +12838,6 @@ package android.hardware.hdmi {
    field public static final android.os.Parcelable.Creator CREATOR;
  }
  public final class HdmiCecManager {
    method public android.hardware.hdmi.HdmiCecClient getClient(int, android.hardware.hdmi.HdmiCecClient.Listener);
  }
  public final class HdmiCecMessage implements android.os.Parcelable {
    ctor public HdmiCecMessage(int, int, int, byte[]);
    method public int describeContents();
+0 −8
Original line number Diff line number Diff line
@@ -57,9 +57,7 @@ import android.hardware.ConsumerIrManager;
import android.hardware.ISerialManager;
import android.hardware.SerialManager;
import android.hardware.SystemSensorManager;
import android.hardware.hdmi.HdmiCecManager;
import android.hardware.hdmi.HdmiControlManager;
import android.hardware.hdmi.IHdmiCecService;
import android.hardware.hdmi.IHdmiControlService;
import android.hardware.camera2.CameraManager;
import android.hardware.display.DisplayManager;
@@ -384,12 +382,6 @@ class ContextImpl extends Context {
                    return new BluetoothManager(ctx);
                }});

        registerService(HDMI_CEC_SERVICE, new StaticServiceFetcher() {
                public Object createStaticService() {
                    IBinder b = ServiceManager.getService(HDMI_CEC_SERVICE);
                    return new HdmiCecManager(IHdmiCecService.Stub.asInterface(b));
                }});

        registerService(HDMI_CONTROL_SERVICE, new StaticServiceFetcher() {
                public Object createStaticService() {
                    IBinder b = ServiceManager.getService(HDMI_CONTROL_SERVICE);
+0 −13
Original line number Diff line number Diff line
@@ -2148,8 +2148,6 @@ public abstract class Context {
     * @see android.app.SearchManager
     * @see #SENSOR_SERVICE
     * @see android.hardware.SensorManager
     * @see #HDMI_CEC_SERVICE
     * @see android.hardware.hdmi.HdmiCecManager
     * @see #STORAGE_SERVICE
     * @see android.os.storage.StorageManager
     * @see #VIBRATOR_SERVICE
@@ -2636,17 +2634,6 @@ public abstract class Context {
     */
    public static final String SERIAL_SERVICE = "serial";

    /**
     * Use with {@link #getSystemService} to retrieve a
     * {@link android.hardware.hdmi.HdmiCecManager} for controlling and managing
     * HDMI-CEC protocol.
     *
     * @see #getSystemService
     * @see android.hardware.hdmi.HdmiCecManager
     */
    // TODO: Remove this once HdmiControlService is ready.
    public static final String HDMI_CEC_SERVICE = "hdmi_cec";

    /**
     * Use with {@link #getSystemService} to retrieve a
     * {@link android.hardware.hdmi.HdmiControlManager} for controlling and managing
+0 −119
Original line number Diff line number Diff line
/*
 * Copyright (C) 2014 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package android.hardware.hdmi;

import android.os.IBinder;
import android.os.RemoteException;

import android.util.Log;

/**
 * HdmiCecClient is used to control HDMI-CEC logical device instance in the system.
 * It is connected to actual hardware part via HdmiCecService. It provides with methods
 * to send CEC messages to other device on the bus, and listener that allows to receive
 * incoming messages to the device.
 */
public final class HdmiCecClient {
    private static final String TAG = "HdmiCecClient";

    private final IHdmiCecService mService;
    private final IBinder mBinder;

    /**
     * Listener used by the client to get the incoming messages.
     */
    public static abstract class Listener {
        /**
         * Called when CEC message arrives. Override this method to receive the incoming
         * CEC messages from other device on the bus.
         *
         * @param message {@link HdmiCecMessage} object
         */
        public void onMessageReceived(HdmiCecMessage message) { }

        /**
         * Called when hotplug event occurs. Override this method to receive the events.
         *
         * @param connected true if the cable is connected; otherwise false.
         */
        public void onCableStatusChanged(boolean connected) { }
    }

    // Private constructor.
    private HdmiCecClient(IHdmiCecService service, IBinder b) {
        mService = service;
        mBinder = b;
    }

    // Factory method for HdmiCecClient.
    // Declared package-private. Accessed by HdmiCecManager only.
    static HdmiCecClient create(IHdmiCecService service, IBinder b) {
        return new HdmiCecClient(service, b);
    }

    /**
     * Send <Active Source> message.
     */
    public void sendActiveSource() {
        Log.w(TAG, "In transition to HdmiControlManager. Will not work.");
    }

    /**
     * Send <Inactive Source> message.
     */
    public void sendInactiveSource() {
        Log.w(TAG, "In transition to HdmiControlManager. Will not work.");
    }

    /**
     * Send <Text View On> message.
     */
    public void sendTextViewOn() {
        Log.w(TAG, "In transition to HdmiControlManager. Will not work.");
    }

    /**
     * Send <Image View On> message.
     */
    public void sendImageViewOn() {
        Log.w(TAG, "In transition to HdmiControlManager. Will not work.");
    }

    /**
     * Send <Give Device Power Status> message.
     *
     * @param address logical address of the device to send the message to, such as
     *        {@link HdmiCec#ADDR_TV}.
     */
    public void sendGiveDevicePowerStatus(int address) {
        Log.w(TAG, "In transition to HdmiControlManager. Will not work.");
    }

    /**
     * Returns true if the TV or attached display is powered on.
     * <p>
     * The result of this method is only meaningful on playback devices (where the device
     * type is {@link HdmiCec#DEVICE_PLAYBACK}).
     * </p>
     *
     * @return true if TV is on; otherwise false.
     */
    public boolean isTvOn() {
        Log.w(TAG, "In transition to HdmiControlManager. Will not work.");
        return true;
    }
}
Loading