Skip to content

Commit daa98fe

Browse files
Jeff BrownAndroid (Google) Code Review
authored andcommitted
Merge "Revert "Forces AsyncTask to use the main looper Bug #5333924""
2 parents 3a42323 + 99f801d commit daa98fe

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

core/java/android/os/AsyncTask.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,6 @@ public enum Status {
237237

238238
/** @hide Used to force static handler to be created. */
239239
public static void init() {
240-
// TODO: This doesn't do anything, we should get rid of it
241240
sHandler.getLooper();
242241
}
243242

@@ -255,7 +254,6 @@ public Result call() throws Exception {
255254
mTaskInvoked.set(true);
256255

257256
Process.setThreadPriority(Process.THREAD_PRIORITY_BACKGROUND);
258-
//noinspection unchecked
259257
return postResult(doInBackground(mParams));
260258
}
261259
};
@@ -290,7 +288,7 @@ private void postResultIfNotInvoked(Result result) {
290288
}
291289

292290
private Result postResult(Result result) {
293-
@SuppressWarnings({"unchecked"}) Message message = sHandler.obtainMessage(MESSAGE_POST_RESULT,
291+
Message message = sHandler.obtainMessage(MESSAGE_POST_RESULT,
294292
new AsyncTaskResult<Result>(this, result));
295293
message.sendToTarget();
296294
return result;
@@ -600,10 +598,6 @@ private void finish(Result result) {
600598
}
601599

602600
private static class InternalHandler extends Handler {
603-
InternalHandler() {
604-
super(Looper.getMainLooper());
605-
}
606-
607601
@SuppressWarnings({"unchecked", "RawUseOfParameterizedType"})
608602
@Override
609603
public void handleMessage(Message msg) {

0 commit comments

Comments
 (0)