ActivityStack handler now use ActivityManager looper instead of ServerThread looper
Bug: 6957716
Change-Id: I36feb45ef7a85885ab812092c7b28e91886a4821
diff --git a/services/java/com/android/server/am/ActivityStack.java b/services/java/com/android/server/am/ActivityStack.java
index a389edc2..dc15342 100755
--- a/services/java/com/android/server/am/ActivityStack.java
+++ b/services/java/com/android/server/am/ActivityStack.java
@@ -49,6 +49,7 @@
import android.os.Bundle;
import android.os.Handler;
import android.os.IBinder;
+import android.os.Looper;
import android.os.Message;
import android.os.ParcelFileDescriptor;
import android.os.PowerManager;
@@ -306,11 +307,17 @@
}
}
- final Handler mHandler = new Handler() {
+ final Handler mHandler;
+
+ final class ActivityStackHandler extends Handler {
//public Handler() {
// if (localLOGV) Slog.v(TAG, "Handler started!");
//}
+ public ActivityStackHandler(Looper looper) {
+ super(looper);
+ }
+ @Override
public void handleMessage(Message msg) {
switch (msg.what) {
case SLEEP_TIMEOUT_MSG: {
@@ -410,7 +417,8 @@
}
};
- ActivityStack(ActivityManagerService service, Context context, boolean mainStack) {
+ ActivityStack(ActivityManagerService service, Context context, boolean mainStack, Looper looper) {
+ mHandler = new ActivityStackHandler(looper);
mService = service;
mContext = context;
mMainStack = mainStack;