VIVO 手機重力感應器踩坑記錄

來源:互聯網
上載者:User

標籤:垃圾   ctc   vendor   解決   dimens   its   方案   邏輯   class   

手上的 vivo-x9 手機感應器模式下的旋轉效果有誤,經查發現是 Gravity sensor 返回的資料有誤,和其他機型返回的資料相反的。

參考 Gravity 的說明:

A three dimensional vector indicating the direction and magnitude of gravity. Units are m/s^2. The coordinate system is the same as is used by the acceleration sensor.

Note: When the device is at rest, the output of the gravity sensor should be identical to that of the accelerometer.

正常來說,當手機豎著拿著,螢幕與地球引力差不多平行時,擷取到的重力分量主要集中在 y 分量,接近重力加速度 g = 9.80665 m/s2. 當手機保持螢幕和引力平行,但是橫置,頭朝左,navigation bar 在右側的時候,在 iOS 的邏輯裡面是稱為 DEVICE_LANDSCAPE_LEFT 自然另一種橫置的方式就叫做 DEVICE_LANDSCAPE_RIGHT. 在 LEFT 模式下,重力加速度主要體現在 x 分量,但是在這個 VIVO 手機上,雖說也是體現在 x 分量,但是卻是相反的,x 分量接近 -9.8 m/s2. 同樣,z 分量也有一樣問題, y 分量正常。

解決方案只能針對性修改了,根據 log 可知硬體感應器型號:

I/InteractControl: Gravity sensor akm Version 2I/InteractControl: Game rotation sensor vendor: AOSP Version: 3

見了這個繞著走就是了。(垃圾 vivo)

VIVO 手機重力感應器踩坑記錄

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.