Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b55a4952 authored by Luofan Chen's avatar Luofan Chen Committed by Luca Stefani
Browse files

ChargingControl: Add cancel toggle for limit done notification

Change-Id: I4f969ae87e1f9aa264113f044ee850def33ad20f
parent 31291fee
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -828,6 +828,15 @@ public class ChargingControlController extends LineageHealthFeature {
                    .setSmallIcon(R.drawable.ic_charging_control)
                    .setOngoing(false);

            if (targetTime == null) {
                Intent cancelOnceIntent = new Intent(ACTION_CHARGING_CONTROL_CANCEL_ONCE);
                PendingIntent cancelPendingIntent = PendingIntent.getBroadcast(mContext, 0,
                        cancelOnceIntent, PendingIntent.FLAG_IMMUTABLE);
                notification.addAction(R.drawable.ic_charging_control,
                        mContext.getString(R.string.charging_control_notification_cancel_once),
                        cancelPendingIntent);
            }

            createNotificationChannelIfNeeded();
            mNotificationManager.notify(CHARGING_CONTROL_NOTIFICATION_ID, notification.build());
        }