Fix shell command 'list staged-sessions'
After applying visibility to get session info APIs, ROOT_UID should
still be able to list staged-sessions via adb shell.
Bug: 204141763
Test: manually test 'pm list staged-sessions' via adb shell with and
without root to verify if the result is the same.
Change-Id: I09a8a146be82deba10d3b11deea7a0b344a36c56
This commit is contained in:
@@ -8914,7 +8914,8 @@ public class PackageManagerService extends IPackageManager.Stub
|
||||
* return {@code true} if any one application belongs to the shared user ID meets the criteria.
|
||||
*/
|
||||
boolean canQueryPackage(int callingUid, @Nullable String targetPackageName) {
|
||||
if (targetPackageName == null) {
|
||||
// Since getSettingLPr returns null for ROOT_UID, add an extra check for it here.
|
||||
if (callingUid == Process.ROOT_UID || targetPackageName == null) {
|
||||
return true;
|
||||
}
|
||||
synchronized (mLock) {
|
||||
|
||||
Reference in New Issue
Block a user