Home | History | Annotate | Download | only in stub
      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.dialer.lightbringer.stub;
     18 
     19 import android.content.ComponentName;
     20 import android.content.Context;
     21 import android.content.Intent;
     22 import android.support.annotation.MainThread;
     23 import android.support.annotation.NonNull;
     24 import android.support.annotation.Nullable;
     25 import android.telecom.Call;
     26 import android.telecom.PhoneAccountHandle;
     27 import com.android.dialer.common.Assert;
     28 import com.android.dialer.lightbringer.Lightbringer;
     29 import com.android.dialer.lightbringer.LightbringerListener;
     30 import javax.inject.Inject;
     31 
     32 public class LightbringerStub implements Lightbringer {
     33 
     34   @Inject
     35   public LightbringerStub() {}
     36 
     37   @Override
     38   public boolean isEnabled() {
     39     return false;
     40   }
     41 
     42   @MainThread
     43   @Override
     44   public boolean isReachable(@NonNull Context context, @Nullable String number) {
     45     Assert.isMainThread();
     46     Assert.isNotNull(context);
     47     return false;
     48   }
     49 
     50   @MainThread
     51   @Override
     52   public boolean supportsUpgrade(@NonNull Context context, @Nullable String number) {
     53     Assert.isMainThread();
     54     Assert.isNotNull(context);
     55     return false;
     56   }
     57 
     58   @MainThread
     59   @Override
     60   public Intent getIntent(@NonNull Context context, @NonNull String number) {
     61     Assert.isMainThread();
     62     Assert.isNotNull(context);
     63     Assert.isNotNull(number);
     64     return null;
     65   }
     66 
     67   @MainThread
     68   @Override
     69   public void requestUpgrade(Call call) {
     70     Assert.isMainThread();
     71     Assert.isNotNull(call);
     72   }
     73 
     74   @MainThread
     75   @Override
     76   public void registerListener(LightbringerListener listener) {
     77     Assert.isMainThread();
     78     Assert.isNotNull(listener);
     79   }
     80 
     81   @MainThread
     82   @Override
     83   public void unregisterListener(LightbringerListener listener) {
     84     Assert.isMainThread();
     85     Assert.isNotNull(listener);
     86   }
     87 
     88   @Nullable
     89   @Override
     90   public ComponentName getPhoneAccountComponentName() {
     91     return null;
     92   }
     93 
     94   @Nullable
     95   @Override
     96   public PhoneAccountHandle getPhoneAccountHandle() {
     97     return null;
     98   }
     99 
    100   @Nullable
    101   @Override
    102   public String getPackageName() {
    103     return null;
    104   }
    105 }
    106