Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e15b4f6d authored by Ryan Lothian's avatar Ryan Lothian Committed by Android (Google) Code Review
Browse files

Merge "Improve documentation for IntentService"

parents 094e64b7 ce8d4f51
Loading
Loading
Loading
Loading
+10 −4
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package android.app;

import android.annotation.WorkerThread;
import android.annotation.Nullable;
import android.content.Intent;
import android.os.Handler;
import android.os.HandlerThread;
@@ -113,7 +114,7 @@ public abstract class IntentService extends Service {
    }

    @Override
    public void onStart(Intent intent, int startId) {
    public void onStart(@Nullable Intent intent, int startId) {
        Message msg = mServiceHandler.obtainMessage();
        msg.arg1 = startId;
        msg.obj = intent;
@@ -127,7 +128,7 @@ public abstract class IntentService extends Service {
     * @see android.app.Service#onStartCommand
     */
    @Override
    public int onStartCommand(Intent intent, int flags, int startId) {
    public int onStartCommand(@Nullable Intent intent, int flags, int startId) {
        onStart(intent, startId);
        return mRedelivery ? START_REDELIVER_INTENT : START_NOT_STICKY;
    }
@@ -143,6 +144,7 @@ public abstract class IntentService extends Service {
     * @see android.app.Service#onBind
     */
    @Override
    @Nullable
    public IBinder onBind(Intent intent) {
        return null;
    }
@@ -158,7 +160,11 @@ public abstract class IntentService extends Service {
     *
     * @param intent The value passed to {@link
     *               android.content.Context#startService(Intent)}.
     *               This may be null if the service is being restarted after
     *               its process has gone away; see
     *               {@link android.app.Service#onStartCommand}
     *               for details.
     */
    @WorkerThread
    protected abstract void onHandleIntent(Intent intent);
    protected abstract void onHandleIntent(@Nullable Intent intent);
}