Loading core/java/android/os/BatteryManager.java +7 −0 Original line number Diff line number Diff line Loading @@ -108,6 +108,13 @@ public class BatteryManager { */ 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 public static final int BATTERY_STATUS_UNKNOWN = 1; public static final int BATTERY_STATUS_CHARGING = 2; Loading core/java/android/os/BatteryProperties.java +4 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ public class BatteryProperties implements Parcelable { public boolean chargerUsbOnline; public boolean chargerWirelessOnline; public int maxChargingCurrent; public int maxChargingVoltage; public int batteryStatus; public int batteryHealth; public boolean batteryPresent; Loading @@ -39,6 +40,7 @@ public class BatteryProperties implements Parcelable { chargerUsbOnline = other.chargerUsbOnline; chargerWirelessOnline = other.chargerWirelessOnline; maxChargingCurrent = other.maxChargingCurrent; maxChargingVoltage = other.maxChargingVoltage; batteryStatus = other.batteryStatus; batteryHealth = other.batteryHealth; batteryPresent = other.batteryPresent; Loading @@ -58,6 +60,7 @@ public class BatteryProperties implements Parcelable { chargerUsbOnline = p.readInt() == 1 ? true : false; chargerWirelessOnline = p.readInt() == 1 ? true : false; maxChargingCurrent = p.readInt(); maxChargingVoltage = p.readInt(); batteryStatus = p.readInt(); batteryHealth = p.readInt(); batteryPresent = p.readInt() == 1 ? true : false; Loading @@ -72,6 +75,7 @@ public class BatteryProperties implements Parcelable { p.writeInt(chargerUsbOnline ? 1 : 0); p.writeInt(chargerWirelessOnline ? 1 : 0); p.writeInt(maxChargingCurrent); p.writeInt(maxChargingVoltage); p.writeInt(batteryStatus); p.writeInt(batteryHealth); p.writeInt(batteryPresent ? 1 : 0); Loading core/java/com/android/internal/os/InstallerConnection.java +9 −11 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import android.net.LocalSocket; import android.net.LocalSocketAddress; import android.os.SystemClock; import android.util.Slog; import libcore.io.IoUtils; import libcore.io.Streams; Loading Loading @@ -91,32 +92,29 @@ public class InstallerConnection { } } public int dexopt(String apkPath, int uid, boolean isPublic, String instructionSet, int dexoptNeeded, boolean bootComplete) { return dexopt(apkPath, uid, isPublic, "*", instructionSet, dexoptNeeded, false, false, null, bootComplete); public int dexopt(String apkPath, int uid, String instructionSet, int dexoptNeeded, int dexFlags) { return dexopt(apkPath, uid, "*", instructionSet, dexoptNeeded, null /*outputPath*/, dexFlags); } public int dexopt(String apkPath, int uid, boolean isPublic, String pkgName, String instructionSet, int dexoptNeeded, boolean vmSafeMode, boolean debuggable, String outputPath, boolean bootComplete) { public int dexopt(String apkPath, int uid, String pkgName, String instructionSet, int dexoptNeeded, String outputPath, int dexFlags) { StringBuilder builder = new StringBuilder("dexopt"); builder.append(' '); builder.append(apkPath); builder.append(' '); builder.append(uid); builder.append(isPublic ? " 1" : " 0"); builder.append(' '); builder.append(pkgName); builder.append(' '); builder.append(instructionSet); builder.append(' '); builder.append(dexoptNeeded); builder.append(vmSafeMode ? " 1" : " 0"); builder.append(debuggable ? " 1" : " 0"); builder.append(' '); builder.append(outputPath != null ? outputPath : "!"); builder.append(bootComplete ? " 1" : " 0"); builder.append(' '); builder.append(dexFlags); return execute(builder.toString()); } Loading core/java/com/android/internal/os/ZygoteInit.java +2 −2 Original line number Diff line number Diff line Loading @@ -476,8 +476,8 @@ public class ZygoteInit { final int dexoptNeeded = DexFile.getDexOptNeeded( classPathElement, "*", instructionSet, false /* defer */); if (dexoptNeeded != DexFile.NO_DEXOPT_NEEDED) { installer.dexopt(classPathElement, Process.SYSTEM_UID, false, instructionSet, dexoptNeeded, false /* boot complete */); installer.dexopt(classPathElement, Process.SYSTEM_UID, instructionSet, dexoptNeeded, 0 /*dexFlags*/); } } } catch (IOException ioe) { Loading services/core/java/com/android/server/BatteryService.java +8 −2 Original line number Diff line number Diff line Loading @@ -121,6 +121,7 @@ public final class BatteryService extends SystemService { private int mLastBatteryTemperature; private boolean mLastBatteryLevelCritical; private int mLastMaxChargingCurrent; private int mLastMaxChargingVoltage; private int mInvalidCharger; private int mLastInvalidCharger; Loading Loading @@ -325,6 +326,7 @@ public final class BatteryService extends SystemService { + ", chargerUsbOnline=" + mBatteryProps.chargerUsbOnline + ", chargerWirelessOnline=" + mBatteryProps.chargerWirelessOnline + ", maxChargingCurrent" + mBatteryProps.maxChargingCurrent + ", maxChargingVoltage" + mBatteryProps.maxChargingVoltage + ", batteryStatus=" + mBatteryProps.batteryStatus + ", batteryHealth=" + mBatteryProps.batteryHealth + ", batteryPresent=" + mBatteryProps.batteryPresent Loading Loading @@ -356,6 +358,7 @@ public final class BatteryService extends SystemService { mBatteryProps.batteryVoltage != mLastBatteryVoltage || mBatteryProps.batteryTemperature != mLastBatteryTemperature || mBatteryProps.maxChargingCurrent != mLastMaxChargingCurrent || mBatteryProps.maxChargingVoltage != mLastMaxChargingVoltage || mInvalidCharger != mLastInvalidCharger)) { if (mPlugType != mLastPlugType) { Loading Loading @@ -483,6 +486,7 @@ public final class BatteryService extends SystemService { mLastBatteryVoltage = mBatteryProps.batteryVoltage; mLastBatteryTemperature = mBatteryProps.batteryTemperature; mLastMaxChargingCurrent = mBatteryProps.maxChargingCurrent; mLastMaxChargingVoltage = mBatteryProps.maxChargingVoltage; mLastBatteryLevelCritical = mBatteryLevelCritical; mLastInvalidCharger = mInvalidCharger; } Loading @@ -508,7 +512,7 @@ public final class BatteryService extends SystemService { intent.putExtra(BatteryManager.EXTRA_TECHNOLOGY, mBatteryProps.batteryTechnology); intent.putExtra(BatteryManager.EXTRA_INVALID_CHARGER, mInvalidCharger); intent.putExtra(BatteryManager.EXTRA_MAX_CHARGING_CURRENT, mBatteryProps.maxChargingCurrent); intent.putExtra(BatteryManager.EXTRA_MAX_CHARGING_VOLTAGE, mBatteryProps.maxChargingVoltage); if (DEBUG) { Slog.d(TAG, "Sending ACTION_BATTERY_CHANGED. level:" + mBatteryProps.batteryLevel + ", scale:" + BATTERY_SCALE + ", status:" + mBatteryProps.batteryStatus + Loading @@ -521,7 +525,8 @@ public final class BatteryService extends SystemService { ", USB powered:" + mBatteryProps.chargerUsbOnline + ", Wireless powered:" + mBatteryProps.chargerWirelessOnline + ", icon:" + icon + ", invalid charger:" + mInvalidCharger + ", maxChargingCurrent:" + mBatteryProps.maxChargingCurrent); ", maxChargingCurrent:" + mBatteryProps.maxChargingCurrent + ", maxChargingVoltage:" + mBatteryProps.maxChargingVoltage); } mHandler.post(new Runnable() { Loading Loading @@ -627,6 +632,7 @@ public final class BatteryService extends SystemService { pw.println(" USB powered: " + mBatteryProps.chargerUsbOnline); pw.println(" Wireless powered: " + mBatteryProps.chargerWirelessOnline); pw.println(" Max charging current: " + mBatteryProps.maxChargingCurrent); pw.println(" Max charging voltage: " + mBatteryProps.maxChargingVoltage); pw.println(" status: " + mBatteryProps.batteryStatus); pw.println(" health: " + mBatteryProps.batteryHealth); pw.println(" present: " + mBatteryProps.batteryPresent); Loading Loading
core/java/android/os/BatteryManager.java +7 −0 Original line number Diff line number Diff line Loading @@ -108,6 +108,13 @@ public class BatteryManager { */ 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 public static final int BATTERY_STATUS_UNKNOWN = 1; public static final int BATTERY_STATUS_CHARGING = 2; Loading
core/java/android/os/BatteryProperties.java +4 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ public class BatteryProperties implements Parcelable { public boolean chargerUsbOnline; public boolean chargerWirelessOnline; public int maxChargingCurrent; public int maxChargingVoltage; public int batteryStatus; public int batteryHealth; public boolean batteryPresent; Loading @@ -39,6 +40,7 @@ public class BatteryProperties implements Parcelable { chargerUsbOnline = other.chargerUsbOnline; chargerWirelessOnline = other.chargerWirelessOnline; maxChargingCurrent = other.maxChargingCurrent; maxChargingVoltage = other.maxChargingVoltage; batteryStatus = other.batteryStatus; batteryHealth = other.batteryHealth; batteryPresent = other.batteryPresent; Loading @@ -58,6 +60,7 @@ public class BatteryProperties implements Parcelable { chargerUsbOnline = p.readInt() == 1 ? true : false; chargerWirelessOnline = p.readInt() == 1 ? true : false; maxChargingCurrent = p.readInt(); maxChargingVoltage = p.readInt(); batteryStatus = p.readInt(); batteryHealth = p.readInt(); batteryPresent = p.readInt() == 1 ? true : false; Loading @@ -72,6 +75,7 @@ public class BatteryProperties implements Parcelable { p.writeInt(chargerUsbOnline ? 1 : 0); p.writeInt(chargerWirelessOnline ? 1 : 0); p.writeInt(maxChargingCurrent); p.writeInt(maxChargingVoltage); p.writeInt(batteryStatus); p.writeInt(batteryHealth); p.writeInt(batteryPresent ? 1 : 0); Loading
core/java/com/android/internal/os/InstallerConnection.java +9 −11 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import android.net.LocalSocket; import android.net.LocalSocketAddress; import android.os.SystemClock; import android.util.Slog; import libcore.io.IoUtils; import libcore.io.Streams; Loading Loading @@ -91,32 +92,29 @@ public class InstallerConnection { } } public int dexopt(String apkPath, int uid, boolean isPublic, String instructionSet, int dexoptNeeded, boolean bootComplete) { return dexopt(apkPath, uid, isPublic, "*", instructionSet, dexoptNeeded, false, false, null, bootComplete); public int dexopt(String apkPath, int uid, String instructionSet, int dexoptNeeded, int dexFlags) { return dexopt(apkPath, uid, "*", instructionSet, dexoptNeeded, null /*outputPath*/, dexFlags); } public int dexopt(String apkPath, int uid, boolean isPublic, String pkgName, String instructionSet, int dexoptNeeded, boolean vmSafeMode, boolean debuggable, String outputPath, boolean bootComplete) { public int dexopt(String apkPath, int uid, String pkgName, String instructionSet, int dexoptNeeded, String outputPath, int dexFlags) { StringBuilder builder = new StringBuilder("dexopt"); builder.append(' '); builder.append(apkPath); builder.append(' '); builder.append(uid); builder.append(isPublic ? " 1" : " 0"); builder.append(' '); builder.append(pkgName); builder.append(' '); builder.append(instructionSet); builder.append(' '); builder.append(dexoptNeeded); builder.append(vmSafeMode ? " 1" : " 0"); builder.append(debuggable ? " 1" : " 0"); builder.append(' '); builder.append(outputPath != null ? outputPath : "!"); builder.append(bootComplete ? " 1" : " 0"); builder.append(' '); builder.append(dexFlags); return execute(builder.toString()); } Loading
core/java/com/android/internal/os/ZygoteInit.java +2 −2 Original line number Diff line number Diff line Loading @@ -476,8 +476,8 @@ public class ZygoteInit { final int dexoptNeeded = DexFile.getDexOptNeeded( classPathElement, "*", instructionSet, false /* defer */); if (dexoptNeeded != DexFile.NO_DEXOPT_NEEDED) { installer.dexopt(classPathElement, Process.SYSTEM_UID, false, instructionSet, dexoptNeeded, false /* boot complete */); installer.dexopt(classPathElement, Process.SYSTEM_UID, instructionSet, dexoptNeeded, 0 /*dexFlags*/); } } } catch (IOException ioe) { Loading
services/core/java/com/android/server/BatteryService.java +8 −2 Original line number Diff line number Diff line Loading @@ -121,6 +121,7 @@ public final class BatteryService extends SystemService { private int mLastBatteryTemperature; private boolean mLastBatteryLevelCritical; private int mLastMaxChargingCurrent; private int mLastMaxChargingVoltage; private int mInvalidCharger; private int mLastInvalidCharger; Loading Loading @@ -325,6 +326,7 @@ public final class BatteryService extends SystemService { + ", chargerUsbOnline=" + mBatteryProps.chargerUsbOnline + ", chargerWirelessOnline=" + mBatteryProps.chargerWirelessOnline + ", maxChargingCurrent" + mBatteryProps.maxChargingCurrent + ", maxChargingVoltage" + mBatteryProps.maxChargingVoltage + ", batteryStatus=" + mBatteryProps.batteryStatus + ", batteryHealth=" + mBatteryProps.batteryHealth + ", batteryPresent=" + mBatteryProps.batteryPresent Loading Loading @@ -356,6 +358,7 @@ public final class BatteryService extends SystemService { mBatteryProps.batteryVoltage != mLastBatteryVoltage || mBatteryProps.batteryTemperature != mLastBatteryTemperature || mBatteryProps.maxChargingCurrent != mLastMaxChargingCurrent || mBatteryProps.maxChargingVoltage != mLastMaxChargingVoltage || mInvalidCharger != mLastInvalidCharger)) { if (mPlugType != mLastPlugType) { Loading Loading @@ -483,6 +486,7 @@ public final class BatteryService extends SystemService { mLastBatteryVoltage = mBatteryProps.batteryVoltage; mLastBatteryTemperature = mBatteryProps.batteryTemperature; mLastMaxChargingCurrent = mBatteryProps.maxChargingCurrent; mLastMaxChargingVoltage = mBatteryProps.maxChargingVoltage; mLastBatteryLevelCritical = mBatteryLevelCritical; mLastInvalidCharger = mInvalidCharger; } Loading @@ -508,7 +512,7 @@ public final class BatteryService extends SystemService { intent.putExtra(BatteryManager.EXTRA_TECHNOLOGY, mBatteryProps.batteryTechnology); intent.putExtra(BatteryManager.EXTRA_INVALID_CHARGER, mInvalidCharger); intent.putExtra(BatteryManager.EXTRA_MAX_CHARGING_CURRENT, mBatteryProps.maxChargingCurrent); intent.putExtra(BatteryManager.EXTRA_MAX_CHARGING_VOLTAGE, mBatteryProps.maxChargingVoltage); if (DEBUG) { Slog.d(TAG, "Sending ACTION_BATTERY_CHANGED. level:" + mBatteryProps.batteryLevel + ", scale:" + BATTERY_SCALE + ", status:" + mBatteryProps.batteryStatus + Loading @@ -521,7 +525,8 @@ public final class BatteryService extends SystemService { ", USB powered:" + mBatteryProps.chargerUsbOnline + ", Wireless powered:" + mBatteryProps.chargerWirelessOnline + ", icon:" + icon + ", invalid charger:" + mInvalidCharger + ", maxChargingCurrent:" + mBatteryProps.maxChargingCurrent); ", maxChargingCurrent:" + mBatteryProps.maxChargingCurrent + ", maxChargingVoltage:" + mBatteryProps.maxChargingVoltage); } mHandler.post(new Runnable() { Loading Loading @@ -627,6 +632,7 @@ public final class BatteryService extends SystemService { pw.println(" USB powered: " + mBatteryProps.chargerUsbOnline); pw.println(" Wireless powered: " + mBatteryProps.chargerWirelessOnline); pw.println(" Max charging current: " + mBatteryProps.maxChargingCurrent); pw.println(" Max charging voltage: " + mBatteryProps.maxChargingVoltage); pw.println(" status: " + mBatteryProps.batteryStatus); pw.println(" health: " + mBatteryProps.batteryHealth); pw.println(" present: " + mBatteryProps.batteryPresent); Loading