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

Commit 10d99727 authored by Xin Li's avatar Xin Li
Browse files

Merge sc-qpr1-dev-plus-aosp-without-vendor@7810918

Bug: 205056467
Merged-In: I13199bc39e9445929195f3d15579cbffe94e92b0
Change-Id: I35fa3c6c2abf679c51033f1395a08d511ed8739f
parents d353c81c 0f473ac7
Loading
Loading
Loading
Loading
+11 −0
Original line number Original line Diff line number Diff line
@@ -2918,6 +2918,13 @@ public class DeviceIdleController extends SystemService
                            reasonCode, reason).sendToTarget();
                            reasonCode, reason).sendToTarget();
                }
                }
                reportTempWhitelistChangedLocked(uid, true);
                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) {
        if (informWhitelistChanged) {
@@ -3941,6 +3948,10 @@ public class DeviceIdleController extends SystemService
        if (idleUntil) {
        if (idleUntil) {
            mAlarmManager.setIdleUntil(AlarmManager.ELAPSED_REALTIME_WAKEUP,
            mAlarmManager.setIdleUntil(AlarmManager.ELAPSED_REALTIME_WAKEUP,
                    mNextAlarmTime, "DeviceIdleController.deep", mDeepAlarmListener, mHandler);
                    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 {
        } else {
            if (mConstants.USE_WINDOW_ALARMS) {
            if (mConstants.USE_WINDOW_ALARMS) {
                mAlarmManager.setWindow(AlarmManager.ELAPSED_REALTIME_WAKEUP,
                mAlarmManager.setWindow(AlarmManager.ELAPSED_REALTIME_WAKEUP,
+1 −1
Original line number Original line Diff line number Diff line
@@ -71,7 +71,7 @@ cc_library_shared {
        "libui",
        "libui",
        "libjnigraphics",
        "libjnigraphics",
        "libEGL",
        "libEGL",
        "libGLESv1_CM",
        "libGLESv2",
        "libgui",
        "libgui",
    ],
    ],
}
}
+335 −106

File changed.

Preview size limit exceeded, changes collapsed.

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


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


namespace android {
namespace android {


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


    struct Font {
    struct Font {
        FileMap* map;
        FileMap* map = nullptr;
        Texture texture;
        Texture texture;
        int char_width;
        int char_width;
        int char_height;
        int char_height;
@@ -62,7 +62,7 @@ public:
    struct Animation {
    struct Animation {
        struct Frame {
        struct Frame {
            String8 name;
            String8 name;
            FileMap* map;
            FileMap* map = nullptr;
            int trimX;
            int trimX;
            int trimY;
            int trimY;
            int trimWidth;
            int trimWidth;
@@ -90,6 +90,10 @@ public:
            uint8_t* audioData;
            uint8_t* audioData;
            int audioLength;
            int audioLength;
            Animation* animation;
            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 {
            bool hasFadingPhase() const {
                return !playUntilComplete && framesToFadeCount > 0;
                return !playUntilComplete && framesToFadeCount > 0;
@@ -105,6 +109,12 @@ public:
        ZipFileRO* zip;
        ZipFileRO* zip;
        Font clockFont;
        Font clockFont;
        Font progressFont;
        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.
    // All callbacks will be called from this class's internal thread.
@@ -163,9 +173,12 @@ private:
    int displayEventCallback(int fd, int events, void* data);
    int displayEventCallback(int fd, int events, void* data);
    void processDisplayEvents();
    void processDisplayEvents();


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


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


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


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