Add new battery entry into AppInfo page launch variable
- Insert uid as launch variable - Add new launch type into AppInfo page Bug: 178197718 Test: make RunSettingsRoboTests Change-Id: I8c68bebd02491dbbc1516bbebc14254ed06940f6
This commit is contained in:
@@ -111,6 +111,7 @@ public class AppInfoDashboardFragment extends DashboardFragment
|
||||
private PackageInfo mPackageInfo;
|
||||
private int mUserId;
|
||||
private String mPackageName;
|
||||
private int mUid;
|
||||
|
||||
private DevicePolicyManager mDpm;
|
||||
private UserManager mUserManager;
|
||||
@@ -297,7 +298,8 @@ public class AppInfoDashboardFragment extends DashboardFragment
|
||||
(SettingsActivity) getActivity(), this, lifecycle, packageName, mState,
|
||||
REQUEST_UNINSTALL, REQUEST_REMOVE_DEVICE_ADMIN);
|
||||
controllers.add(mAppButtonsPreferenceController);
|
||||
controllers.add(new AppBatteryPreferenceController(context, this, packageName, lifecycle));
|
||||
controllers.add(new AppBatteryPreferenceController(
|
||||
context, this, packageName, getUid(), lifecycle));
|
||||
controllers.add(new AppMemoryPreferenceController(context, this, lifecycle));
|
||||
controllers.add(new DefaultHomeShortcutPreferenceController(context, packageName));
|
||||
controllers.add(new DefaultBrowserShortcutPreferenceController(context, packageName));
|
||||
@@ -568,7 +570,7 @@ public class AppInfoDashboardFragment extends DashboardFragment
|
||||
final Bundle args = getArguments();
|
||||
mPackageName = (args != null) ? args.getString(ARG_PACKAGE_NAME) : null;
|
||||
if (mPackageName == null) {
|
||||
final Intent intent = (args == null) ?
|
||||
final Intent intent = args == null ?
|
||||
getActivity().getIntent() : (Intent) args.getParcelable("intent");
|
||||
if (intent != null) {
|
||||
mPackageName = intent.getData().getSchemeSpecificPart();
|
||||
@@ -577,6 +579,22 @@ public class AppInfoDashboardFragment extends DashboardFragment
|
||||
return mPackageName;
|
||||
}
|
||||
|
||||
private int getUid() {
|
||||
if (mUid > 0) {
|
||||
return mUid;
|
||||
}
|
||||
final Bundle args = getArguments();
|
||||
mUid = (args != null) ? args.getInt(ARG_PACKAGE_UID) : -1;
|
||||
if (mUid <= 0) {
|
||||
final Intent intent = args == null
|
||||
? getActivity().getIntent() : (Intent) args.getParcelable("intent");
|
||||
if (intent != null && intent.getExtras() != null) {
|
||||
mUid = intent.getIntExtra("uId", -1);
|
||||
}
|
||||
}
|
||||
return mUid;
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
void retrieveAppEntry() {
|
||||
final Activity activity = getActivity();
|
||||
|
Reference in New Issue
Block a user