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

Commit a1ea9abd authored by The Android Automerger's avatar The Android Automerger
Browse files

Merge branch 'master' into honeycomb-release

parents 7fc0646a cef1523c
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -147,9 +147,12 @@ public:
    /* Notifies the system that an input channel recovered from ANR. */
    virtual void notifyInputChannelRecoveredFromANR(const sp<InputChannel>& inputChannel) = 0;

    /* Gets the key repeat timeout or -1 if automatic key repeating is disabled. */
    /* Gets the key repeat initial timeout or -1 if automatic key repeating is disabled. */
    virtual nsecs_t getKeyRepeatTimeout() = 0;

    /* Gets the key repeat inter-key delay. */
    virtual nsecs_t getKeyRepeatDelay() = 0;

    /* Waits for key event input targets to become available.
     * If the event is being injected, injectorPid and injectorUid should specify the
     * process id and used id of the injecting application, otherwise they should both
+5 −0
Original line number Diff line number Diff line
@@ -38,6 +38,11 @@ public:
        return *instance;
    }

    static bool hasInstance() {
        Mutex::Autolock _l(sLock);
        return sInstance != 0;
    }
    
protected:
    ~Singleton() { };
    Singleton() { };
+5 −4
Original line number Diff line number Diff line
@@ -97,6 +97,7 @@ InputDispatcher::~InputDispatcher() {

void InputDispatcher::dispatchOnce() {
    nsecs_t keyRepeatTimeout = mPolicy->getKeyRepeatTimeout();
    nsecs_t keyRepeatDelay = mPolicy->getKeyRepeatDelay();

    bool skipPoll = false;
    nsecs_t currentTime;
@@ -146,7 +147,7 @@ void InputDispatcher::dispatchOnce() {
            if (mInboundQueue.isEmpty()) {
                if (mKeyRepeatState.lastKeyEntry) {
                    if (currentTime >= mKeyRepeatState.nextRepeatTime) {
                        processKeyRepeatLockedInterruptible(currentTime, keyRepeatTimeout);
                        processKeyRepeatLockedInterruptible(currentTime, keyRepeatDelay);
                        skipPoll = true;
                    } else {
                        if (mKeyRepeatState.nextRepeatTime < nextWakeupTime) {
@@ -335,7 +336,7 @@ void InputDispatcher::processKeyLockedInterruptible(
}

void InputDispatcher::processKeyRepeatLockedInterruptible(
        nsecs_t currentTime, nsecs_t keyRepeatTimeout) {
        nsecs_t currentTime, nsecs_t keyRepeatDelay) {
    KeyEntry* entry = mKeyRepeatState.lastKeyEntry;

    // Search the inbound queue for a key up corresponding to this device.
@@ -352,7 +353,7 @@ void InputDispatcher::processKeyRepeatLockedInterruptible(
        }
    }

    // Synthesize a key repeat after the repeat timeout expired.
    // Synthesize a key repeat.
    // Reuse the repeated key entry if it is otherwise unreferenced.
    uint32_t policyFlags = entry->policyFlags & POLICY_FLAG_RAW_MASK;
    if (entry->refCount == 1) {
@@ -375,7 +376,7 @@ void InputDispatcher::processKeyRepeatLockedInterruptible(
        entry->flags |= AKEY_EVENT_FLAG_LONG_PRESS;
    }

    mKeyRepeatState.nextRepeatTime = currentTime + keyRepeatTimeout;
    mKeyRepeatState.nextRepeatTime = currentTime + keyRepeatDelay;

#if DEBUG_OUTBOUND_EVENT_DETAILS
    LOGD("processKeyRepeat - eventTime=%lld, deviceId=0x%x, source=0x%x, policyFlags=0x%x, "
+18 −9
Original line number Diff line number Diff line
@@ -191,23 +191,32 @@ int main(int argc, char *argv[])

    appInit();

    struct timeval timeTemp;
    int frameCount = 0;
    gettimeofday(&timeTemp, NULL);
    double totalTime = timeTemp.tv_usec/1000000.0 + timeTemp.tv_sec;
    
    while (gAppAlive)
    {
        struct timeval timeNow;

        if (gAppAlive)
        {
        gettimeofday(&timeNow, NULL);
        appRender(timeNow.tv_sec * 1000 + timeNow.tv_usec / 1000,
                sWindowWidth, sWindowHeight);
        checkGLErrors();
        eglSwapBuffers(sEglDisplay, sEglSurface);
        checkEGLErrors();
        }
        frameCount++;
    }

    gettimeofday(&timeTemp, NULL);

    appDeinit();
    deinitGraphics();

    totalTime = (timeTemp.tv_usec/1000000.0 + timeTemp.tv_sec) - totalTime;
    printf("totalTime=%f s, frameCount=%d, %.2f fps\n",
            totalTime, frameCount, frameCount/totalTime);

    return EXIT_SUCCESS;
}