summaryrefslogtreecommitdiffstats
path: root/core/java
diff options
context:
space:
mode:
authorAdam Lesinski <adamlesinski@google.com>2015-06-16 00:46:04 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-06-16 00:46:09 +0000
commitd5e5151f6ceab498e3a35928c1f6f7a177c1544e (patch)
treef4bee5cf1c8d7fdab1a8a74ae597716b2584b003 /core/java
parentd719215fed261b41ae29acf87faef00f76c8faa7 (diff)
parent8a351373881e2e11c2636d6f9445f9df9accbace (diff)
downloadframeworks_base-d5e5151f6ceab498e3a35928c1f6f7a177c1544e.zip
frameworks_base-d5e5151f6ceab498e3a35928c1f6f7a177c1544e.tar.gz
frameworks_base-d5e5151f6ceab498e3a35928c1f6f7a177c1544e.tar.bz2
Merge "Bluetooth energy: fix overflow in calculation" into mnc-dev
Diffstat (limited to 'core/java')
-rw-r--r--core/java/android/bluetooth/BluetoothActivityEnergyInfo.java40
1 files changed, 20 insertions, 20 deletions
diff --git a/core/java/android/bluetooth/BluetoothActivityEnergyInfo.java b/core/java/android/bluetooth/BluetoothActivityEnergyInfo.java
index 161c339..834a587 100644
--- a/core/java/android/bluetooth/BluetoothActivityEnergyInfo.java
+++ b/core/java/android/bluetooth/BluetoothActivityEnergyInfo.java
@@ -28,10 +28,10 @@ import android.os.Parcelable;
public final class BluetoothActivityEnergyInfo implements Parcelable {
private final long mTimestamp;
private final int mBluetoothStackState;
- private final int mControllerTxTimeMs;
- private final int mControllerRxTimeMs;
- private final int mControllerIdleTimeMs;
- private final int mControllerEnergyUsed;
+ private final long mControllerTxTimeMs;
+ private final long mControllerRxTimeMs;
+ private final long mControllerIdleTimeMs;
+ private final long mControllerEnergyUsed;
public static final int BT_STACK_STATE_INVALID = 0;
public static final int BT_STACK_STATE_STATE_ACTIVE = 1;
@@ -39,7 +39,7 @@ public final class BluetoothActivityEnergyInfo implements Parcelable {
public static final int BT_STACK_STATE_STATE_IDLE = 3;
public BluetoothActivityEnergyInfo(long timestamp, int stackState,
- int txTime, int rxTime, int idleTime, int energyUsed) {
+ long txTime, long rxTime, long idleTime, long energyUsed) {
mTimestamp = timestamp;
mBluetoothStackState = stackState;
mControllerTxTimeMs = txTime;
@@ -65,10 +65,10 @@ public final class BluetoothActivityEnergyInfo implements Parcelable {
public BluetoothActivityEnergyInfo createFromParcel(Parcel in) {
long timestamp = in.readLong();
int stackState = in.readInt();
- int txTime = in.readInt();
- int rxTime = in.readInt();
- int idleTime = in.readInt();
- int energyUsed = in.readInt();
+ long txTime = in.readLong();
+ long rxTime = in.readLong();
+ long idleTime = in.readLong();
+ long energyUsed = in.readLong();
return new BluetoothActivityEnergyInfo(timestamp, stackState,
txTime, rxTime, idleTime, energyUsed);
}
@@ -80,10 +80,10 @@ public final class BluetoothActivityEnergyInfo implements Parcelable {
public void writeToParcel(Parcel out, int flags) {
out.writeLong(mTimestamp);
out.writeInt(mBluetoothStackState);
- out.writeInt(mControllerTxTimeMs);
- out.writeInt(mControllerRxTimeMs);
- out.writeInt(mControllerIdleTimeMs);
- out.writeInt(mControllerEnergyUsed);
+ out.writeLong(mControllerTxTimeMs);
+ out.writeLong(mControllerRxTimeMs);
+ out.writeLong(mControllerIdleTimeMs);
+ out.writeLong(mControllerEnergyUsed);
}
public int describeContents() {
@@ -100,21 +100,21 @@ public final class BluetoothActivityEnergyInfo implements Parcelable {
/**
* @return tx time in ms
*/
- public int getControllerTxTimeMillis() {
+ public long getControllerTxTimeMillis() {
return mControllerTxTimeMs;
}
/**
* @return rx time in ms
*/
- public int getControllerRxTimeMillis() {
+ public long getControllerRxTimeMillis() {
return mControllerRxTimeMs;
}
/**
* @return idle time in ms
*/
- public int getControllerIdleTimeMillis() {
+ public long getControllerIdleTimeMillis() {
return mControllerIdleTimeMs;
}
@@ -122,7 +122,7 @@ public final class BluetoothActivityEnergyInfo implements Parcelable {
* product of current(mA), voltage(V) and time(ms)
* @return energy used
*/
- public int getControllerEnergyUsed() {
+ public long getControllerEnergyUsed() {
return mControllerEnergyUsed;
}
@@ -137,8 +137,8 @@ public final class BluetoothActivityEnergyInfo implements Parcelable {
* @return if the record is valid
*/
public boolean isValid() {
- return ((getControllerTxTimeMillis() !=0) ||
- (getControllerRxTimeMillis() !=0) ||
- (getControllerIdleTimeMillis() !=0));
+ return ((mControllerTxTimeMs !=0) ||
+ (mControllerRxTimeMs !=0) ||
+ (mControllerIdleTimeMs !=0));
}
}