From 0c7f83c20bb9b6926d31faa7dd28867a98f487c1 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 13 Jul 2026 01:13:51 +0000 Subject: [PATCH] Health basis honesty + 20-80% charging guidance (#114) Part A - health basis: the Insights health figure already prefers the measured value (capacity / rated capacity); the misleading case was the cycle-based fallback, whose app-tracked count starts at zero on install and so understates wear on any phone older than the app. Now: - The basis caption distinguishes the cycle sources: "reported by Android" (lifetime count, Android 14+) vs "tracked since install - real wear may be higher" (new BatteryHealthTracker.isCycleCountFromOs) - "How it works" rewritten to explain all three bases and note the cycle curve is a generic lithium-ion approximation (real cycle life varies by manufacturer and cell, Li-ion and Li-Po alike), plus the 20-80% care tip Part B - charging guidance: retire the "healthy/regular charge" concept (plugged in at <=20% flipped notification titles); starting low is not a virtue under modern guidance, and the full-charge text even encouraged staying plugged at 100%. Now: - One neutral title per event: "Charging started", "Battery fully charged"; the critical alert title "Healthy charge time" becomes "Battery critically low" - Full-charge text now nudges unplugging: batteries age fastest kept at 100%, stay roughly 20-80% day to day - Warning/critical/full copy grammar cleaned up - Deleted the healthy-flag plumbing (threshold, setIsHealthy, title flips) and six dead strings from the pre-#122 charger messages All copy mirrored in values-ar. An actual "unplug at X%" reminder stays out of scope (#115). Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_015ZMe8rrw7eQKz69R4Xw3t5 --- .../receiver/PowerConnectionReceiver.java | 19 ++------ .../service/BatteryHealthTracker.java | 20 ++++++++ .../service/NotificationService.java | 46 +++++-------------- .../ui/BatteryInsightsActivity.java | 11 ++++- .../res/layout/activity_battery_insights.xml | 2 +- app/src/main/res/values-ar/strings.xml | 41 ++++++++--------- app/src/main/res/values/strings.xml | 43 ++++++++--------- .../receiver/PowerConnectionReceiverTest.java | 18 ++++---- 8 files changed, 92 insertions(+), 108 deletions(-) diff --git a/app/src/main/java/com/almothafar/simplebatterynotifier/receiver/PowerConnectionReceiver.java b/app/src/main/java/com/almothafar/simplebatterynotifier/receiver/PowerConnectionReceiver.java index 0d57022..15096de 100644 --- a/app/src/main/java/com/almothafar/simplebatterynotifier/receiver/PowerConnectionReceiver.java +++ b/app/src/main/java/com/almothafar/simplebatterynotifier/receiver/PowerConnectionReceiver.java @@ -29,11 +29,6 @@ public class PowerConnectionReceiver extends BroadcastReceiver { private static final String TAG = PowerConnectionReceiver.class.getSimpleName(); - /** - * Battery percentage threshold for healthy charging (charge when battery is low) - */ - private static final int HEALTHY_CHARGE_THRESHOLD = 20; - /** * Delay before sampling the charging current, giving it time to stabilise after plug-in. * Package-visible so tests can advance the main looper by exactly this amount. @@ -103,18 +98,15 @@ public void onReceive(final Context context, final Intent intent) { /** * Handle charger connected event. *

- * Records whether this is a "healthy" charge (started at low battery), determines wired vs - * wireless, and schedules the speed sample + notification for a short delay later. + * Determines wired vs wireless and schedules the speed sample + notification for a short delay + * later. (The old "healthy charge" flag — plugged in at low battery — was retired in #114: + * starting low isn't a virtue under modern 20-80% guidance, so the titles no longer flip on it.) * * @param context The application context * @param pluggedState The type of charger plugged in * @param percentage Current battery percentage */ private void handleChargerConnected(final Context context, final int pluggedState, final int percentage) { - // Determine if this is a "healthy" charge (starting at low battery level) - final boolean isHealthyCharge = percentage <= HEALTHY_CHARGE_THRESHOLD; - NotificationService.setIsHealthy(isHealthyCharge); - final boolean wireless = pluggedState == BatteryManager.BATTERY_PLUGGED_WIRELESS; final Context appContext = context.getApplicationContext(); @@ -125,11 +117,10 @@ private void handleChargerConnected(final Context context, final int pluggedStat return; } final ChargeSpeed speed = SystemService.getChargeSpeed(appContext); - NotificationService.notifyChargeConnected(appContext, speed, wireless, isHealthyCharge); + NotificationService.notifyChargeConnected(appContext, speed, wireless); }); - Log.i(TAG, String.format("Charger connected (Battery: %d%%, Wireless: %s, Healthy: %s)", - percentage, wireless, isHealthyCharge)); + Log.i(TAG, String.format("Charger connected (Battery: %d%%, Wireless: %s)", percentage, wireless)); } /** diff --git a/app/src/main/java/com/almothafar/simplebatterynotifier/service/BatteryHealthTracker.java b/app/src/main/java/com/almothafar/simplebatterynotifier/service/BatteryHealthTracker.java index f855fa8..a5709d8 100644 --- a/app/src/main/java/com/almothafar/simplebatterynotifier/service/BatteryHealthTracker.java +++ b/app/src/main/java/com/almothafar/simplebatterynotifier/service/BatteryHealthTracker.java @@ -194,6 +194,26 @@ public static int getEffectiveCycleCount(final Context context) { return base + getDebugChargeCycles(context); } + /** + * Whether the effective cycle count comes from the OS ({@code EXTRA_CYCLE_COUNT}, Android 14+) + * rather than this app's own tracking. + *

+ * The distinction matters for honesty (#114): the OS count covers the battery's whole life, while + * the app-tracked estimate only counts charge delivered since the app was installed — on an older + * phone it starts at zero and therefore understates real wear. The insights screen labels the + * health basis differently for the two sources. + * + * @param context Application context + * + * @return true when the OS reports a cycle count for this device + */ + public static boolean isCycleCountFromOs(final Context context) { + if (isNull(context)) { + return false; + } + return SystemService.getChargeCycleCount(context) > 0; + } + /** * Gets the number of debug-injected charge cycles (0 in normal use). Tracked separately from real * cycles so {@link #resetDebugData} can clear them without touching genuine tracking. diff --git a/app/src/main/java/com/almothafar/simplebatterynotifier/service/NotificationService.java b/app/src/main/java/com/almothafar/simplebatterynotifier/service/NotificationService.java index 8f3e3b1..70902ce 100644 --- a/app/src/main/java/com/almothafar/simplebatterynotifier/service/NotificationService.java +++ b/app/src/main/java/com/almothafar/simplebatterynotifier/service/NotificationService.java @@ -115,9 +115,6 @@ public final class NotificationService { */ private static WeakReference cachedLauncherIcon; - // Thread-safe healthy charge state - private static volatile boolean isHealthyCharge; - private NotificationService() { // Utility class - prevent instantiation } @@ -164,13 +161,12 @@ public static void sendNotification(final Context context, final int type) { *

  • {@link #CHARGE_STYLE_NONE} — nothing at all.
  • * * - * @param context The application context - * @param speed The estimated charging speed (may be {@link ChargeSpeed#unknown()}) - * @param wireless true when charging over a wireless charger, false when wired - * @param isHealthy true when charging started at a low battery level ("healthy" charge) + * @param context The application context + * @param speed The estimated charging speed (may be {@link ChargeSpeed#unknown()}) + * @param wireless true when charging over a wireless charger, false when wired */ public static void notifyChargeConnected(final Context context, final ChargeSpeed speed, - final boolean wireless, final boolean isHealthy) { + final boolean wireless) { final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); final String style = resolveChargeStyle(prefs.getString( context.getString(R.string._pref_key_charge_notification_style), CHARGE_STYLE_TOAST)); @@ -186,7 +182,7 @@ public static void notifyChargeConnected(final Context context, final ChargeSpee return; } - postChargeNotification(context, content, isHealthy); + postChargeNotification(context, content); } /** @@ -277,11 +273,10 @@ private static void showChargeToast(final Context context, final String message) * Plugging in during quiet hours shouldn't ding: shown on the silent channel outside the window * instead of the audible full-battery channel (issue #111). * - * @param context The application context - * @param content The charge message to display - * @param isHealthy true when charging started at a low battery level ("healthy" charge) + * @param context The application context + * @param content The charge message to display */ - private static void postChargeNotification(final Context context, final String content, final boolean isHealthy) { + private static void postChargeNotification(final Context context, final String content) { if (lacksNotificationPermission(context)) { Log.w(TAG, "Missing POST_NOTIFICATIONS permission, notification not sent"); return; @@ -289,15 +284,9 @@ private static void postChargeNotification(final Context context, final String c createNotificationChannels(context); - final String title = isHealthy - ? context.getString(R.string.notification_charge_started_title_healthy) - : context.getString(R.string.notification_charge_started_title_regular); - + final String title = context.getString(R.string.notification_charge_started_title); final String ticker = title.concat(", ").concat(content); - - final int iconRes = isHealthy - ? R.drawable.ic_stat_device_battery_charging_20 - : R.drawable.ic_stat_device_battery_charging_50; + final int iconRes = R.drawable.ic_stat_device_battery_charging_50; final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); final boolean withinWindow = isWithinNotificationWindow(context, prefs); @@ -522,17 +511,6 @@ public static void updateOngoingNotification(final Context context, final Batter } } - /** - * Set healthy charge mode - *

    - * Thread-safe setter for the healthy charge state flag. - * - * @param healthy true if charging in healthy mode - */ - public static void setIsHealthy(final boolean healthy) { - isHealthyCharge = healthy; - } - /** * Shutdown the sound executor service *

    @@ -1120,9 +1098,7 @@ private static class NotificationConfig { this.iconRes = R.drawable.ic_stat_device_battery_charging_full; this.alarmSound = prefs.getString(context.getString(R.string._pref_key_notifications_full_sound_ringtone), defaultSound); this.ticker = context.getString(R.string.notification_full_level_ticker); - this.title = isHealthyCharge - ? context.getString(R.string.notification_full_level_title_healthy) - : context.getString(R.string.notification_full_level_title_regular); + this.title = context.getString(R.string.notification_full_level_title); this.content = context.getString(R.string.notification_full_level_content); this.bigContent = context.getString(R.string.notification_full_level_content_big); } diff --git a/app/src/main/java/com/almothafar/simplebatterynotifier/ui/BatteryInsightsActivity.java b/app/src/main/java/com/almothafar/simplebatterynotifier/ui/BatteryInsightsActivity.java index 3c8b51f..6eab747 100644 --- a/app/src/main/java/com/almothafar/simplebatterynotifier/ui/BatteryInsightsActivity.java +++ b/app/src/main/java/com/almothafar/simplebatterynotifier/ui/BatteryInsightsActivity.java @@ -133,8 +133,15 @@ private void showResolvedHealth() { healthStatusText.setText(BatteryHealthTracker.labelResId(grade)); healthStatusText.setTextColor(getHealthColor(grade)); - // Tell the user whether the figure is measured (honest) or a cycle-based estimate - healthBasisText.setText(measured ? R.string.health_basis_measured : R.string.health_basis_estimated); + // Tell the user what the figure is based on. The cycle-based estimate distinguishes OS-reported + // cycles (whole battery life) from cycles this app tracked since install, which understate real + // wear on a phone older than the app (#114). + final int basisRes = measured + ? R.string.health_basis_measured + : BatteryHealthTracker.isCycleCountFromOs(this) + ? R.string.health_basis_estimated_os + : R.string.health_basis_estimated_tracked; + healthBasisText.setText(basisRes); healthDescriptionText.setText(BatteryHealthTracker.describeHealthGrade(this, grade)); } diff --git a/app/src/main/res/layout/activity_battery_insights.xml b/app/src/main/res/layout/activity_battery_insights.xml index 76f50dc..ecfc1cc 100644 --- a/app/src/main/res/layout/activity_battery_insights.xml +++ b/app/src/main/res/layout/activity_battery_insights.xml @@ -105,7 +105,7 @@ android:id="@+id/healthBasisText" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:text="@string/health_basis_estimated" + android:text="@string/health_basis_estimated_os" android:textSize="12sp" android:textColor="@color/battery_details_label_color" android:layout_marginTop="4dp"/> diff --git a/app/src/main/res/values-ar/strings.xml b/app/src/main/res/values-ar/strings.xml index 8ac4d31..3a91db9 100644 --- a/app/src/main/res/values-ar/strings.xml +++ b/app/src/main/res/values-ar/strings.xml @@ -2,11 +2,6 @@ منبه البطارية البسيط الإعدادات الإعدادات - الشاحن موصول - AC charger connected - USB charger connected - Wireless charger connected - Charger Disconnected تشحن تستهلك لا تشحن @@ -97,23 +92,21 @@ البطارية المنخفضة جداً تنبّهك حتى أثناء ساعات الهدوء التنبيهات الحرجة تبقى صامتة أثناء ساعات الهدوء - مستوى حرج للبطارية أقل من %1$d%% - وقت الشحن الصحي - البطارية على وشك النفاذ (%1$d%%) - البطارية في مستوى حرج وأقل من (%1$d%%)، حان الوقت لشحن الهاتف - البطارية في منتصف الطريق، أقل من %1$d%% - اقتصد في الاستخدام - تحتاج فقط للانتباه للبطارية (%1$d%%) - مستوى البطارية %1$d%%. لا تحتاج للشاحن بعد، لكن انتبه لاستهلاك البطارية - البطارية تم شحنها بالكامل، بإمكانك فصل الشاحن - الشحن الصحي اكتمل - الشحن الاعتيادي اكتمل - استخدم هاتفك بحرية الآن - بإمكانك استخدام الهاتف الآن، ولا يضر إن أبقيت الشاحن، لا تخف لن تصاب البطارية بالتخمة 😋 + + البطارية منخفضة جداً — أقل من %1$d%% + البطارية منخفضة جداً + البطارية على وشك النفاد (%1$d%%) + مستوى البطارية أقل من المستوى الحرج (%1$d%%) — حان وقت الشحن. + البطارية أقل من %1$d%% + البطارية بدأت تنخفض + البطارية عند %1$d%% — انتبه لاستهلاكك + مستوى البطارية %1$d%%. لا حاجة للشحن الآن — لكن حين يتيسّر لك، الشحن قبل أن تنخفض البطارية كثيراً أرفق بها. + اكتمل شحن البطارية — يمكنك فصل الشاحن الآن + اكتمل شحن البطارية + يمكنك فصل الشاحن الآن + اكتمل الشحن — يمكنك فصل الشاحن الآن. تتقادم البطاريات أسرع ما يكون عند إبقائها على 100%، لذا فصل الشاحن قريباً (والبقاء تقريباً بين 20% و80% في الاستخدام اليومي) يساعد بطاريتك على أن تدوم أطول. - شحن صحي بدأ - شحن اعتيادي بدأ - البطارية تشحن بواسطة %1$s + بدأ الشحن سلكي @@ -203,13 +196,15 @@ مسح أدخل سعة بين %1$d و %2$d mAh مقاسة من السعة المقدّرة - مقدّرة من دورات الشحن + + مقدّرة من دورات الشحن (كما يبلغ عنها أندرويد) + مقدّرة من الدورات المتتبَّعة منذ التثبيت — التآكل الفعلي قد يكون أعلى لماذا قد تكون قراءة البطارية غير موثوقة قد تكون قراءة البطارية غير موثوقة يُبلّغ هذا الجهاز عن سعة شحن كاملة لا تُطابق السعة المقدّرة التي أدخلتها، لذا لا يمكن الوثوق بالسعة المقاسة — ولا بنسبة الصحة المبنية عليها.\n\nغالباً ما يكون هذا خللاً في عتاد بطارية الهاتف (إذ تُبلّغ بعض المعالجات عن عدّاد الشحن بصورة غير صحيحة)، وليس مشكلة في بطاريتك.\n\nلكن قد يعني ذلك أيضاً أنّ البطارية بدأت تتلف فعلاً. انتبه لهذه العلامات:\n\n• ينطفئ الهاتف أو يُعيد التشغيل تحت الحِمل الثقيل رغم وجود شحن كافٍ\n• ينخفض المستوى فجأة قرب النهاية، فيسلك مستوى 20% وكأنه 2%\n• ينفد الشحن أسرع بكثير من ذي قبل\n\nإذا لاحظت هذه العلامات، ففكّر في استبدال البطارية. كيف يعمل - تُقدَّر صحة البطارية بناءً على دورات الشحن. تُحتسب دورة شحن عندما تُشحن بطاريتك من 20% أو أقل إلى 95% أو أكثر. يبدأ هذا التتبع عند أول استخدام لهذا التطبيق.\n\nتقديرات الصحة:\n• 0–300 دورة: ممتازة (95–100%)\n• 300-500 دورة: جيدة (85-95%)\n• 500-800 دورة: مقبولة (70-85%)\n• 800+ دورة: ضعيفة (<70%) + تُعرض صحة البطارية من أفضل أساس متاح:\n\n• مقاسة — عند إدخال السعة المقدّرة لبطاريتك، تكون الصحة هي السعة الكاملة المقاسة مقسومة على السعة المقدّرة. الأساس الأدق.\n• دورات الشحن (كما يبلغ عنها أندرويد) — بعض الأجهزة تبلغ عن عدد دورات البطارية طوال عمرها؛ عندها تُقدَّر الصحة من منحنى تآكل نموذجي لبطاريات الليثيوم.\n• دورات الشحن (المتتبَّعة بواسطة هذا التطبيق) — خلاف ذلك تُحتسب الدورات من الشحن الموصول منذ تثبيت التطبيق (100 نقطة مئوية = دورة واحدة)، لذا على هاتف أقدم من التطبيق تُقلِّل من التآكل الفعلي.\n\nتستخدم التقديرات المبنية على الدورات منحنى عاماً — العمر الفعلي للدورات يختلف حسب المصنّع والخلية، سواء كانت التسمية Li-ion أو Li-Po:\n• 0–300 دورة: ممتازة (95–100%)\n• 300–500 دورة: جيدة (85–95%)\n• 500–800 دورة: مقبولة (70–85%)\n• 800+ دورة: ضعيفة (<70%)\n\nنصيحة: تدوم بطاريات الليثيوم أطول عند إبقائها تقريباً بين 20% و80% وبعيداً عن الحرارة — الشحن المعتاد إلى 100% والتفريغ العميق كلاهما يزيد التآكل. طوّره المظفّر الحسن diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 9929cb2..519a980 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -2,11 +2,6 @@ Simple Battery Notifier Settings Settings - Charger connected - AC charger connected - USB charger connected - Wireless charger connected - Charger Disconnected Charging Discharging Not Charging @@ -101,23 +96,22 @@ A critically low battery still alerts during quiet hours Critical alerts stay silent during quiet hours - Your battery in critical level and below %1$d%% - Healthy charge time - Battery almost run out of power (%1$d%%) - Your battery level is below critical level (%1$d%%), its time to connect your charger - Your battery in midway and below %1$d%% - Watch your usage - You just need to watch your usage (%1$d%%) - Battery level is at %1$d%%. You just need to watch your usage for your smartphone, but still no need for charger now - Your battery fully charged, you can disconnect your charger - Healthy charge completed - Regular charge completed - You can use your phone - You can use your phone, you may disconnect your charger, or keep it and don\'t worry the battery will not get indigestion 😋 + + Battery critically low — below %1$d%% + Battery critically low + Battery almost empty (%1$d%%) + Your battery is below the critical level (%1$d%%) — time to plug in. + Battery below %1$d%% + Battery getting low + Battery at %1$d%% — keep an eye on your usage + Battery level is at %1$d%%. No need to charge yet — but when it\'s convenient, plugging in before the battery runs very low is easiest on it. + Battery fully charged — you can unplug now + Battery fully charged + You can unplug your charger now + Charge complete — you can unplug now. Batteries age fastest when kept at 100%, so unplugging soon (and staying roughly between 20% and 80% day to day) helps the battery last longer. - Healthy charging started - Regular charging started - Battery charging with %1$s + Charging started @@ -212,7 +206,10 @@ Clear Enter a capacity between %1$d and %2$d mAh Measured from rated capacity - Estimated from charge cycles + + Estimated from charge cycles (reported by Android) + Estimated from cycles tracked since install — real wear may be higher @@ -230,7 +227,7 @@ Your battery shows moderate wear. You may notice slightly reduced battery life. Your battery has significant wear. Consider battery replacement if experiencing poor performance. How It Works - Battery health is estimated based on charge cycles. A charge cycle counts when your battery charges from 20% or below to 95% or above. This tracking starts when you first use this app.\n\nHealth estimates:\n• 0–300 cycles: Excellent (95–100%)\n• 300-500 cycles: Good (85-95%)\n• 500-800 cycles: Fair (70-85%)\n• 800+ cycles: Poor (<70%) + Battery health is shown from the best available basis:\n\n• Measured — when you set your battery\'s rated capacity, health is the measured full capacity divided by the rated capacity. The most accurate basis.\n• Charge cycles (reported by Android) — some devices report the battery\'s lifetime cycle count; health is then estimated from a typical lithium-ion wear curve.\n• Charge cycles (tracked by this app) — otherwise, cycles are counted from the charge delivered since the app was installed (100 percentage-points = 1 cycle), so on a phone older than the app it understates real wear.\n\nCycle-based estimates use a generic curve — real cycle life varies by manufacturer and cell, whether the label says Li-ion or Li-Po:\n• 0–300 cycles: Excellent (95–100%)\n• 300–500 cycles: Good (85–95%)\n• 500–800 cycles: Fair (70–85%)\n• 800+ cycles: Poor (<70%)\n\nTip: lithium batteries last longest kept roughly between 20% and 80% and away from heat — habitually charging to 100% and deep discharges both add wear. Developed by Al-Mothafar Al-Hasan github.com/almothafar diff --git a/app/src/test/java/com/almothafar/simplebatterynotifier/receiver/PowerConnectionReceiverTest.java b/app/src/test/java/com/almothafar/simplebatterynotifier/receiver/PowerConnectionReceiverTest.java index 63f1bd7..5cb2246 100644 --- a/app/src/test/java/com/almothafar/simplebatterynotifier/receiver/PowerConnectionReceiverTest.java +++ b/app/src/test/java/com/almothafar/simplebatterynotifier/receiver/PowerConnectionReceiverTest.java @@ -27,8 +27,8 @@ import static org.robolectric.Shadows.shadowOf; /** - * Robolectric + Mockito tests for {@link PowerConnectionReceiver}: wired/wireless detection, the - * healthy-charge flag, plugged-state de-duplication, and the disconnect cleanup path. The + * Robolectric + Mockito tests for {@link PowerConnectionReceiver}: wired/wireless detection, + * plugged-state de-duplication, and the disconnect cleanup path. The * {@link NotificationService} static methods are mocked so we can assert what the receiver decides * to do from the sticky {@code ACTION_BATTERY_CHANGED} intent. *

    @@ -59,8 +59,7 @@ public void connectedWired_notifiesWiredCharging() { receive(); runPendingSample(); ns.verify(() -> NotificationService.notifyChargeConnected(any(Context.class), - any(ChargeSpeed.class), eq(false), eq(false))); - ns.verify(() -> NotificationService.setIsHealthy(false)); + any(ChargeSpeed.class), eq(false))); } } @@ -72,20 +71,19 @@ public void connectedWireless_notifiesWirelessCharging() { receive(); runPendingSample(); ns.verify(() -> NotificationService.notifyChargeConnected(any(Context.class), - any(ChargeSpeed.class), eq(true), eq(false))); + any(ChargeSpeed.class), eq(true))); } } @Test - public void connectedAtLowBattery_marksChargeHealthy() { + public void connectedAtLowBattery_notifiesLikeAnyOtherLevel() { publishBattery(BatteryManager.BATTERY_PLUGGED_USB, 10, 100); try (MockedStatic ns = mockStatic(NotificationService.class)) { receive(); runPendingSample(); - ns.verify(() -> NotificationService.setIsHealthy(true)); ns.verify(() -> NotificationService.notifyChargeConnected(any(Context.class), - any(ChargeSpeed.class), eq(false), eq(true))); + any(ChargeSpeed.class), eq(false))); } } @@ -98,7 +96,7 @@ public void samePluggedState_sendsNoNotification() { receive(); runPendingSample(); ns.verify(() -> NotificationService.notifyChargeConnected(any(Context.class), - any(ChargeSpeed.class), anyBoolean(), anyBoolean()), never()); + any(ChargeSpeed.class), anyBoolean()), never()); } } @@ -112,7 +110,7 @@ public void disconnected_clearsNotifications() { runPendingSample(); ns.verify(() -> NotificationService.clearNotifications(any(Context.class))); ns.verify(() -> NotificationService.notifyChargeConnected(any(Context.class), - any(ChargeSpeed.class), anyBoolean(), anyBoolean()), never()); + any(ChargeSpeed.class), anyBoolean()), never()); } }