--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2018 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.
+ -->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="24dp"
+ android:height="24dp"
+ android:viewportWidth="24"
+ android:viewportHeight="24">
+
+ <path
+ android:fillColor="#000000"
+ android:pathData="M17,1.01L7,1C5.9,1,5,1.9,5,3v18c0,1.1,0.9,2,2,2h10c1.1,0,2-0.9,2-2V3C19,1.9,18.1,1.01,17,1.01z M17,21H7l0-1h10V21z M17,18H7V6h10V18z M17,4H7V3h10V4z" />
+ <path
+ android:fillColor="#000000"
+ android:pathData="M 8 10 H 16 V 11.5 H 8 V 10 Z" />
+ <path
+ android:fillColor="#000000"
+ android:pathData="M 9 13 H 15 V 14.5 H 9 V 13 Z" />
+ <path
+ android:pathData="M 0 0 H 24 V 24 H 0 V 0 Z" />
+</vector>
\ No newline at end of file
import com.android.internal.os.BatterySipper;
import com.android.internal.os.BatterySipper.DrainType;
+import com.android.settings.R;
import org.junit.Before;
import org.junit.Rule;
import org.mockito.junit.MockitoJUnit;
import org.mockito.junit.MockitoRule;
import org.robolectric.RobolectricTestRunner;
+import org.robolectric.RuntimeEnvironment;
import java.util.Locale;
}
@Test
+ public void batteryEntryForAOD_containCorrectInfo() {
+ final BatterySipper batterySipper = mock(BatterySipper.class);
+ batterySipper.drainType = DrainType.AMBIENT_DISPLAY;
+ final BatteryEntry entry = new BatteryEntry(RuntimeEnvironment.application, mockHandler,
+ mockUserManager, batterySipper);
+
+ assertThat(entry.iconId).isEqualTo(R.drawable.ic_settings_aod);
+ assertThat(entry.name).isEqualTo("Ambient display");
+ }
+
+ @Test
public void extractPackageFromSipper_systemSipper_returnSystemPackage() {
BatteryEntry entry = createBatteryEntryForSystem();