- WarningFramePreference & warning_frame_preference.xml is a battery customized layout which looks like a standard Preference layout with an optional app icon & warning chip. - PowerGaugePreference extends the WarningFramePreference to display the app Preference with optional warning chip in Battery > Battery Usage. - PowerUsageTimePreference extends the WarningFramePreference to display the usage time with optional warning chip in Battery > Battery Usage > App battery usage. Bug: 349652542 Test: atest BatteryUsageBreakdownControllerTest PowerGaugePreferenceTest PowerUsageTimeControllerTest Flag: com.android.settingslib.widget.theme.flags.is_expressive_design_enabled Change-Id: I5d22703ccc487c54a2bbbc1d9737b92a2de54ba5
34 lines
1.2 KiB
Java
34 lines
1.2 KiB
Java
/*
|
|
* Copyright (C) 2023 The Android Open Source Project
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/
|
|
|
|
package com.android.settings.fuelgauge;
|
|
|
|
import android.content.Context;
|
|
import android.util.AttributeSet;
|
|
|
|
import com.android.settingslib.widget.GroupSectionDividerMixin;
|
|
|
|
/** Custom preference for displaying the app power usage time. */
|
|
public class PowerUsageTimePreference extends WarningFramePreference implements
|
|
GroupSectionDividerMixin {
|
|
private static final String TAG = "PowerUsageTimePreference";
|
|
|
|
public PowerUsageTimePreference(Context context, AttributeSet attrs) {
|
|
super(context, attrs);
|
|
setSelectable(false);
|
|
}
|
|
}
|