resolve merge conflicts of 5032e49f9e to mnc-dr2-dev-plus-aosp.

Change-Id: If4a565a262befdc3d6e206c892e2be9711d52c0f
This commit is contained in:
Rom Lemarchand
2015-11-17 15:38:50 -08:00
committed by Rom Lemarchand
4 changed files with 19 additions and 4 deletions

View File

@@ -108,6 +108,13 @@ public class BatteryManager {
*/ */
public static final String EXTRA_MAX_CHARGING_CURRENT = "max_charging_current"; public static final String EXTRA_MAX_CHARGING_CURRENT = "max_charging_current";
/**
* Extra for {@link android.content.Intent#ACTION_BATTERY_CHANGED}:
* Int value set to the maximum charging voltage supported by the charger in micro volts.
* {@hide}
*/
public static final String EXTRA_MAX_CHARGING_VOLTAGE = "max_charging_voltage";
// values for "status" field in the ACTION_BATTERY_CHANGED Intent // values for "status" field in the ACTION_BATTERY_CHANGED Intent
public static final int BATTERY_STATUS_UNKNOWN = 1; public static final int BATTERY_STATUS_UNKNOWN = 1;
public static final int BATTERY_STATUS_CHARGING = 2; public static final int BATTERY_STATUS_CHARGING = 2;

View File

@@ -23,6 +23,7 @@ public class BatteryProperties implements Parcelable {
public boolean chargerUsbOnline; public boolean chargerUsbOnline;
public boolean chargerWirelessOnline; public boolean chargerWirelessOnline;
public int maxChargingCurrent; public int maxChargingCurrent;
public int maxChargingVoltage;
public int batteryStatus; public int batteryStatus;
public int batteryHealth; public int batteryHealth;
public boolean batteryPresent; public boolean batteryPresent;
@@ -39,6 +40,7 @@ public class BatteryProperties implements Parcelable {
chargerUsbOnline = other.chargerUsbOnline; chargerUsbOnline = other.chargerUsbOnline;
chargerWirelessOnline = other.chargerWirelessOnline; chargerWirelessOnline = other.chargerWirelessOnline;
maxChargingCurrent = other.maxChargingCurrent; maxChargingCurrent = other.maxChargingCurrent;
maxChargingVoltage = other.maxChargingVoltage;
batteryStatus = other.batteryStatus; batteryStatus = other.batteryStatus;
batteryHealth = other.batteryHealth; batteryHealth = other.batteryHealth;
batteryPresent = other.batteryPresent; batteryPresent = other.batteryPresent;
@@ -58,6 +60,7 @@ public class BatteryProperties implements Parcelable {
chargerUsbOnline = p.readInt() == 1 ? true : false; chargerUsbOnline = p.readInt() == 1 ? true : false;
chargerWirelessOnline = p.readInt() == 1 ? true : false; chargerWirelessOnline = p.readInt() == 1 ? true : false;
maxChargingCurrent = p.readInt(); maxChargingCurrent = p.readInt();
maxChargingVoltage = p.readInt();
batteryStatus = p.readInt(); batteryStatus = p.readInt();
batteryHealth = p.readInt(); batteryHealth = p.readInt();
batteryPresent = p.readInt() == 1 ? true : false; batteryPresent = p.readInt() == 1 ? true : false;
@@ -72,6 +75,7 @@ public class BatteryProperties implements Parcelable {
p.writeInt(chargerUsbOnline ? 1 : 0); p.writeInt(chargerUsbOnline ? 1 : 0);
p.writeInt(chargerWirelessOnline ? 1 : 0); p.writeInt(chargerWirelessOnline ? 1 : 0);
p.writeInt(maxChargingCurrent); p.writeInt(maxChargingCurrent);
p.writeInt(maxChargingVoltage);
p.writeInt(batteryStatus); p.writeInt(batteryStatus);
p.writeInt(batteryHealth); p.writeInt(batteryHealth);
p.writeInt(batteryPresent ? 1 : 0); p.writeInt(batteryPresent ? 1 : 0);

View File

@@ -121,6 +121,7 @@ public final class BatteryService extends SystemService {
private int mLastBatteryTemperature; private int mLastBatteryTemperature;
private boolean mLastBatteryLevelCritical; private boolean mLastBatteryLevelCritical;
private int mLastMaxChargingCurrent; private int mLastMaxChargingCurrent;
private int mLastMaxChargingVoltage;
private int mInvalidCharger; private int mInvalidCharger;
private int mLastInvalidCharger; private int mLastInvalidCharger;
@@ -325,6 +326,7 @@ public final class BatteryService extends SystemService {
+ ", chargerUsbOnline=" + mBatteryProps.chargerUsbOnline + ", chargerUsbOnline=" + mBatteryProps.chargerUsbOnline
+ ", chargerWirelessOnline=" + mBatteryProps.chargerWirelessOnline + ", chargerWirelessOnline=" + mBatteryProps.chargerWirelessOnline
+ ", maxChargingCurrent" + mBatteryProps.maxChargingCurrent + ", maxChargingCurrent" + mBatteryProps.maxChargingCurrent
+ ", maxChargingVoltage" + mBatteryProps.maxChargingVoltage
+ ", batteryStatus=" + mBatteryProps.batteryStatus + ", batteryStatus=" + mBatteryProps.batteryStatus
+ ", batteryHealth=" + mBatteryProps.batteryHealth + ", batteryHealth=" + mBatteryProps.batteryHealth
+ ", batteryPresent=" + mBatteryProps.batteryPresent + ", batteryPresent=" + mBatteryProps.batteryPresent
@@ -356,6 +358,7 @@ public final class BatteryService extends SystemService {
mBatteryProps.batteryVoltage != mLastBatteryVoltage || mBatteryProps.batteryVoltage != mLastBatteryVoltage ||
mBatteryProps.batteryTemperature != mLastBatteryTemperature || mBatteryProps.batteryTemperature != mLastBatteryTemperature ||
mBatteryProps.maxChargingCurrent != mLastMaxChargingCurrent || mBatteryProps.maxChargingCurrent != mLastMaxChargingCurrent ||
mBatteryProps.maxChargingVoltage != mLastMaxChargingVoltage ||
mInvalidCharger != mLastInvalidCharger)) { mInvalidCharger != mLastInvalidCharger)) {
if (mPlugType != mLastPlugType) { if (mPlugType != mLastPlugType) {
@@ -483,6 +486,7 @@ public final class BatteryService extends SystemService {
mLastBatteryVoltage = mBatteryProps.batteryVoltage; mLastBatteryVoltage = mBatteryProps.batteryVoltage;
mLastBatteryTemperature = mBatteryProps.batteryTemperature; mLastBatteryTemperature = mBatteryProps.batteryTemperature;
mLastMaxChargingCurrent = mBatteryProps.maxChargingCurrent; mLastMaxChargingCurrent = mBatteryProps.maxChargingCurrent;
mLastMaxChargingVoltage = mBatteryProps.maxChargingVoltage;
mLastBatteryLevelCritical = mBatteryLevelCritical; mLastBatteryLevelCritical = mBatteryLevelCritical;
mLastInvalidCharger = mInvalidCharger; mLastInvalidCharger = mInvalidCharger;
} }
@@ -508,7 +512,7 @@ public final class BatteryService extends SystemService {
intent.putExtra(BatteryManager.EXTRA_TECHNOLOGY, mBatteryProps.batteryTechnology); intent.putExtra(BatteryManager.EXTRA_TECHNOLOGY, mBatteryProps.batteryTechnology);
intent.putExtra(BatteryManager.EXTRA_INVALID_CHARGER, mInvalidCharger); intent.putExtra(BatteryManager.EXTRA_INVALID_CHARGER, mInvalidCharger);
intent.putExtra(BatteryManager.EXTRA_MAX_CHARGING_CURRENT, mBatteryProps.maxChargingCurrent); intent.putExtra(BatteryManager.EXTRA_MAX_CHARGING_CURRENT, mBatteryProps.maxChargingCurrent);
intent.putExtra(BatteryManager.EXTRA_MAX_CHARGING_VOLTAGE, mBatteryProps.maxChargingVoltage);
if (DEBUG) { if (DEBUG) {
Slog.d(TAG, "Sending ACTION_BATTERY_CHANGED. level:" + mBatteryProps.batteryLevel + Slog.d(TAG, "Sending ACTION_BATTERY_CHANGED. level:" + mBatteryProps.batteryLevel +
", scale:" + BATTERY_SCALE + ", status:" + mBatteryProps.batteryStatus + ", scale:" + BATTERY_SCALE + ", status:" + mBatteryProps.batteryStatus +
@@ -521,7 +525,8 @@ public final class BatteryService extends SystemService {
", USB powered:" + mBatteryProps.chargerUsbOnline + ", USB powered:" + mBatteryProps.chargerUsbOnline +
", Wireless powered:" + mBatteryProps.chargerWirelessOnline + ", Wireless powered:" + mBatteryProps.chargerWirelessOnline +
", icon:" + icon + ", invalid charger:" + mInvalidCharger + ", icon:" + icon + ", invalid charger:" + mInvalidCharger +
", maxChargingCurrent:" + mBatteryProps.maxChargingCurrent); ", maxChargingCurrent:" + mBatteryProps.maxChargingCurrent +
", maxChargingVoltage:" + mBatteryProps.maxChargingVoltage);
} }
mHandler.post(new Runnable() { mHandler.post(new Runnable() {
@@ -627,6 +632,7 @@ public final class BatteryService extends SystemService {
pw.println(" USB powered: " + mBatteryProps.chargerUsbOnline); pw.println(" USB powered: " + mBatteryProps.chargerUsbOnline);
pw.println(" Wireless powered: " + mBatteryProps.chargerWirelessOnline); pw.println(" Wireless powered: " + mBatteryProps.chargerWirelessOnline);
pw.println(" Max charging current: " + mBatteryProps.maxChargingCurrent); pw.println(" Max charging current: " + mBatteryProps.maxChargingCurrent);
pw.println(" Max charging voltage: " + mBatteryProps.maxChargingVoltage);
pw.println(" status: " + mBatteryProps.batteryStatus); pw.println(" status: " + mBatteryProps.batteryStatus);
pw.println(" health: " + mBatteryProps.batteryHealth); pw.println(" health: " + mBatteryProps.batteryHealth);
pw.println(" present: " + mBatteryProps.batteryPresent); pw.println(" present: " + mBatteryProps.batteryPresent);

View File

@@ -18725,8 +18725,6 @@ public final class ActivityManagerService extends ActivityManagerNative
} }
} }
} }
Process.setSwappiness(app.pid,
app.curSchedGroup <= Process.THREAD_GROUP_BG_NONINTERACTIVE);
} }
} }
if (app.repForegroundActivities != app.foregroundActivities) { if (app.repForegroundActivities != app.foregroundActivities) {