Fix app battery usage list launch incorrect works app

- App usage page only use package name to launch the page, it can not
   identify the different userId between normal app and work profile
   app, add extra userId info into launch args
 - Remove no battery usage state/string if usage time is empty

Bug: 251471047
Test: make SettingsRoboTests
Change-Id: Id06ebb0f0fcd863e423acd7839f89bc0ae2444c1
This commit is contained in:
Wesley Wang
2022-10-28 18:25:21 +08:00
parent dba9928a7e
commit eda172ce2c
4 changed files with 13 additions and 12 deletions

View File

@@ -686,7 +686,8 @@ public class ManageApplications extends InstrumentedFragment
break;
case LIST_TYPE_BATTERY_OPTIMIZATION:
AdvancedPowerUsageDetail.startBatteryDetailPage(
getActivity(), this, mCurrentPkgName);
getActivity(), this, mCurrentPkgName,
UserHandle.getUserHandleForUid(mCurrentUid));
break;
// TODO: Figure out if there is a way where we can spin up the profile's settings
// process ahead of time, to avoid a long load of data when user clicks on a managed