Loading packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java +10 −1 Original line number Diff line number Diff line Loading @@ -68,6 +68,7 @@ import android.telephony.SubscriptionManager; import android.telephony.SubscriptionManager.OnSubscriptionsChangedListener; import android.telephony.TelephonyManager; import android.util.Log; import android.util.Slog; import android.util.SparseBooleanArray; import android.util.SparseIntArray; Loading @@ -78,7 +79,6 @@ import com.android.internal.telephony.PhoneConstants; import com.android.internal.telephony.TelephonyIntents; import com.android.internal.widget.LockPatternUtils; import com.android.systemui.recents.misc.SysUiTaskStackChangeListener; import com.android.systemui.recents.misc.SystemServicesProxy; import com.android.systemui.shared.system.ActivityManagerWrapper; import com.google.android.collect.Lists; Loading Loading @@ -984,6 +984,15 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener { || plugged == BatteryManager.BATTERY_PLUGGED_WIRELESS; } /** * Determine whether the device is plugged in (USB, power). * @return true if the device is plugged in wired (as opposed to wireless) */ public boolean isPluggedInWired() { return plugged == BatteryManager.BATTERY_PLUGGED_AC || plugged == BatteryManager.BATTERY_PLUGGED_USB; } /** * Whether or not the device is charged. Note that some devices never return 100% for * battery level, so this allows either battery level or status to determine if the Loading packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java +4 −1 Original line number Diff line number Diff line Loading @@ -92,6 +92,7 @@ public class KeyguardIndicationController { private boolean mVisible; private boolean mPowerPluggedIn; private boolean mPowerPluggedInWired; private boolean mPowerCharged; private int mChargingSpeed; private int mChargingWattage; Loading Loading @@ -476,6 +477,7 @@ public class KeyguardIndicationController { pw.println("KeyguardIndicationController:"); pw.println(" mTransientTextColor: " + Integer.toHexString(mTransientTextColor)); pw.println(" mInitialTextColor: " + Integer.toHexString(mInitialTextColor)); pw.println(" mPowerPluggedInWired: " + mPowerPluggedInWired); pw.println(" mPowerPluggedIn: " + mPowerPluggedIn); pw.println(" mPowerCharged: " + mPowerCharged); pw.println(" mChargingSpeed: " + mChargingSpeed); Loading @@ -496,12 +498,13 @@ public class KeyguardIndicationController { boolean isChargingOrFull = status.status == BatteryManager.BATTERY_STATUS_CHARGING || status.status == BatteryManager.BATTERY_STATUS_FULL; boolean wasPluggedIn = mPowerPluggedIn; mPowerPluggedInWired = status.isPluggedInWired() && isChargingOrFull; mPowerPluggedIn = status.isPluggedIn() && isChargingOrFull; mPowerCharged = status.isCharged(); mChargingWattage = status.maxChargingWattage; mChargingSpeed = status.getChargingSpeed(mSlowThreshold, mFastThreshold); mBatteryLevel = status.level; updateIndication(!wasPluggedIn && mPowerPluggedIn); updateIndication(!wasPluggedIn && mPowerPluggedInWired); if (mDozing) { if (!wasPluggedIn && mPowerPluggedIn) { showTransientIndication(computePowerIndication()); Loading Loading
packages/SystemUI/src/com/android/keyguard/KeyguardUpdateMonitor.java +10 −1 Original line number Diff line number Diff line Loading @@ -68,6 +68,7 @@ import android.telephony.SubscriptionManager; import android.telephony.SubscriptionManager.OnSubscriptionsChangedListener; import android.telephony.TelephonyManager; import android.util.Log; import android.util.Slog; import android.util.SparseBooleanArray; import android.util.SparseIntArray; Loading @@ -78,7 +79,6 @@ import com.android.internal.telephony.PhoneConstants; import com.android.internal.telephony.TelephonyIntents; import com.android.internal.widget.LockPatternUtils; import com.android.systemui.recents.misc.SysUiTaskStackChangeListener; import com.android.systemui.recents.misc.SystemServicesProxy; import com.android.systemui.shared.system.ActivityManagerWrapper; import com.google.android.collect.Lists; Loading Loading @@ -984,6 +984,15 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener { || plugged == BatteryManager.BATTERY_PLUGGED_WIRELESS; } /** * Determine whether the device is plugged in (USB, power). * @return true if the device is plugged in wired (as opposed to wireless) */ public boolean isPluggedInWired() { return plugged == BatteryManager.BATTERY_PLUGGED_AC || plugged == BatteryManager.BATTERY_PLUGGED_USB; } /** * Whether or not the device is charged. Note that some devices never return 100% for * battery level, so this allows either battery level or status to determine if the Loading
packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java +4 −1 Original line number Diff line number Diff line Loading @@ -92,6 +92,7 @@ public class KeyguardIndicationController { private boolean mVisible; private boolean mPowerPluggedIn; private boolean mPowerPluggedInWired; private boolean mPowerCharged; private int mChargingSpeed; private int mChargingWattage; Loading Loading @@ -476,6 +477,7 @@ public class KeyguardIndicationController { pw.println("KeyguardIndicationController:"); pw.println(" mTransientTextColor: " + Integer.toHexString(mTransientTextColor)); pw.println(" mInitialTextColor: " + Integer.toHexString(mInitialTextColor)); pw.println(" mPowerPluggedInWired: " + mPowerPluggedInWired); pw.println(" mPowerPluggedIn: " + mPowerPluggedIn); pw.println(" mPowerCharged: " + mPowerCharged); pw.println(" mChargingSpeed: " + mChargingSpeed); Loading @@ -496,12 +498,13 @@ public class KeyguardIndicationController { boolean isChargingOrFull = status.status == BatteryManager.BATTERY_STATUS_CHARGING || status.status == BatteryManager.BATTERY_STATUS_FULL; boolean wasPluggedIn = mPowerPluggedIn; mPowerPluggedInWired = status.isPluggedInWired() && isChargingOrFull; mPowerPluggedIn = status.isPluggedIn() && isChargingOrFull; mPowerCharged = status.isCharged(); mChargingWattage = status.maxChargingWattage; mChargingSpeed = status.getChargingSpeed(mSlowThreshold, mFastThreshold); mBatteryLevel = status.level; updateIndication(!wasPluggedIn && mPowerPluggedIn); updateIndication(!wasPluggedIn && mPowerPluggedInWired); if (mDozing) { if (!wasPluggedIn && mPowerPluggedIn) { showTransientIndication(computePowerIndication()); Loading