Port "Battery Usage Alerts" feature from factory images

thanks @daveyannihilation for suggestions about how to check prebuilt apk

NB: this needs the new Turbo.apk in your vendor blobs:
1305ba501e
Signed-off-by: mydongistiny <jaysonedson@gmail.com>

Change-Id: I51d0213242ad87bfcfecd71c97e3cbb3ff6fd158
Signed-off-by: mydongistiny <jaysonedson@gmail.com>
Signed-off-by: DennySPB <dennyspb@gmail.com>
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
This commit is contained in:
ezio84
2017-08-23 18:32:56 +02:00
committed by Joey
parent f7bbe61757
commit c53126396f

View File

@@ -44,6 +44,8 @@ import java.util.Set;
/** Implementation of {@code PowerUsageFeatureProvider} */
public class PowerUsageFeatureProviderImpl implements PowerUsageFeatureProvider {
private static final String ADDITIONAL_BATTERY_INFO_ACTION = "com.google.android.apps.turbo.SHOW_ADDITIONAL_BATTERY_INFO";
private static final String ADDITIONAL_BATTERY_INFO_PACKAGE = "com.google.android.apps.turbo";
private static final String PACKAGE_CALENDAR_PROVIDER = "com.android.providers.calendar";
private static final String PACKAGE_MEDIA_PROVIDER = "com.android.providers.media";
private static final String[] PACKAGES_SYSTEM = {
@@ -130,7 +132,8 @@ public class PowerUsageFeatureProviderImpl implements PowerUsageFeatureProvider
@Override
public Intent getAdditionalBatteryInfoIntent() {
return null;
Intent intent = new Intent(ADDITIONAL_BATTERY_INFO_ACTION);
return intent.setPackage(ADDITIONAL_BATTERY_INFO_PACKAGE);
}
@Override