修改文件:res/layout/software_version.xml
res/layout/software_version.xml
@@ -75,18 +75,35 @@
style="@style/content_style"
android:id="@+id/tp_info_content" />
- <!-- compass info-->
+ <!-- tp2 info -->
<TextView
style="@style/title_style"
- android:id="@+id/compass_info_text" />
+ android:id="@+id/tp2_info_text" />
<View
android:layout_width="match_parent"
android:layout_height="3dip"
android:background="#ffcccccc" />
<TextView
style="@style/content_style"
- android:id="@+id/compass_info_content" />
+ android:id="@+id/tp2_info_content" />
+ <LinearLayout
+ android:id="@+id/hide1"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:orientation="vertical">
+ <!-- compass info-->
+ <TextView
+ style="@style/title_style"
+ android:id="@+id/compass_info_text" />
+ <View
+ android:layout_width="match_parent"
+ android:layout_height="3dip"
+ android:background="#ffcccccc" />
+ <TextView
+ style="@style/content_style"
+ android:id="@+id/compass_info_content" />
+ </LinearLayout>
<!-- lcd info -->
<TextView
style="@style/title_style"
@@ -99,6 +116,24 @@
style="@style/content_style"
android:id="@+id/lcd_content" />
+ <!-- lcd2 info -->
+ <TextView
+ style="@style/title_style"
+ android:id="@+id/lcd2_info" />
+ <View
+ android:layout_width="match_parent"
+ android:layout_height="3dip"
+ android:background="#ffcccccc" />
+ <TextView
+ style="@style/content_style"
+ android:id="@+id/lcd2_content" />
+
+ <LinearLayout
+ android:id="@+id/hide2"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:orientation="vertical">
+
<!-- front camera info -->
<TextView
style="@style/title_style"
@@ -185,6 +220,6 @@
<TextView
style="@style/content_style"
android:id="@+id/paraVersion_content" />
-
+ </LinearLayout>
</LinearLayout>
</ScrollView>
修改文件:SoftwareVersion.java
public class SoftwareVersion extends Activity{
private static final String TAG = "SoftwareVersion";
@@ -39,10 +40,14 @@
private static TextView m_memory_content;
private static TextView m_tpVersion_text;
private static TextView m_tpVersion_content;
+ private static TextView m_tp2Version_text;
+ private static TextView m_tp2Version_content;
private static TextView m_compass_text;
private static TextView m_compass_content;
private static TextView m_lcd_text;
private static TextView m_lcd_content;
+ private static TextView m_lcd2_text;
+ private static TextView m_lcd2_content;
private static TextView m_front_camera_text;
private static TextView m_front_camera_content;
private static TextView m_main_camera_text;
@@ -62,8 +67,10 @@
private static StringBuffer m_memory_buffer = new StringBuffer();
private static StringBuffer m_tp_buffer = new StringBuffer();
+ private static StringBuffer m_tp2_buffer = new StringBuffer();
private static StringBuffer m_compass_buffer = new StringBuffer();
private static StringBuffer m_lcd_buffer = new StringBuffer();
+ private static StringBuffer m_lcd2_buffer = new StringBuffer();
private static StringBuffer m_front_camera_buffer = new StringBuffer();
private static StringBuffer m_main_camera_buffer = new StringBuffer();
private static StringBuffer m_gSensor_buffer = new StringBuffer();
@@ -110,6 +117,9 @@
if (m_tp_buffer != null) {
m_tp_buffer.setLength(0);
}
+ if (m_tp2_buffer != null) {
+ m_tp2_buffer.setLength(0);
+ }
if (m_compass_buffer != null) {
m_compass_buffer.setLength(0);
}
@@ -119,6 +129,9 @@
if (m_lcd_buffer != null){
m_lcd_buffer.setLength(0);
}
+ if (m_lcd2_buffer != null){
+ m_lcd2_buffer.setLength(0);
+ }
if (m_front_camera_buffer != null){
m_front_camera_buffer.setLength(0);
}
@@ -193,6 +206,9 @@
m_tpVersion_text = (TextView) findViewById(R.id.tp_info_text);
m_tpVersion_content = (TextView) findViewById(R.id.tp_info_content);
+ m_tp2Version_text = (TextView) findViewById(R.id.tp2_info_text);
+ m_tp2Version_content = (TextView) findViewById(R.id.tp2_info_content);
+
m_compass_text = (TextView) findViewById(R.id.compass_info_text);
m_compass_content = (TextView) findViewById(R.id.compass_info_content);
if(!hasFeatureSupport(mContext, PackageManager.FEATURE_SENSOR_COMPASS)){
@@ -202,6 +218,16 @@
m_lcd_text = (TextView) findViewById(R.id.lcd_info);
m_lcd_content = (TextView) findViewById(R.id.lcd_content);
+ m_lcd2_text = (TextView) findViewById(R.id.lcd2_info);
+ m_lcd2_content = (TextView) findViewById(R.id.lcd2_content);
+ //XCSW yanghua hide some messages for [D0761]
+ LinearLayout viewById1 = findViewById(R.id.hide1);
+ viewById1.setVisibility(View.GONE);
+ LinearLayout viewById2 = findViewById(R.id.hide2);
+ viewById2.setVisibility(View.GONE);
+ //XCSW yanghua hide some messages for [D0761]
+
+
m_front_camera_text = (TextView) findViewById(R.id.front_camera_info);
m_front_camera_content = (TextView) findViewById(R.id.front_camera_content);
if(!hasFeatureSupport(mContext, PackageManager.FEATURE_CAMERA_FRONT)){
@@ -211,6 +237,11 @@
m_main_camera_text = (TextView) findViewById(R.id.main_camera_info);
m_main_camera_content = (TextView) findViewById(R.id.main_camera_content);
+ if (!hasFeatureSupport(mContext, PackageManager.FEATURE_CAMERA)) {
+ m_main_camera_text.setVisibility(View.GONE);
+ m_main_camera_content.setVisibility(View.GONE);
+ }
+
m_gSensor_text = (TextView) findViewById(R.id.gsensor_info);
m_gSensor_content = (TextView) findViewById(R.id.gsensor_content);
@@ -239,9 +270,11 @@
m_paraVersion_content = (TextView) findViewById(R.id.paraVersion_content);
getDeviceInfo("MEMINFO", m_memory_buffer);
- getDeviceInfo("TPINFO", m_tp_buffer);
+ getDeviceInfo("sys/devices/platform", "firmware_version", m_tp_buffer);
+ getDeviceInfo("sys/devices/", "sub_firmware_version", m_tp2_buffer);
getDeviceInfo("COMPASSINFO", m_compass_buffer);
- getDeviceInfo("LCMINFO", m_lcd_buffer);
+ getDeviceInfo("sys/devices/platform/device_info/","LCMINFO", m_lcd_buffer);
+ getDeviceInfo("sys/devices/platform/device_info/","SUBLCMINFO", m_lcd2_buffer);
getDeviceInfo("SUBCAMERAINFO", m_front_camera_buffer);
getDeviceInfo("MAINCAMERAINFO", m_main_camera_buffer);
getDeviceInfo("GSENSORINFO", m_gSensor_buffer);
@@ -280,6 +313,34 @@
Log.i(TAG, "the" + device_buffer + "info = " + device_buffer.toString());
}
}
+ private void getDeviceInfo(String path, String deviceName, StringBuffer device_buffer){
+ android.util.Log.v("wch","file:" + path + deviceName);
+ try {
+ FileInputStream fis = new FileInputStream(path + deviceName);
+ InputStreamReader isr = new InputStreamReader(fis);
+ BufferedReader br = new BufferedReader(isr, 4096);
+ String ch = null;
+ android.util.Log.v("wch","br:" + br);
+ while ((ch = br.readLine()) != null){
+ device_buffer.append(ch);
+ if("ParaVersion".equals(deviceName)){
+ device_buffer.append("\n");
+ }
+ }
+ android.util.Log.v("wch","device_buffer:" + device_buffer);
+ fis.close();
+ } catch (FileNotFoundException e) {
+ device_buffer.append("No" + device_buffer + "file found");
+ Log.i(TAG, "No lcdinfo file found");
+ } catch (IOException e) {
+ device_buffer.append("Error reading " + device_buffer + "file");
+ device_buffer.append(e);
+ Log.w(TAG, "Error reading" + device_buffer +" file", e);
+ }
+ if (device_buffer != null) {
+ Log.i(TAG, "the" + device_buffer + "info = " + device_buffer.toString());
+ }
+ }
private void showSoftwareVersionExt(){
if(true) {
m_tag_text.setText("TAG:");
@@ -305,15 +366,21 @@
m_memory_info.setText("Memory:");
m_memory_content.setText(m_memory_buffer);
- m_tpVersion_text.setText("TP:");
+ m_tpVersion_text.setText("主屏TP:");
m_tpVersion_content.setText(m_tp_buffer);
+ m_tp2Version_text.setText("副屏TP:");
+ m_tp2Version_content.setText(m_tp2_buffer);
+
m_compass_text.setText("COMPASS:");
m_compass_content.setText(m_compass_buffer);
m_lcd_text.setText("LCD:");
m_lcd_content.setText(m_lcd_buffer);
+ m_lcd2_text.setText("LCD2:");
+ m_lcd2_content.setText(m_lcd2_buffer);
+
m_front_camera_text.setText("FrontCamera:");
m_front_camera_content.setText(m_front_camera_buffer);