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

Commit c4be155a authored by Andreas Huber's avatar Andreas Huber Committed by Android Git Automerger
Browse files

am 2cfd8198: Merge "Add an option to ALooper::start that allows it to call...

am 2cfd8198: Merge "Add an option to ALooper::start that allows it to call back into java or not." into gingerbread

Merge commit '2cfd8198' into gingerbread-plus-aosp

* commit '2cfd8198':
  Add an option to ALooper::start that allows it to call back into java or not.
parents 9f8c490e 2cfd8198
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -39,7 +39,10 @@ struct ALooper : public RefBase {
    handler_id registerHandler(const sp<AHandler> &handler);
    void unregisterHandler(handler_id handlerID);

    status_t start(bool runOnCallingThread = false);
    status_t start(
            bool runOnCallingThread = false,
            bool canCallJava = false);

    status_t stop();

    static int64_t GetNowUs();
+5 −4
Original line number Diff line number Diff line
@@ -31,8 +31,9 @@ namespace android {
ALooperRoster gLooperRoster;

struct ALooper::LooperThread : public Thread {
    LooperThread(ALooper *looper)
        : mLooper(looper) {
    LooperThread(ALooper *looper, bool canCallJava)
        : Thread(canCallJava),
          mLooper(looper) {
    }

    virtual bool threadLoop() {
@@ -72,7 +73,7 @@ void ALooper::unregisterHandler(handler_id handlerID) {
    gLooperRoster.unregisterHandler(handlerID);
}

status_t ALooper::start(bool runOnCallingThread) {
status_t ALooper::start(bool runOnCallingThread, bool canCallJava) {
    if (runOnCallingThread) {
        {
            Mutex::Autolock autoLock(mLock);
@@ -96,7 +97,7 @@ status_t ALooper::start(bool runOnCallingThread) {
        return INVALID_OPERATION;
    }

    mThread = new LooperThread(this);
    mThread = new LooperThread(this, canCallJava);

    status_t err = mThread->run("ALooper");
    if (err != OK) {