在设置菜单中,增加距离传感器、重力传感器测试菜单。(放在设置--显示--最下边)
工程模式:*#*#3646633#*#*
AndroidManifest.xml (...\mediatek\packages\apps\engineermode)
...
<activity
android:name=".sensor.SensorCalibration"
android:label="@string/sensor_calibration_gsensor"
android:screenOrientation="portrait">
<!-- ==============SensorCalibration =============================-->
<intent-filter>
<action android:name="com.mediatek.engineermode.SensorCalibration" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<!-- ==============SensorCalibration =============================-->
</activity>
....
<activity
android:name=".sensor.PSensorCalibration"
android:label="@string/psensor_calibration"
android:screenOrientation="portrait">
<!-- ==============SensorCalibration =============================-->
<intent-filter>
<action android:name="com.mediatek.engineermode.PSensorCalibration" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<!-- ==============SensorCalibration =============================-->
</activity>
Display_settings.xml (...\settings\res\xml)
...
<!-- ==============SensorCalibration =============================-->
<Preference
android:key="gs_calibration"
android:persistent="false"
android:title="@string/sensor_calibration_gsensor" >
<intent
android:action="com.mediatek.engineermode.SensorCalibration"
android:targetPackage="com.mediatek.engineermode" />
</Preference>
<Preference
android:key="ps_calibration"
android:persistent="false"
android:title="@string/sensor_calibration_psensor" >
<intent
android:action="com.mediatek.engineermode.PSensorCalibration"
android:targetPackage="com.mediatek.engineermode" />
</Preference>
<!-- ==============SensorCalibration =============================-->