Home | History | Annotate | Download | only in empty
      1 /*
      2  * Copyright (C) 2017 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 
     17 package com.android.incallui.videotech.empty;
     18 
     19 import android.content.Context;
     20 import android.support.annotation.NonNull;
     21 import android.support.annotation.Nullable;
     22 import android.telecom.PhoneAccountHandle;
     23 import com.android.dialer.common.Assert;
     24 import com.android.incallui.video.protocol.VideoCallScreen;
     25 import com.android.incallui.video.protocol.VideoCallScreenDelegate;
     26 import com.android.incallui.videotech.VideoTech;
     27 import com.android.incallui.videotech.utils.SessionModificationState;
     28 
     29 /** Default video tech that is always available but doesn't do anything. */
     30 public class EmptyVideoTech implements VideoTech {
     31 
     32   @Override
     33   public boolean isAvailable(Context context, PhoneAccountHandle phoneAccountHandle) {
     34     return false;
     35   }
     36 
     37   @Override
     38   public boolean isTransmittingOrReceiving() {
     39     return false;
     40   }
     41 
     42   @Override
     43   public boolean isSelfManagedCamera() {
     44     return false;
     45   }
     46 
     47   @Override
     48   public boolean shouldUseSurfaceView() {
     49     return false;
     50   }
     51 
     52   @Override
     53   public boolean isPaused() {
     54     return false;
     55   }
     56 
     57   @Override
     58   public VideoCallScreenDelegate createVideoCallScreenDelegate(
     59       Context context, VideoCallScreen videoCallScreen) {
     60     throw Assert.createUnsupportedOperationFailException();
     61   }
     62 
     63   @Override
     64   public void onCallStateChanged(
     65       Context context, int newState, PhoneAccountHandle phoneAccountHandle) {}
     66 
     67   @Override
     68   public void onRemovedFromCallList() {}
     69 
     70   @Override
     71   public int getSessionModificationState() {
     72     return SessionModificationState.NO_REQUEST;
     73   }
     74 
     75   @Override
     76   public void upgradeToVideo(@NonNull Context context) {}
     77 
     78   @Override
     79   public void acceptVideoRequest(@NonNull Context context) {}
     80 
     81   @Override
     82   public void acceptVideoRequestAsAudio() {}
     83 
     84   @Override
     85   public void declineVideoRequest() {}
     86 
     87   @Override
     88   public boolean isTransmitting() {
     89     return false;
     90   }
     91 
     92   @Override
     93   public void stopTransmission() {}
     94 
     95   @Override
     96   public void resumeTransmission(@NonNull Context context) {}
     97 
     98   @Override
     99   public void pause() {}
    100 
    101   @Override
    102   public void unpause() {}
    103 
    104   @Override
    105   public void setCamera(@Nullable String cameraId) {}
    106 
    107   @Override
    108   public void setDeviceOrientation(int rotation) {}
    109 
    110   @Override
    111   public void becomePrimary() {}
    112 
    113   @Override
    114   public com.android.dialer.logging.VideoTech.Type getVideoTechType() {
    115     return com.android.dialer.logging.VideoTech.Type.NONE;
    116   }
    117 }
    118