summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRockchip2015-09-11 11:41:21 +0800
committerRockchip2015-09-14 09:27:15 +0800
commita72b73e5cced726702acf5fbb5f37e4129950052 (patch)
tree3b65da756ead3df979897ed05d426519069ffb61
parenta4768485c3a64c861047ecb99f669f0d180c4377 (diff)
add support HDMI zoom for rk3128-sdk-5.1
Signed-off-by: Rockchip <service@rock-chips.com>
-rwxr-xr-xsrc/com/android/settings/HdmiScreenZoomPreference.java48
1 files changed, 36 insertions, 12 deletions
diff --git a/src/com/android/settings/HdmiScreenZoomPreference.java b/src/com/android/settings/HdmiScreenZoomPreference.java
index 213d976..74c0d7f 100755
--- a/src/com/android/settings/HdmiScreenZoomPreference.java
+++ b/src/com/android/settings/HdmiScreenZoomPreference.java
@@ -52,7 +52,7 @@ public class HdmiScreenZoomPreference extends SeekBarDialogPreference implements
private static final int MINIMUN_SCREEN_SCALE = 0;
private static final int MAXIMUN_SCREEN_SCALE = 20;
- private File HdmiScale = new File("/sys/class/graphics/fb0/scale");
+ private File HdmiScale;
private File DualModeFile = new File("/sys/class/graphics/fb0/dual_mode");
private SeekBar mSeekBar;
private int mOldScale = 0;
@@ -82,25 +82,25 @@ public class HdmiScreenZoomPreference extends SeekBarDialogPreference implements
if (mDisplayManagement != null &&
mDisplayManagement.getDisplayNumber() == 0)
- mDisplayManagement = null;
+ mDisplayManagement = null;
}
protected void setHdmiScreenScale(File file, int value) {
- if (mDisplayManagement == null || value < 0){
+ //if (mDisplayManagement == null || value < 0){
//if (!isHdmiConnected(HdmiState)) {
// return;
//}
- if (dualMode == 1) {
- SystemProperties.set("sys.hdmi_screen.scale",
- String.valueOf((char) value));
- } else {
- SystemProperties.set("sys.hdmi_screen.scale",
- String.valueOf((char) 100));
- }
- }else {
+ // if (dualMode == 1) {
+ // SystemProperties.set("sys.hdmi_screen.scale",
+ // String.valueOf((char) value));
+ // } else {
+ //SystemProperties.set("sys.hdmi_screen.scale",
+ // String.valueOf((char) 100));
+ //}
+ //}else {
HdmiScaleTask hdmiScaleTask=new HdmiScaleTask();
hdmiScaleTask.execute(value);
- }
+ //}
}
@@ -133,6 +133,12 @@ public class HdmiScreenZoomPreference extends SeekBarDialogPreference implements
@Override
protected void onBindDialogView(View view) {
super.onBindDialogView(view);
+
+ if(isRK3128()){
+ HdmiScale = new File("/sys/class/display/HDMI/scale");//3128使用
+ }else{
+ HdmiScale = new File("/sys/class/graphics/fb0/scale");
+ }
mFlag = false;
mSeekBar = getSeekBar(view);
@@ -256,4 +262,22 @@ public class HdmiScreenZoomPreference extends SeekBarDialogPreference implements
}
+ private boolean isRK3128() {
+ final String RK3128 = "RK3128";
+ try{
+ FileReader fr = new FileReader("/proc/cpuinfo");
+ BufferedReader br = new BufferedReader(fr);
+ String str;
+ while((str = br.readLine()) != null) {
+ if (str.contains(RK3128)) {
+ return true;
+ }
+ }
+ }catch(Exception e){
+ return false;
+ }
+ return false;
+ }
+
+
}