*/
private static final float MIN_PERSISTED_SCALE = 2.0f;
- private final Object mLock = new Object();
+ private final Object mLock;
/**
* The current magnification spec. If an animation is running, this
private int mUserId;
- public MagnificationController(Context context, AccessibilityManagerService ams) {
+ public MagnificationController(Context context, AccessibilityManagerService ams, Object lock) {
mAms = ams;
mContentResolver = context.getContentResolver();
mScreenStateObserver = new ScreenStateObserver(context, this);
mWindowStateObserver = new WindowStateObserver(context, this);
mSpecAnimationBridge = new SpecAnimationBridge(context);
+ mLock = lock;
}
/**
final boolean crashSilenced = mAppsNotReportingCrashes != null &&
mAppsNotReportingCrashes.contains(proc.info.packageName);
if (mService.canShowErrorDialogs() && !crashSilenced) {
- Dialog d = new AppErrorDialog(mContext, mService, data);
- d.show();
- proc.crashDialog = d;
+ proc.crashDialog = new AppErrorDialog(mContext, mService, data);
} else {
// The device is asleep, so just pretend that the user
// saw a crash dialog and hit "force quit".
}
}
}
+ // If we've created a crash dialog, show it without the lock held
+ if(data.proc.crashDialog != null) {
+ data.proc.crashDialog.show();
+ }
}
void stopReportingCrashesLocked(ProcessRecord proc) {
}
void handleShowAnrUi(Message msg) {
+ Dialog d = null;
synchronized (mService) {
HashMap<String, Object> data = (HashMap<String, Object>) msg.obj;
ProcessRecord proc = (ProcessRecord)data.get("app");
null, false, false, MY_PID, Process.SYSTEM_UID, 0 /* TODO: Verify */);
if (mService.canShowErrorDialogs()) {
- Dialog d = new AppNotRespondingDialog(mService,
+ d = new AppNotRespondingDialog(mService,
mContext, proc, (ActivityRecord)data.get("activity"),
msg.arg1 != 0);
- d.show();
proc.anrDialog = d;
} else {
MetricsLogger.action(mContext, MetricsProto.MetricsEvent.ACTION_APP_ANR,
mService.killAppAtUsersRequest(proc, null);
}
}
+ // If we've created a crash dialog, show it without the lock held
+ if (d != null) {
+ d.show();
+ }
}
/**