parent
45ae52de0c
commit
75436aa90d
|
|
@ -55,6 +55,7 @@ import android.os.SystemProperties;
|
||||||
import android.system.ErrnoException;
|
import android.system.ErrnoException;
|
||||||
import android.system.Os;
|
import android.system.Os;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
import android.view.IWindowManager;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
|
|
@ -651,7 +652,14 @@ public class LSPManagerService extends ILSPManagerService.Stub {
|
||||||
if (currentUser == null) return -1;
|
if (currentUser == null) return -1;
|
||||||
var parent = UserService.getProfileParent(userId);
|
var parent = UserService.getProfileParent(userId);
|
||||||
if (parent < 0) return -1;
|
if (parent < 0) return -1;
|
||||||
if (currentUser.id != parent && !ActivityManagerService.switchUser(parent)) return -1;
|
if (currentUser.id != parent) {
|
||||||
|
if (!ActivityManagerService.switchUser(parent)) return -1;
|
||||||
|
var window = android.os.ServiceManager.getService("window");
|
||||||
|
if (window != null) {
|
||||||
|
var wm = IWindowManager.Stub.asInterface(window);
|
||||||
|
wm.lockNow(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return ActivityManagerService.startActivityAsUserWithFeature("android", null, intent, intent.getType(), null, null, 0, 0, null, null, userId);
|
return ActivityManagerService.startActivityAsUserWithFeature("android", null, intent, intent.getType(), null, null, 0, 0, null, null, userId);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,17 @@
|
||||||
|
package android.view;
|
||||||
|
|
||||||
|
import android.app.IActivityManager;
|
||||||
|
import android.os.Binder;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.os.IBinder;
|
||||||
|
import android.os.IInterface;
|
||||||
|
|
||||||
|
public interface IWindowManager extends IInterface {
|
||||||
|
void lockNow(Bundle options);
|
||||||
|
|
||||||
|
abstract class Stub extends Binder implements IWindowManager {
|
||||||
|
public static IWindowManager asInterface(IBinder obj) {
|
||||||
|
throw new UnsupportedOperationException();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue