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

Commit 30ee31ba authored by The Android Automerger's avatar The Android Automerger
Browse files

Merge branch 'froyo' into froyo-release

parents 5de805d1 cb4c894a
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -268,7 +268,10 @@ class Request {
        if (hasBody)
            entity = httpClientConnection.receiveResponseEntity(header);

        boolean supportPartialContent = v.greaterEquals(HttpVersion.HTTP_1_1);
        // restrict the range request to the servers claiming that they are
        // accepting ranges in bytes
        boolean supportPartialContent = "bytes".equalsIgnoreCase(header
                .getAcceptRanges());

        if (entity != null) {
            InputStream is = entity.getContent();
+2 −0
Original line number Diff line number Diff line
@@ -715,6 +715,8 @@ public abstract class WallpaperService extends Service {
            
            if (mCreated) {
                try {
                    if (DEBUG) Log.v(TAG, "Removing window and destroying surface "
                            + mSurfaceHolder.getSurface() + " of: " + this);
                    mSession.remove(mWindow);
                } catch (RemoteException e) {
                }
+49 −25
Original line number Diff line number Diff line
@@ -53,6 +53,9 @@ public abstract class RecognitionService extends Service {
    /** Debugging flag */
    private static final boolean DBG = false;

    /** Binder of the recognition service */
    private RecognitionServiceBinder mBinder = new RecognitionServiceBinder(this);

    /**
     * The current callback of an application that invoked the
     * {@link RecognitionService#onStartListening(Intent, Callback)} method
@@ -136,31 +139,6 @@ public abstract class RecognitionService extends Service {
        }
    }

    /** Binder of the recognition service */
    private final IRecognitionService.Stub mBinder = new IRecognitionService.Stub() {
        public void startListening(Intent recognizerIntent, IRecognitionListener listener) {
            if (DBG) Log.d(TAG, "startListening called by:" + listener.asBinder());
            if (checkPermissions(listener)) {
                mHandler.sendMessage(Message.obtain(mHandler, MSG_START_LISTENING,
                        new StartListeningArgs(recognizerIntent, listener)));
            }
        }

        public void stopListening(IRecognitionListener listener) {
            if (DBG) Log.d(TAG, "stopListening called by:" + listener.asBinder());
            if (checkPermissions(listener)) {
                mHandler.sendMessage(Message.obtain(mHandler, MSG_STOP_LISTENING, listener));
            }
        }

        public void cancel(IRecognitionListener listener) {
            if (DBG) Log.d(TAG, "cancel called by:" + listener.asBinder());
            if (checkPermissions(listener)) {
                mHandler.sendMessage(Message.obtain(mHandler, MSG_CANCEL, listener));
            }
        }
    };

    /**
     * Checks whether the caller has sufficient permissions
     * 
@@ -210,6 +188,14 @@ public abstract class RecognitionService extends Service {
        return mBinder;
    }

    @Override
    public void onDestroy() {
        if (DBG) Log.d(TAG, "onDestroy");
        mCurrentCallback = null;
        mBinder.clearReference();
        super.onDestroy();
    }

    /**
     * This class receives callbacks from the speech recognition service and forwards them to the
     * user. An instance of this class is passed to the
@@ -306,4 +292,42 @@ public abstract class RecognitionService extends Service {
            mListener.onRmsChanged(rmsdB);
        }
    }

    /** Binder of the recognition service */
    private static class RecognitionServiceBinder extends IRecognitionService.Stub {
        private RecognitionService mInternalService;

        public RecognitionServiceBinder(RecognitionService service) {
            mInternalService = service;
        }

        public void startListening(Intent recognizerIntent, IRecognitionListener listener) {
            if (DBG) Log.d(TAG, "startListening called by:" + listener.asBinder());
            if (mInternalService != null && mInternalService.checkPermissions(listener)) {
                mInternalService.mHandler.sendMessage(Message.obtain(mInternalService.mHandler,
                        MSG_START_LISTENING, mInternalService.new StartListeningArgs(
                                recognizerIntent, listener)));
            }
        }

        public void stopListening(IRecognitionListener listener) {
            if (DBG) Log.d(TAG, "stopListening called by:" + listener.asBinder());
            if (mInternalService != null && mInternalService.checkPermissions(listener)) {
                mInternalService.mHandler.sendMessage(Message.obtain(mInternalService.mHandler,
                        MSG_STOP_LISTENING, listener));
            }
        }

        public void cancel(IRecognitionListener listener) {
            if (DBG) Log.d(TAG, "cancel called by:" + listener.asBinder());
            if (mInternalService != null && mInternalService.checkPermissions(listener)) {
                mInternalService.mHandler.sendMessage(Message.obtain(mInternalService.mHandler,
                        MSG_CANCEL, listener));
            }
        }

        public void clearReference() {
            mInternalService = null;
        }
    }
}
+1 −0
Original line number Diff line number Diff line
@@ -382,6 +382,7 @@ public class SpeechRecognizer {
        mPendingTasks.clear();
        mService = null;
        mConnection = null;
        mListener.mInternalListener = null;
    }

    /**
+1 −1
Original line number Diff line number Diff line
@@ -386,7 +386,7 @@ public class Surface implements Parcelable {

    @Override
    public String toString() {
        return "Surface(native-token=" + mSurfaceControl + ")";
        return "Surface(native-token=" + mSurface + ")";
    }

    private Surface(Parcel source) throws OutOfResourcesException {
Loading