1 /*
2  * Copyright 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.layoutlib.bridge.android;
18 
19 import android.os.CoolingDevice;
20 import android.os.IBinder;
21 import android.os.IThermalEventListener;
22 import android.os.IThermalStatusListener;
23 import android.os.IThermalService;
24 import android.os.Temperature;
25 
26 import java.util.ArrayList;
27 import java.util.List;
28 
29 /**
30  * Fake implementation of IThermalService
31  */
32 public class BridgeThermalService implements IThermalService {
33 
34     @Override
asBinder()35     public IBinder asBinder() {
36         return null;
37     }
38 
39     @Override
registerThermalEventListener(IThermalEventListener listener)40     public boolean registerThermalEventListener(IThermalEventListener listener) {
41         return false;
42     }
43 
44     @Override
registerThermalEventListenerWithType(IThermalEventListener listener, int type)45     public boolean registerThermalEventListenerWithType(IThermalEventListener listener, int type) {
46         return false;
47     }
48 
49     @Override
unregisterThermalEventListener(IThermalEventListener listener)50     public boolean unregisterThermalEventListener(IThermalEventListener listener) {
51         return false;
52     }
53 
54     @Override
getCurrentTemperatures()55     public Temperature[] getCurrentTemperatures() {
56         return new Temperature[0];
57     }
58 
59     @Override
getCurrentTemperaturesWithType(int type)60     public Temperature[] getCurrentTemperaturesWithType(int type) {
61         return new Temperature[0];
62     }
63 
64     @Override
registerThermalStatusListener(IThermalStatusListener listener)65     public boolean registerThermalStatusListener(IThermalStatusListener listener) {
66         return false;
67     }
68 
69     @Override
unregisterThermalStatusListener(IThermalStatusListener listener)70     public boolean unregisterThermalStatusListener(IThermalStatusListener listener) {
71         return false;
72     }
73 
74     @Override
getCurrentThermalStatus()75     public int getCurrentThermalStatus() {
76         return 0;
77     }
78 
79     @Override
getCurrentCoolingDevices()80     public CoolingDevice[] getCurrentCoolingDevices() {
81         return new CoolingDevice[0];
82     }
83 
84     @Override
getCurrentCoolingDevicesWithType(int type)85     public CoolingDevice[] getCurrentCoolingDevicesWithType(int type) {
86         return new CoolingDevice[0];
87     }
88 
89     @Override
getThermalHeadroom(int forecastSeconds)90     public float getThermalHeadroom(int forecastSeconds) {
91         return Float.NaN;
92     }
93 }
94