Merge "[Bugfix] Fix after performing adb shell am hang and kill this process, the phone can not resume from hang state" am: 4d83226663
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1601731 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: I20ebeab1147f78b7ed2d481f00fd3d8cbb9a7879
This commit is contained in:
@@ -102,6 +102,10 @@ public class ShellCallback implements Parcelable {
|
||||
}
|
||||
}
|
||||
|
||||
public IBinder getShellCallbackBinder() {
|
||||
return mShellCallback.asBinder();
|
||||
}
|
||||
|
||||
ShellCallback(Parcel in) {
|
||||
mLocal = false;
|
||||
mShellCallback = IShellCallback.Stub.asInterface(in.readStrongBinder());
|
||||
|
||||
@@ -1690,7 +1690,14 @@ final class ActivityManagerShellCommand extends ShellCommand {
|
||||
|
||||
pw.println("Hanging the system...");
|
||||
pw.flush();
|
||||
mInterface.hang(new Binder(), allowRestart);
|
||||
try {
|
||||
mInterface.hang(getShellCallback().getShellCallbackBinder(), allowRestart);
|
||||
} catch (NullPointerException e) {
|
||||
pw.println("Hanging failed, since caller " + Binder.getCallingPid() +
|
||||
" did not provide a ShellCallback!");
|
||||
pw.flush();
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user