Use current user isntead of system user if no --user parameter is passed

This is relevant when running cts tests in instant mode.
Certain tests were failing in non-system users in instant mode, which is particularlly consquential to auto.
THis fix will be cherry-picked back to their repo
Test: CTSAccessibility*, in both instant/non-instant, and with both system and secondary users.
Bug:146218533

Change-Id: I89937bd552d372adc5d96c51b24d1a2bb4a034e3
This commit is contained in:
Qasid Ahmad Sadiq
2020-04-08 01:51:05 -07:00
parent 645fdff012
commit d0129ce59b

View File

@@ -17,6 +17,7 @@
package com.android.server.accessibility;
import android.annotation.NonNull;
import android.app.ActivityManager;
import android.os.ShellCommand;
import android.os.UserHandle;
@@ -83,7 +84,7 @@ final class AccessibilityShellCommand extends ShellCommand {
return null;
}
}
return UserHandle.USER_SYSTEM;
return ActivityManager.getCurrentUser();
}
@Override