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

Commit 8fb8921a authored by Xin Li's avatar Xin Li Committed by Android (Google) Code Review
Browse files

Merge "Merge sc-qpr1-dev-plus-aosp-without-vendor@7810918" into stage-aosp-master

parents 1b910626 10d99727
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -2918,6 +2918,13 @@ public class DeviceIdleController extends SystemService
                            reasonCode, reason).sendToTarget();
                }
                reportTempWhitelistChangedLocked(uid, true);
            } else {
                // The uid is already temp allowlisted, only need to update AMS for temp allowlist
                // duration.
                if (mLocalActivityManager != null) {
                    mLocalActivityManager.updateDeviceIdleTempAllowlist(null, uid, true,
                            duration, tempAllowListType, reasonCode, reason, callingUid);
                }
            }
        }
        if (informWhitelistChanged) {
@@ -3941,6 +3948,10 @@ public class DeviceIdleController extends SystemService
        if (idleUntil) {
            mAlarmManager.setIdleUntil(AlarmManager.ELAPSED_REALTIME_WAKEUP,
                    mNextAlarmTime, "DeviceIdleController.deep", mDeepAlarmListener, mHandler);
        } else if (mState == STATE_LOCATING) {
            // Use setExact so we don't keep the GPS active for too long.
            mAlarmManager.setExact(AlarmManager.ELAPSED_REALTIME_WAKEUP,
                    mNextAlarmTime, "DeviceIdleController.deep", mDeepAlarmListener, mHandler);
        } else {
            if (mConstants.USE_WINDOW_ALARMS) {
                mAlarmManager.setWindow(AlarmManager.ELAPSED_REALTIME_WAKEUP,
+1 −1
Original line number Diff line number Diff line
@@ -71,7 +71,7 @@ cc_library_shared {
        "libui",
        "libjnigraphics",
        "libEGL",
        "libGLESv1_CM",
        "libGLESv2",
        "libgui",
    ],
}
+335 −106

File changed.

Preview size limit exceeded, changes collapsed.

+27 −5
Original line number Diff line number Diff line
@@ -31,7 +31,7 @@
#include <binder/IBinder.h>

#include <EGL/egl.h>
#include <GLES/gl.h>
#include <GLES2/gl2.h>

namespace android {

@@ -53,7 +53,7 @@ public:
    };

    struct Font {
        FileMap* map;
        FileMap* map = nullptr;
        Texture texture;
        int char_width;
        int char_height;
@@ -62,7 +62,7 @@ public:
    struct Animation {
        struct Frame {
            String8 name;
            FileMap* map;
            FileMap* map = nullptr;
            int trimX;
            int trimY;
            int trimWidth;
@@ -90,6 +90,10 @@ public:
            uint8_t* audioData;
            int audioLength;
            Animation* animation;
            // Controls if dynamic coloring is enabled for this part.
            bool useDynamicColoring = false;
            // Defines if this part is played after the dynamic coloring part.
            bool postDynamicColoring = false;

            bool hasFadingPhase() const {
                return !playUntilComplete && framesToFadeCount > 0;
@@ -105,6 +109,12 @@ public:
        ZipFileRO* zip;
        Font clockFont;
        Font progressFont;
         // Controls if dynamic coloring is enabled for the whole animation.
        bool dynamicColoringEnabled = false;
        int colorTransitionStart = 0; // Start frame of dynamic color transition.
        int colorTransitionEnd = 0; // End frame of dynamic color transition.
        float startColors[4][3]; // Start colors of dynamic color transition.
        float endColors[4][3];   // End colors of dynamic color transition.
    };

    // All callbacks will be called from this class's internal thread.
@@ -163,9 +173,12 @@ private:
    int displayEventCallback(int fd, int events, void* data);
    void processDisplayEvents();

    status_t initTexture(Texture* texture, AssetManager& asset, const char* name);
    status_t initTexture(FileMap* map, int* width, int* height);
    status_t initTexture(Texture* texture, AssetManager& asset, const char* name,
        bool premultiplyAlpha = true);
    status_t initTexture(FileMap* map, int* width, int* height,
        bool premultiplyAlpha = true);
    status_t initFont(Font* font, const char* fallback);
    void initShaders();
    bool android();
    bool movie();
    void drawText(const char* str, const Font& font, bool bold, int* x, int* y);
@@ -173,6 +186,7 @@ private:
    void drawProgress(int percent, const Font& font, const int xPos, const int yPos);
    void fadeFrame(int frameLeft, int frameBottom, int frameWidth, int frameHeight,
                   const Animation::Part& part, int fadedFramesCount);
    void drawTexturedQuad(float xStart, float yStart, float width, float height);
    bool validClock(const Animation::Part& part);
    Animation* loadAnimation(const String8&);
    bool playAnimation(const Animation&);
@@ -192,6 +206,7 @@ private:
    void checkExit();

    void handleViewport(nsecs_t timestep);
    void initDynamicColors();

    sp<SurfaceComposerClient>       mSession;
    AssetManager mAssets;
@@ -218,6 +233,13 @@ private:
    sp<TimeCheckThread> mTimeCheckThread = nullptr;
    sp<Callbacks> mCallbacks;
    Animation* mAnimation = nullptr;
    GLuint mImageShader;
    GLuint mTextShader;
    GLuint mImageFadeLocation;
    GLuint mImageTextureLocation;
    GLuint mTextCropAreaLocation;
    GLuint mTextTextureLocation;
    GLuint mImageColorProgressLocation;
};

// ---------------------------------------------------------------------------
+0 −1
Original line number Diff line number Diff line
set noparent
toddke@google.com
patb@google.com
zyy@google.com
Loading