1875e5c74516dec3ccd32e2239beb1a28a5d931bbTodd Poynor/*
2875e5c74516dec3ccd32e2239beb1a28a5d931bbTodd Poynor** Copyright 2017, The Android Open Source Project
3875e5c74516dec3ccd32e2239beb1a28a5d931bbTodd Poynor**
4875e5c74516dec3ccd32e2239beb1a28a5d931bbTodd Poynor** Licensed under the Apache License, Version 2.0 (the "License");
5875e5c74516dec3ccd32e2239beb1a28a5d931bbTodd Poynor** you may not use this file except in compliance with the License.
6875e5c74516dec3ccd32e2239beb1a28a5d931bbTodd Poynor** You may obtain a copy of the License at
7875e5c74516dec3ccd32e2239beb1a28a5d931bbTodd Poynor**
8875e5c74516dec3ccd32e2239beb1a28a5d931bbTodd Poynor**     http://www.apache.org/licenses/LICENSE-2.0
9875e5c74516dec3ccd32e2239beb1a28a5d931bbTodd Poynor**
10875e5c74516dec3ccd32e2239beb1a28a5d931bbTodd Poynor** Unless required by applicable law or agreed to in writing, software
11875e5c74516dec3ccd32e2239beb1a28a5d931bbTodd Poynor** distributed under the License is distributed on an "AS IS" BASIS,
12875e5c74516dec3ccd32e2239beb1a28a5d931bbTodd Poynor** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13875e5c74516dec3ccd32e2239beb1a28a5d931bbTodd Poynor** See the License for the specific language governing permissions and
14875e5c74516dec3ccd32e2239beb1a28a5d931bbTodd Poynor** limitations under the License.
15875e5c74516dec3ccd32e2239beb1a28a5d931bbTodd Poynor*/
16875e5c74516dec3ccd32e2239beb1a28a5d931bbTodd Poynor
17875e5c74516dec3ccd32e2239beb1a28a5d931bbTodd Poynorpackage android.os;
18875e5c74516dec3ccd32e2239beb1a28a5d931bbTodd Poynor
19875e5c74516dec3ccd32e2239beb1a28a5d931bbTodd Poynorimport android.os.IThermalEventListener;
20875e5c74516dec3ccd32e2239beb1a28a5d931bbTodd Poynorimport android.os.Temperature;
21875e5c74516dec3ccd32e2239beb1a28a5d931bbTodd Poynor
22875e5c74516dec3ccd32e2239beb1a28a5d931bbTodd Poynor/**
23875e5c74516dec3ccd32e2239beb1a28a5d931bbTodd Poynor * {@hide}
24875e5c74516dec3ccd32e2239beb1a28a5d931bbTodd Poynor */
25875e5c74516dec3ccd32e2239beb1a28a5d931bbTodd Poynorinterface IThermalService {
26875e5c74516dec3ccd32e2239beb1a28a5d931bbTodd Poynor    /**
27875e5c74516dec3ccd32e2239beb1a28a5d931bbTodd Poynor      * Register a listener for thermal events.
28875e5c74516dec3ccd32e2239beb1a28a5d931bbTodd Poynor      * @param listener the IThermalEventListener to be notified.
29875e5c74516dec3ccd32e2239beb1a28a5d931bbTodd Poynor      * {@hide}
30875e5c74516dec3ccd32e2239beb1a28a5d931bbTodd Poynor      */
31875e5c74516dec3ccd32e2239beb1a28a5d931bbTodd Poynor    void registerThermalEventListener(in IThermalEventListener listener);
32875e5c74516dec3ccd32e2239beb1a28a5d931bbTodd Poynor    /**
33875e5c74516dec3ccd32e2239beb1a28a5d931bbTodd Poynor      * Unregister a previously-registered listener for thermal events.
34875e5c74516dec3ccd32e2239beb1a28a5d931bbTodd Poynor      * @param listener the IThermalEventListener to no longer be notified.
35875e5c74516dec3ccd32e2239beb1a28a5d931bbTodd Poynor      * {@hide}
36875e5c74516dec3ccd32e2239beb1a28a5d931bbTodd Poynor      */
37875e5c74516dec3ccd32e2239beb1a28a5d931bbTodd Poynor    void unregisterThermalEventListener(in IThermalEventListener listener);
38875e5c74516dec3ccd32e2239beb1a28a5d931bbTodd Poynor    /**
39875e5c74516dec3ccd32e2239beb1a28a5d931bbTodd Poynor      * Send a thermal throttling start/stop notification to all listeners.
40875e5c74516dec3ccd32e2239beb1a28a5d931bbTodd Poynor      * @param temperature the temperature at which the event was generated.
41875e5c74516dec3ccd32e2239beb1a28a5d931bbTodd Poynor      * {@hide}
42875e5c74516dec3ccd32e2239beb1a28a5d931bbTodd Poynor      */
43875e5c74516dec3ccd32e2239beb1a28a5d931bbTodd Poynor    oneway void notifyThrottling(
44875e5c74516dec3ccd32e2239beb1a28a5d931bbTodd Poynor        in boolean isThrottling, in Temperature temperature);
45875e5c74516dec3ccd32e2239beb1a28a5d931bbTodd Poynor    /**
46875e5c74516dec3ccd32e2239beb1a28a5d931bbTodd Poynor      * Return whether system performance is currently thermal throttling.
47875e5c74516dec3ccd32e2239beb1a28a5d931bbTodd Poynor      * @return true if thermal throttling is currently in effect
48875e5c74516dec3ccd32e2239beb1a28a5d931bbTodd Poynor      * {@hide}
49875e5c74516dec3ccd32e2239beb1a28a5d931bbTodd Poynor      */
50875e5c74516dec3ccd32e2239beb1a28a5d931bbTodd Poynor    boolean isThrottling();
51875e5c74516dec3ccd32e2239beb1a28a5d931bbTodd Poynor}
52