OneTouchRecordAction.java revision a6b2a7a59ab79b2d91412c1095d1c49b8dc9d507
1/* 2 * Copyright (C) 2014 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17package com.android.server.hdmi; 18 19import static com.android.server.hdmi.Constants.RECORDING_TYPE_ANALOGUE_RF; 20import static com.android.server.hdmi.Constants.RECORDING_TYPE_DIGITAL_RF; 21import static com.android.server.hdmi.Constants.RECORDING_TYPE_EXTERNAL_PHYSICAL_ADDRESS; 22import static com.android.server.hdmi.Constants.RECORDING_TYPE_OWN_SOURCE; 23 24/** 25 * Feature action that performs one touch record. This class only provides a skeleton of one touch 26 * play and has no detail implementation. 27 */ 28public class OneTouchRecordAction extends FeatureAction { 29 private final int mRecorderAddress; 30 private final int mRecordingType; 31 32 OneTouchRecordAction(HdmiCecLocalDevice source, int recorderAddress, int recordingType) { 33 super(source); 34 mRecorderAddress = recorderAddress; 35 mRecordingType = recordingType; 36 } 37 38 @Override 39 boolean start() { 40 return false; 41 } 42 43 private void sendRecordOn(int recordingType) { 44 switch (recordingType) { 45 case RECORDING_TYPE_DIGITAL_RF: 46 break; 47 case RECORDING_TYPE_ANALOGUE_RF: 48 break; 49 case RECORDING_TYPE_EXTERNAL_PHYSICAL_ADDRESS: 50 break; 51 case RECORDING_TYPE_OWN_SOURCE: 52 break; 53 // TODO: implement this. 54 } 55 } 56 57 @Override 58 boolean processCommand(HdmiCecMessage cmd) { 59 return false; 60 } 61 62 @Override 63 void handleTimerEvent(int state) { 64 } 65 66 int getRecorderAddress() { 67 return mRecorderAddress; 68 } 69} 70