-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
thermal: add battery properties on Android (#29)
* thermal: add battery parameters in Android * remove debug-only code * rename methods * add documentation comments * thermal: platform isolation * update ThermalView.cs * add comments * add comments * Remove struct ThermalStatus * update ThermalView.cs * bump to 2.0.0 * update date
- Loading branch information
Showing
18 changed files
with
1,019 additions
and
180 deletions.
There are no files selected for viewing
41 changes: 41 additions & 0 deletions
41
Android/app/src/main/java/jp/co/cyberagent/unitysupport/app/BatteryStatusReceiver.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package jp.co.cyberagent.unitysupport.app; | ||
|
||
import java.util.function.Consumer; | ||
|
||
public class BatteryStatusReceiver implements jp.co.cyberagent.unitysupport.thermal.BatteryStatusReceiver { | ||
private Consumer<Integer> onReceiveTemperature; | ||
private Consumer<Integer> onReceiveVoltage; | ||
private Consumer<Float> onReceiveLevel; | ||
private Consumer<Integer> onReceiveStatus; | ||
|
||
@Override | ||
public void onReceiveBatteryTemperature(int temperature) { | ||
onReceiveTemperature.accept(new Integer(temperature)); | ||
} | ||
|
||
@Override | ||
public void onReceiveVoltage(int voltage) { | ||
onReceiveVoltage.accept(new Integer(voltage)); | ||
} | ||
|
||
@Override | ||
public void onReceiveLevel(float level) { | ||
onReceiveLevel.accept(new Float(level)); | ||
} | ||
|
||
@Override | ||
public void onReceiveStatus(int status) { | ||
onReceiveStatus.accept(new Integer(status)); | ||
} | ||
|
||
public BatteryStatusReceiver( | ||
Consumer<Integer> onReceiveTemperature, | ||
Consumer<Integer> onReceiveVoltage, | ||
Consumer<Float> onReceiveLevel, | ||
Consumer<Integer> onReceiveStatus) { | ||
this.onReceiveTemperature = onReceiveTemperature; | ||
this.onReceiveVoltage = onReceiveVoltage; | ||
this.onReceiveLevel = onReceiveLevel; | ||
this.onReceiveStatus = onReceiveStatus; | ||
} | ||
} |
20 changes: 0 additions & 20 deletions
20
Android/app/src/main/java/jp/co/cyberagent/unitysupport/app/BatteryTemperatureReceiver.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.