Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0b174a94 authored by Wesley.CW Wang's avatar Wesley.CW Wang Committed by Wesley Wang
Browse files

Add uId into AppInfo page launch variable

 - Insert uid as launch variable, make AppInfo page can receive uId to
 query battery usage data

Bug: 178197718
Test: manual test,
 - Long click any work profile app from launcher -> app info -> launches fine
 - Long click any app from launcher -> app info -> launches fine
Change-Id: I99941c04ab4ba7d98925e999e12929d11e379bcd
parent b04a005c
Loading
Loading
Loading
Loading
+8 −0
Original line number Original line Diff line number Diff line
@@ -1207,8 +1207,16 @@ public class LauncherAppsService extends SystemService {
            final long ident = Binder.clearCallingIdentity();
            final long ident = Binder.clearCallingIdentity();
            try {
            try {
                String packageName = component.getPackageName();
                String packageName = component.getPackageName();
                int uId = -1;
                try {
                    uId = mContext.getPackageManager().getApplicationInfo(
                            packageName, PackageManager.MATCH_ANY_USER).uid;
                } catch (PackageManager.NameNotFoundException e) {
                    Log.d(TAG, "package not found: " + e);
                }
                intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS,
                intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS,
                        Uri.fromParts("package", packageName, null));
                        Uri.fromParts("package", packageName, null));
                intent.putExtra("uId", uId);
                intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
                intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
                intent.setSourceBounds(sourceBounds);
                intent.setSourceBounds(sourceBounds);
            } finally {
            } finally {