Add deep sleep preference controller [2/2]

Change-Id: If270186b7788d95bfb4f555c0bc6f7eb3367e95f
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
This commit is contained in:
Pranav Vashi
2021-02-10 09:35:48 +05:30
committed by Joey
parent cd266c38ea
commit 10ca41a9f6
4 changed files with 48 additions and 0 deletions

View File

@@ -16,4 +16,7 @@
<!-- Screenshot shutter -->
<string name="screenshot_shutter_sound_title">Screenshot sound</string>
<!-- Deep Sleep percentage in device info -->
<string name="status_sleep_time">Deep sleep</string>
</resources>

View File

@@ -195,6 +195,14 @@
android:summary="@string/summary_placeholder"
android:selectable="false"/>
<!-- Device deep sleep time -->
<Preference
android:key="sleep_time"
android:order="49"
android:title="@string/status_sleep_time"
android:summary="@string/summary_placeholder"
android:selectable="false"/>
<!-- Manual -->
<Preference
android:key="manual"

View File

@@ -0,0 +1,35 @@
/*
* Copyright (C) 2021-2023 crDroid Android 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.deviceinfo;
import android.content.Context;
import com.android.settings.core.PreferenceControllerMixin;
import com.android.settingslib.core.lifecycle.Lifecycle;
import com.android.settingslib.deviceinfo.AbstractSleeptimePreferenceController;
/**
* Concrete subclass of uptime preference controller
*/
public class SleeptimePreferenceController extends AbstractSleeptimePreferenceController
implements PreferenceControllerMixin {
public SleeptimePreferenceController(Context context, Lifecycle lifecycle) {
super(context, lifecycle);
}
// This space intentionally left blank
}

View File

@@ -40,6 +40,7 @@ import com.android.settings.deviceinfo.IpAddressPreferenceController;
import com.android.settings.deviceinfo.ManualPreferenceController;
import com.android.settings.deviceinfo.RegulatoryInfoPreferenceController;
import com.android.settings.deviceinfo.SafetyInfoPreferenceController;
import com.android.settings.deviceinfo.SleeptimePreferenceController;
import com.android.settings.deviceinfo.UptimePreferenceController;
import com.android.settings.deviceinfo.WifiMacAddressPreferenceController;
import com.android.settings.deviceinfo.imei.ImeiInfoPreferenceController;
@@ -127,6 +128,7 @@ public class MyDeviceInfoFragment extends DashboardFragment
controllers.add(new ManualPreferenceController(context));
controllers.add(new FeedbackPreferenceController(fragment, context));
controllers.add(new FccEquipmentIdPreferenceController(context));
controllers.add(new SleeptimePreferenceController(context, lifecycle));
controllers.add(new UptimePreferenceController(context, lifecycle));
Consumer<String> imeiInfoList = imeiKey -> {