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

Commit 55414293 authored by wangmingming1's avatar wangmingming1 Committed by Philip P. Moltmann
Browse files

don't block adb while running uninstall



Test: Manual
      1. setup a work profile
      2. set a uninstall restriction on foo app for the work profile
         by calling set DevicePolicyManager.setUninstallBlocked()
      3. observe adb uninstallation can return with 'DELETE_FAILED_OWNER_BLOCKED'
         message without blocking forever by using the following command line:
         `adb uninstall --user user-id-of-work-profile com.foo`
Test: Manual
      1. install lots of apks via adb
      2. uninstall apks via adb

Change-Id: If89978c5a79ef998bde55c254ced4b6a3ff6e645
Signed-off-by: default avatarwangmingming1 <wangmingming1@xiaomi.com>
parent 8fabc163
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -93,6 +93,7 @@ import java.io.IOException;
import java.io.PrintWriter;
import java.net.URISyntaxException;
import java.util.*;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.SynchronousQueue;
import java.util.concurrent.TimeUnit;

@@ -2786,7 +2787,7 @@ class PackageManagerShellCommand extends ShellCommand {
    }

    private static class LocalIntentReceiver {
        private final SynchronousQueue<Intent> mResult = new SynchronousQueue<>();
        private final LinkedBlockingQueue<Intent> mResult = new LinkedBlockingQueue<>();

        private IIntentSender.Stub mLocalSender = new IIntentSender.Stub() {
            @Override