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

Unverified Commit 01f68a7a authored by Michael Bestas's avatar Michael Bestas
Browse files

Merge tag 'android-12.0.0_r18' into staging/lineage-19.0_merge-android-12.0.0_r18

Android 12.0.0 release 18

* tag 'android-12.0.0_r18':
  sensorservice: Track Proximity state change when app goes idle.
  sensorservice: Refactor tracking logic for the Proximity sensor.
  Repeat proxy limit callbacks if we keep going above the limit.
  binderRpcTest: disable
  Use sequence numbers to synchronize enabling Pointer Capture (1/2)
  getProcessFreezeInfo reads more info from kernel
  Add support for latching unsignaled buffers in Skia RenderEngine.
  Surface: Release references to BlastBufferQueue and SurfaceControl on Surface#destroy
  Surface: Release references to BlastBufferQueue and SurfaceControl on Surface#destroy
  Use a separate mutex for BLASTBufferQueue in BLASTBufferItemConsumer
  libbinder: uptimeMillis returns int64_t!
  SF: fix a bug with DISPLAY_EVENT_MODE_CHANGE
  swapchain: always return a signle image for shared presentation mode
  Remove support: libfeature_support_angle.so
  SF: Tune RefreshRateConfigs for close refresh rates
  SurfaceFlinger: Safely cast from IBinder to Layer::Handle

Change-Id: Ia757f66d6c6395aeef5c96cfc273ad9f0dfda483
parents c7c7b69e 22177f45
Loading
Loading
Loading
Loading
+19 −0
Original line number Diff line number Diff line
@@ -1015,6 +1015,25 @@ private:
    std::queue<std::unique_ptr<DragEvent>> mDragEventPool;
};

/*
 * Describes a unique request to enable or disable Pointer Capture.
 */
struct PointerCaptureRequest {
public:
    inline PointerCaptureRequest() : enable(false), seq(0) {}
    inline PointerCaptureRequest(bool enable, uint32_t seq) : enable(enable), seq(seq) {}
    inline bool operator==(const PointerCaptureRequest& other) const {
        return enable == other.enable && seq == other.seq;
    }
    explicit inline operator bool() const { return enable; }

    // True iff this is a request to enable Pointer Capture.
    bool enable;

    // The sequence number for the request.
    uint32_t seq;
};

} // namespace android

#endif // _LIBINPUT_INPUT_H
+16 −2
Original line number Diff line number Diff line
@@ -37,6 +37,7 @@ namespace android {

Mutex BpBinder::sTrackingLock;
std::unordered_map<int32_t, uint32_t> BpBinder::sTrackingMap;
std::unordered_map<int32_t, uint32_t> sLastLimitCallbackMap;
int BpBinder::sNumTrackedUids = 0;
std::atomic_bool BpBinder::sCountByUidEnabled(false);
binder_proxy_limit_callback BpBinder::sLimitCallback;
@@ -117,12 +118,24 @@ sp<BpBinder> BpBinder::create(int32_t handle) {
            if (sBinderProxyThrottleCreate) {
                return nullptr;
            }
            trackedValue = trackedValue & COUNTING_VALUE_MASK;
            uint32_t lastLimitCallbackAt = sLastLimitCallbackMap[trackedUid];

            if (trackedValue > lastLimitCallbackAt &&
                (trackedValue - lastLimitCallbackAt > sBinderProxyCountHighWatermark)) {
                ALOGE("Still too many binder proxy objects sent to uid %d from uid %d (%d proxies "
                      "held)",
                      getuid(), trackedUid, trackedValue);
                if (sLimitCallback) sLimitCallback(trackedUid);
                sLastLimitCallbackMap[trackedUid] = trackedValue;
            }
        } else {
            if ((trackedValue & COUNTING_VALUE_MASK) >= sBinderProxyCountHighWatermark) {
                ALOGE("Too many binder proxy objects sent to uid %d from uid %d (%d proxies held)",
                      getuid(), trackedUid, trackedValue);
                sTrackingMap[trackedUid] |= LIMIT_REACHED_MASK;
                if (sLimitCallback) sLimitCallback(trackedUid);
                sLastLimitCallbackMap[trackedUid] = trackedValue & COUNTING_VALUE_MASK;
                if (sBinderProxyThrottleCreate) {
                    ALOGI("Throttling binder proxy creates from uid %d in uid %d until binder proxy"
                          " count drops below %d",
@@ -452,8 +465,9 @@ BpBinder::~BpBinder()
                ((trackedValue & COUNTING_VALUE_MASK) <= sBinderProxyCountLowWatermark)
                )) {
                ALOGI("Limit reached bit reset for uid %d (fewer than %d proxies from uid %d held)",
                                   getuid(), mTrackedUid, sBinderProxyCountLowWatermark);
                      getuid(), sBinderProxyCountLowWatermark, mTrackedUid);
                sTrackingMap[mTrackedUid] &= ~LIMIT_REACHED_MASK;
                sLastLimitCallbackMap.erase(mTrackedUid);
            }
            if (--sTrackingMap[mTrackedUid] == 0) {
                sTrackingMap.erase(mTrackedUid);
+19 −0
Original line number Diff line number Diff line
@@ -1398,6 +1398,25 @@ status_t IPCThreadState::getProcessFreezeInfo(pid_t pid, bool *sync_received, bo
    return ret;
}

#ifndef __ANDROID_VNDK__
status_t IPCThreadState::getProcessFreezeInfo(pid_t pid, uint32_t *sync_received,
                                              uint32_t *async_received)
{
    int ret = 0;
    binder_frozen_status_info info;
    info.pid = pid;

#if defined(__ANDROID__)
    if (ioctl(self()->mProcess->mDriverFD, BINDER_GET_FROZEN_INFO, &info) < 0)
        ret = -errno;
#endif
    *sync_received = info.sync_recv;
    *async_received = info.async_recv;

    return ret;
}
#endif

status_t IPCThreadState::freeze(pid_t pid, bool enable, uint32_t timeout_ms) {
    struct binder_freeze_info info;
    int ret = 0;
+0 −3
Original line number Diff line number Diff line
@@ -24,9 +24,6 @@
    {
      "name": "binderLibTest"
    },
    {
      "name": "binderRpcTest"
    },
    {
      "name": "binderStabilityTest"
    },
+2 −0
Original line number Diff line number Diff line
@@ -74,6 +74,8 @@ struct binder_frozen_status_info {
    //
    // Indicates whether the process has received any sync calls since last
    // freeze (cleared at freeze/unfreeze)
    // bit 0: received sync transaction after being frozen
    // bit 1: new pending sync transaction during freezing
    //
    __u32 sync_recv;
    //
Loading