修改文件:JavaConfig.mk
MTK_MTKLOGGER_SUPPORT = yes
MIDTEST_HARDWARE = yes
+LANDSCAPE_ORIENTATION=yes
修改文件:DefaultConfig.pm
+LANDSCAPE_ORIENTATION=no
修改文件:/system/frameworks/base/services/core/java/com/android/server/pm/pkg/component/ParsedActivityUtils.java
import static android.content.pm.ActivityInfo.LAUNCH_SINGLE_INSTANCE_PER_TASK;
import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED;
-
+import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE;
+import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_PORTRAIT;
import static com.android.server.pm.pkg.component.ComponentParseUtils.flag;
import static com.android.server.pm.pkg.parsing.ParsingUtils.NOT_SET;
import static com.android.server.pm.pkg.parsing.ParsingUtils.parseKnownActivityEmbeddingCerts;
@@ -54,7 +55,7 @@
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
-
+import com.xchengtech.ProjectConfig;
import java.io.IOException;
import java.util.List;
import java.util.Objects;
@@ -175,6 +176,13 @@
);
int screenOrientation = sa.getInt(R.styleable.AndroidManifestActivity_screenOrientation, SCREEN_ORIENTATION_UNSPECIFIED);
+
+ if (ProjectConfig.LANDSCAPE_ORIENTATION) {
+ if(screenOrientation == SCREEN_ORIENTATION_PORTRAIT){
+ screenOrientation = SCREEN_ORIENTATION_LANDSCAPE;
+ }
+ }
+
int resizeMode = getActivityResizeMode(pkg, sa, screenOrientation);
activity.setScreenOrientation(screenOrientation)
.setResizeMode(resizeMode);
修改文件:/system/vendor/mediatek/proprietary/packages/apps/Dialer/java/com/projectname/secretcode/publiccode/SoftwareVersion.java
import android.os.SystemProperties;
+import android.content.pm.ActivityInfo;
import com.android.internal.telephony.TelephonyProperties;
+import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE;
+import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_PORTRAIT;
import android.telephony.TelephonyManager;
import android.content.Intent;
import android.view.View;
+
import com.android.dialer.*;
+
import android.os.Handler;
import android.text.TextUtils;
import android.content.Context;
@@ -29,7 +35,7 @@
import com.xchengtech.ProjectConfig;
-public class SoftwareVersion extends Activity{
+public class SoftwareVersion extends Activity {
private static final String TAG = "SoftwareVersion";
private Context mContext;
private static TextView m_tag_text;
@@ -89,9 +95,13 @@
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
this.setContentView(R.layout.software_version);
- mContext=this;
+ mContext = this;
Intent i = getIntent();
- setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
+ if (ProjectConfig.XC_LANDSCAPE_ORIENTATION) {
+ setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
+ } else {
+ setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
+ }
init();
showSoftwareVersionExt();
}
@@ -123,50 +133,50 @@
if (m_compass_buffer != null) {
m_compass_buffer.setLength(0);
}
- if (m_memory_buffer != null){
+ if (m_memory_buffer != null) {
m_memory_buffer.setLength(0);
}
- if (m_lcd_buffer != null){
+ if (m_lcd_buffer != null) {
m_lcd_buffer.setLength(0);
}
- if (m_front_camera_buffer != null){
+ if (m_front_camera_buffer != null) {
m_front_camera_buffer.setLength(0);
}
- if (m_main_camera_buffer != null){
+ if (m_main_camera_buffer != null) {
m_main_camera_buffer.setLength(0);
}
- if (m_gSensor_buffer != null){
+ if (m_gSensor_buffer != null) {
m_gSensor_buffer.setLength(0);
}
- if (m_alpsInfo_buffer != null){
+ if (m_alpsInfo_buffer != null) {
m_alpsInfo_buffer.setLength(0);
}
- if (m_scan_buffer != null){
+ if (m_scan_buffer != null) {
m_scan_buffer.setLength(0);
}
- if (m_paraVersion_buffer != null){
+ if (m_paraVersion_buffer != null) {
m_paraVersion_buffer.setLength(0);
}
- mContext=null;
+ mContext = null;
}
private static String getString(String property) {
return SystemProperties.get(property, UNKNOWN);
}
- private boolean isSupportCompass(Context context){
- return context.getPackageManager().hasSystemFeature(PackageManager.FEATURE_SENSOR_COMPASS);
+ private boolean isSupportCompass(Context context) {
+ return context.getPackageManager().hasSystemFeature(PackageManager.FEATURE_SENSOR_COMPASS);
}
- private boolean isSupportFrontCamera(Context context){
- return context.getPackageManager().hasSystemFeature(PackageManager.FEATURE_CAMERA_FRONT);
+ private boolean isSupportFrontCamera(Context context) {
+ return context.getPackageManager().hasSystemFeature(PackageManager.FEATURE_CAMERA_FRONT);
}
-
+
private static boolean hasFeatureSupport(Context context, String featureName) {
return context.getPackageManager().hasSystemFeature(featureName);
}
- public static String getBomInfo(){
+ public static String getBomInfo() {
String bomInfo = "";
try {
FileInputStream fis = new FileInputStream(
@@ -202,7 +212,7 @@
m_compass_text = (TextView) findViewById(R.id.compass_info_text);
m_compass_content = (TextView) findViewById(R.id.compass_info_content);
- if(ProjectConfig.P8_FIRMWARE || !hasFeatureSupport(mContext, PackageManager.FEATURE_SENSOR_COMPASS)){
+ if (ProjectConfig.P8_FIRMWARE || !hasFeatureSupport(mContext, PackageManager.FEATURE_SENSOR_COMPASS)) {
m_compass_text.setVisibility(View.GONE);
m_compass_content.setVisibility(View.GONE);
}
@@ -211,28 +221,28 @@
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)){
+ if (!hasFeatureSupport(mContext, PackageManager.FEATURE_CAMERA_FRONT)) {
m_front_camera_text.setVisibility(View.GONE);
m_front_camera_content.setVisibility(View.GONE);
}
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)){
+ 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);
- if(!hasFeatureSupport(mContext, PackageManager.FEATURE_SENSOR_ACCELEROMETER)){
+ if (!hasFeatureSupport(mContext, PackageManager.FEATURE_SENSOR_ACCELEROMETER)) {
m_gSensor_text.setVisibility(View.GONE);
m_gSensor_content.setVisibility(View.GONE);
}
m_alpsInfo_text = (TextView) findViewById(R.id.alpsinfo_text);
m_alpsInfo_content = (TextView) findViewById(R.id.alpsinfo_content);
- if(!hasFeatureSupport(mContext, PackageManager.FEATURE_SENSOR_PROXIMITY)){
+ if (!hasFeatureSupport(mContext, PackageManager.FEATURE_SENSOR_PROXIMITY)) {
m_alpsInfo_text.setVisibility(View.GONE);
m_alpsInfo_content.setVisibility(View.GONE);
}
@@ -242,19 +252,19 @@
m_tag_layout = (LinearLayout) findViewById(R.id.tag_layout);
m_bom_layout = (LinearLayout) findViewById(R.id.bom_layout);
- m_usbcamera_layout = (LinearLayout)findViewById(R.id.usbcamera_layout);
+ m_usbcamera_layout = (LinearLayout) findViewById(R.id.usbcamera_layout);
m_bom_layout.setVisibility(View.GONE);
m_scan_text = (TextView) findViewById(R.id.scan_text);
m_scan_content = (TextView) findViewById(R.id.scan_content);
-
+
m_paraVersion_text = (TextView) findViewById(R.id.paraVersion_text);
m_paraVersion_content = (TextView) findViewById(R.id.paraVersion_content);
- m_usbcamera_text = (TextView)findViewById(R.id.usbcamera_text);
- m_usbcamera_content = (TextView)findViewById(R.id.usbcamera_content);
+ m_usbcamera_text = (TextView) findViewById(R.id.usbcamera_text);
+ m_usbcamera_content = (TextView) findViewById(R.id.usbcamera_content);
getDeviceInfo("MEMINFO", m_memory_buffer);
getDeviceInfo("TPINFO", m_tp_buffer);
@@ -269,22 +279,22 @@
getDeviceInfo("CPUINFO", m_cpu_buffer);
}
- private void getDeviceInfo(String deviceName, StringBuffer device_buffer){
- android.util.Log.v("wch","file:" + "device_info/" + deviceName);
+ private void getDeviceInfo(String deviceName, StringBuffer device_buffer) {
+ android.util.Log.v("wch", "file:" + "device_info/" + deviceName);
try {
FileInputStream fis = new FileInputStream(
- "sys/devices/platform/device_info/" +deviceName);
+ "sys/devices/platform/device_info/" + 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){
+ android.util.Log.v("wch", "br:" + br);
+ while ((ch = br.readLine()) != null) {
device_buffer.append(ch);
- if("ParaVersion".equals(deviceName)){
+ if ("ParaVersion".equals(deviceName)) {
device_buffer.append("\n");
}
}
- android.util.Log.v("wch","device_buffer:" + device_buffer);
+ android.util.Log.v("wch", "device_buffer:" + device_buffer);
fis.close();
} catch (FileNotFoundException e) {
device_buffer.append("No" + device_buffer + "file found");
@@ -292,14 +302,15 @@
} catch (IOException e) {
device_buffer.append("Error reading " + device_buffer + "file");
device_buffer.append(e);
- Log.w(TAG, "Error reading" + device_buffer +" file", 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) {
+
+ private void showSoftwareVersionExt() {
+ if (true) {
m_tag_text.setText("TAG:");
m_tag_content.setText(SystemProperties.get("ro.product.internal_version"));
@@ -313,22 +324,22 @@
String bom = SystemProperties.get("persist.sys.xc.hardware.bominfo");
m_bom_content.setText(bom);
- if(bom != null && bom.startsWith("d1_")){
+ if (bom != null && bom.startsWith("d1_")) {
m_bom_layout.setVisibility(View.VISIBLE);
if (m_cpu_buffer.toString().equals("MT8766B")) {
- m_cpu_buffer.delete(0, m_cpu_buffer.length());
- m_cpu_buffer.append("MT8766WB");
+ m_cpu_buffer.delete(0, m_cpu_buffer.length());
+ m_cpu_buffer.append("MT8766WB");
}
m_cpu_content.setText(m_cpu_buffer);
-
+
String usbcamera_info = "";
- if(bom.equals("d1_c1")){
+ if (bom.equals("d1_c1")) {
usbcamera_info += "Camera:" + SystemProperties.get("persist.sys.usb.camera");
}
usbcamera_info += "Scanner:" + SystemProperties.get("persist.sys.usb.scanner");
m_usbcamera_text.setText("USB Camera:");
m_usbcamera_content.setText(usbcamera_info);
- }else{
+ } else {
m_usbcamera_layout.setVisibility(View.GONE);
}
} else {
@@ -337,10 +348,10 @@
}
- if(getWifiOnlyFlag()){
+ if (getWifiOnlyFlag()) {
m_modem_text.setVisibility(View.GONE);
m_modem_content.setVisibility(View.GONE);
- }else{
+ } else {
m_modem_text.setText("Modem Version:");
showModem();
}
@@ -369,7 +380,7 @@
m_alpsInfo_text.setText("ALSPS:");
m_alpsInfo_content.setText(m_alpsInfo_buffer);
-
+
m_paraVersion_text.setText("ParaVersion:");
m_paraVersion_content.setText(m_paraVersion_buffer);
@@ -395,11 +406,11 @@
};
- private static boolean getWifiOnlyFlag(){
+ private static boolean getWifiOnlyFlag() {
String str = android.os.SystemProperties.get("persist.sys.wifionly", "0");
- if("1".equals(str)){
+ if ("1".equals(str)) {
return true;
- }else{
+ } else {
return false;
}
}