Revert "Add EBS interface to BatteryController"

Revert "Add Extreme Battery Saver behavior"

Revert submission 12248919-153940148

Reason for revert: b/162539418
Reverted Changes:
Ie6abbbb45:Add EBS interface to BatteryController
I60bd64e26:Add Extreme Battery Saver behavior

Bug: 162539418
Change-Id: If264b97788d57d97683cd11ad5607cbdebab118e
This commit is contained in:
Zhuoyao Zhang
2020-07-31 17:49:26 +00:00
parent 6ae0640c32
commit ddca494f4f
5 changed files with 3 additions and 49 deletions

View File

@@ -130,7 +130,6 @@ public class BatterySaverTile extends QSTileImpl<BooleanState> implements
: mPowerSave ? Tile.STATE_ACTIVE : Tile.STATE_INACTIVE;
state.icon = mIcon;
state.label = mContext.getString(R.string.battery_detail_switch_title);
state.secondaryLabel = "";
state.contentDescription = state.label;
state.value = mPowerSave;
state.expandedAccessibilityClassName = Switch.class.getName();

View File

@@ -1,24 +0,0 @@
/*
* Copyright (C) 2020 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.systemui.settings
import android.content.ContentResolver
interface CurrentUserContentResolverProvider {
val currentUserContentResolver: ContentResolver
}

View File

@@ -16,7 +16,6 @@
package com.android.systemui.settings
import android.content.ContentResolver
import android.content.Context
import android.os.UserHandle
import androidx.annotation.VisibleForTesting
@@ -32,7 +31,7 @@ import java.lang.IllegalStateException
class CurrentUserContextTracker internal constructor(
private val sysuiContext: Context,
broadcastDispatcher: BroadcastDispatcher
) : CurrentUserContentResolverProvider {
) {
private val userTracker: CurrentUserTracker
private var initialized = false
@@ -45,9 +44,6 @@ class CurrentUserContextTracker internal constructor(
return _curUserContext!!
}
override val currentUserContentResolver: ContentResolver
get() = currentUserContext.contentResolver
init {
userTracker = object : CurrentUserTracker(broadcastDispatcher) {
override fun onUserSwitched(newUserId: Int) {
@@ -58,8 +54,8 @@ class CurrentUserContextTracker internal constructor(
fun initialize() {
initialized = true
userTracker.startTracking()
_curUserContext = makeUserContext(userTracker.currentUserId)
userTracker.startTracking()
}
@VisibleForTesting

View File

@@ -19,12 +19,10 @@ package com.android.systemui.settings.dagger;
import android.content.Context;
import com.android.systemui.broadcast.BroadcastDispatcher;
import com.android.systemui.settings.CurrentUserContentResolverProvider;
import com.android.systemui.settings.CurrentUserContextTracker;
import javax.inject.Singleton;
import dagger.Binds;
import dagger.Module;
import dagger.Provides;
@@ -32,7 +30,7 @@ import dagger.Provides;
* Dagger Module for classes found within the com.android.systemui.settings package.
*/
@Module
public abstract class SettingsModule {
public interface SettingsModule {
/**
* Provides and initializes a CurrentUserContextTracker
@@ -47,9 +45,4 @@ public abstract class SettingsModule {
tracker.initialize();
return tracker;
}
@Binds
@Singleton
abstract CurrentUserContentResolverProvider bindCurrentUserContentResolverTracker(
CurrentUserContextTracker tracker);
}

View File

@@ -78,13 +78,6 @@ public interface BatteryController extends DemoMode, Dumpable,
*/
default void setReverseState(boolean isReverse) {}
/**
* Returns {@code true} if extreme battery saver is on.
*/
default boolean isExtremeSaverOn() {
return false;
}
/**
* A listener that will be notified whenever a change in battery level or power save mode has
* occurred.
@@ -99,9 +92,6 @@ public interface BatteryController extends DemoMode, Dumpable,
default void onReverseChanged(boolean isReverse, int level, String name) {
}
default void onExtremeBatterySaverChanged(boolean isExtreme) {
}
}
/**