Android 系统(framework)定制、修改 - 下篇

Android 系统(framework)定制、修改 - 下篇

转 https://blog.csdn.net/gjy_it/article/details/106189571

定位上篇

              Android 5.1 - 7.1 系统(framework)定制、修改、移植、总结 - 上篇

1:Android系统将位置信息模式默认设置为高精确度

GPS位置信息模式默认为“仅限设备”, 应客户的需求,需要默认为“高精确度”

请把 /frameworks/base/packages/SettingsProvider/res/values/defaults.xml

<string name="def_location_providers_allowed" translatable="false">gps</string>

 修改成

<string name="def_location_providers_allowed" translatable="false">gps,network</string>

 

2:Android 5.1 关闭通知栏通能

修改点:\frameworks\base\core\java\android\app\NotificationManager.java

  1.  
    /**
  2.  
         * Post a notification to be shown in the status bar. If a notification with
  3.  
         * the same id has already been posted by your application and has not yet been canceled, it
  4.  
         * will be replaced by the updated information.
  5.  
         *
  6.  
         * @param id An identifier for this notification unique within your
  7.  
         *        application.
  8.  
         * @param notification A {@link Notification} object describing what to show the user. Must not
  9.  
         *        be null.
  10.  
         */
  11.  
        public void notify(int id, Notification notification)
  12.  
        {
  13.  
        boolean close=false;
  14.  
        if(close)
  15.  
        {
  16.  
              notify(null, id, notification);
  17.  
        }
  18.  
         }

 

3:Android frameworks去掉熄屏前先变暗的功能 

设置>显示:这里可以设置自动休眠超时时间。

当设置为30s时,到24s左右屏幕会先变暗,告知用户屏幕快熄灭了,6s以后才会真正熄屏。

现在需要去掉这个功能,在PowerManagerService里可以看到

  1.  
    private int getScreenDimDurationLocked(int screenOffTimeout) {
  2.  
    return Math.min(SCREEN_DIM_DURATION,
  3.  
    (int)(screenOffTimeout * MAXIMUM_SCREEN_DIM_RATIO));
  4.  
    }

30S是系统里最短的超时时间,也就是说其他screenOffTimeout乘以0.2是比6要大的,所以就不用考虑了。


要想去掉DIM这个Feature,直接把SCREEN_DIM_DURATION设为0,这样getScreenDimDurationLocked()的返回值也就是0,这样就不再有屏幕先变暗这个步骤了。

实测可行。

4.屏蔽掉下拉通知栏和状态栏 

修改点:frameworks\base\packages\SystemUI\src\com\android\systemui\statusbar\phone\PhoneStatusBarView.java

  1.  
    @Override
  2.  
    public void addPanel(PanelView pv) {
  3.  
    super.addPanel(pv);
  4.  
    // if (pv.getId() == R.id.notification_panel) {
  5.  
    // mNotificationPanel = pv;
  6.  
    // } else if (pv.getId() == R.id.settings_panel){
  7.  
    // mSettingsPanel = pv;
  8.  
    // }
  9.  
    pv.setRubberbandingEnabled(!mFullWidthNotifications);
  10.  
    }

 

5 .android 修改MTP在PC端显示的制造商信息 

  1.  
    1. 修改build/tools/buildinfo.sh中的 ro.product.manufacturer
  2.  
    2.frameworks\av\media\mtp\MtpServer.cpp 的doGetDeviceInfo()
  3.  
    property_get("ro.product.manufacturer", prop_value, "unknown manufacturer");
  4.  
    string.set(prop_value);
  5.  
    修改此处的prop_value

 

6:高通8909 驱动修改充电电流限制[kernel]

定位文件:kernel/arch/arm/boot/dts/qcom/msm-pm8909.dtsi

  1.  
    pm8909_chg: qcom,charger {
  2.  
    ....
  3.  
    qcom,ibatsafe-ma = <1000>; // 1000 1A
  4.  
    qcom,thermal-mitigation = <1000 720 630 0>; //1000A
  5.  
    //qcom,ibatsafe-ma = <1440>; // 1.5A
  6.  
    //qcom,thermal-mitigation = <1440720 630 0>; //1.5A
  7.  
    qcom,cool-bat-decidegc = <100>;
  8.  
    qcom,warm-bat-decidegc = <450>;
  9.  
    qcom,cool-bat-mv = <4100>;
  10.  
    ....

或者直接修改

      kernel/drivers/power/qpnp-linear-charger.c     

   

  1.  
    return rc;
  2.  
    }
  3.  
     
  4.  
    #define QPNP_LBC_IBATMAX_MIN 90
  5.  
    #define QPNP_LBC_IBATMAX_MAX 1000 //最大充电电流限制
  6.  
    /*
  7.  
    * Set maximum current limit from charger
  8.  
    * ibat = System current + charging current
  9.  
    */
  10.  
    static int qpnp_lbc_ibatmax_set(struct qpnp_lbc_chip *chip, int chg_current)
  11.  
    {

 

6 .android 系统源码修改系统默认开机自动转屏

  1.  
    diff --git a/frameworks/base/packages/SettingsProvider/res/values/defaults.xml b/frameworks/base/packages/SettingsProvider/res/values/defaults.xml
  2.  
    index ff30452..c49b89e 100755
  3.  
    --- a/frameworks/base/packages/SettingsProvider/res/values/defaults.xml
  4.  
    +++ b/frameworks/base/packages/SettingsProvider/res/values/defaults.xml
  5.  
    @@ -150,7 +150,7 @@
  6.  
    <bool name="def_accessibility_display_magnification_auto_update">true</bool>
  7.  
     
  8.  
    <!-- Default for Settings.System.USER_ROTATION -->
  9.  
    - <integer name="def_user_rotation">0</integer>
  10.  
    + <integer name="def_user_rotation">-1</integer>
  11.  
     
  12.  
    <!-- Default for Settings.Secure.DOWNLOAD_MAX_BYTES_OVER_MOBILE. <=0 if no limit -->
  13.  
    <integer name="def_download_manager_max_bytes_over_mobile">-1</integer>

 

7 .android 系统源码修改MEID  返回IMEI

  1.  
    diff --git a/frameworks/opt/telephony/src/java/com/android/internal/telephony/cdma/CDMAPhone.java b/frameworks/opt/telephony/src/
  2.  
    index b791460..3e764c3 100644
  3.  
    --- a/frameworks/opt/telephony/src/java/com/android/internal/telephony/cdma/CDMAPhone.java
  4.  
    +++ b/frameworks/opt/telephony/src/java/com/android/internal/telephony/cdma/CDMAPhone.java
  5.  
    @@ -503,7 +503,7 @@ public class CDMAPhone extends PhoneBase {
  6.  
     
  7.  
    @Override
  8.  
    public String getMeid() {
  9.  
    - return mMeid;
  10.  
    + return mImei;
  11.  
    }
  12.  
     
  13.  
    //returns MEID or ESN in CDMA

 

6 .开机去掉没有插入SIM卡

  1.  
    diff --git a/vendor/qcom/proprietary/qrdplus/Extension/apps/PhoneFeatures/src/com/qualcomm/qti/phonefeature/SimDetector.java b/vendor/qcom/proprietary/qrdplus/Extension/apps/PhoneFeatures/src/com/qualcomm/qti/phonefeature/SimDetector.j
  2.  
    index bf8bdf8..f622291 100755
  3.  
    --- a/vendor/qcom/proprietary/qrdplus/Extension/apps/PhoneFeatures/src/com/qualcomm/qti/phonefeature/SimDetector.java
  4.  
    +++ b/vendor/qcom/proprietary/qrdplus/Extension/apps/PhoneFeatures/src/com/qualcomm/qti/phonefeature/SimDetector.java
  5.  
    @@ -331,7 +331,11 @@ public class SimDetector extends Handler implements OnClickListener, OnDismissLi
  6.  
    mNoSIMDialog.getWindow().setType(
  7.  
    WindowManager.LayoutParams.TYPE_SYSTEM_DIALOG);
  8.  
    mNoSIMDialog.setOnDismissListener(this);
  9.  
    - mNoSIMDialog.show();
  10.  
    +
  11.  
    + // add by guojianyong - remove no simcar tip dialog
  12.  
    + if(false){
  13.  
    + mNoSIMDialog.show();
  14.  
    + }
  15.  
    }
  16.  
     
  17.  
    public void onClick(DialogInterface dialog, int which) {

 

7 .单双卡设置

  1.  
    --- a/vendor/qcom/proprietary/qrdplus/Extension/config/default.prop
  2.  
    +++ b/vendor/qcom/proprietary/qrdplus/Extension/config/default.prop
  3.  
    @@ -11,8 +11,8 @@ persist.radio.restore_mode_pref=1
  4.  
    # hide internal OOS for 5s when modem is camping
  5.  
    persist.radio.ignore_dom_time=5
  6.  
     
  7.  
    -#set default multisim config to dsds
  8.  
    -persist.radio.multisim.config=dsds
  9.  
    +#set default multisim config to ssss
  10.  
    +persist.radio.multisim.config=ssss
  11.  
     
  12.  
    # enable face beautification
  13.  
    persist.ts.postmakeup=true

 

8. 根据不同的通道adb 命令播放声音

mm-audio-ftm高通的工厂测试命令

mm-audio-ftm -tc 8 -c /system/etc/ftm_test_config  -v 80 -file /system/etc/mmi/qualsound.wav

这条命令可以直接配通道

查看通道配置信息 /system/etc/ftm_test_config 

mm-audio-ftm -tc 8 -c /system/etc/ftm_test_config  -v 80 -file /system/etc/mmi/qualsound.wav
-tc 8 表示使用ftm_test_config的配置8

9. 修改状态栏信号强度不正确

  1.  
    diff --git a/frameworks/base/telephony/java/android/telephony/SignalStrength.java b/frameworks/base/telephony/java/android/telephony/SignalStrength.java
  2.  
    old mode 100644
  3.  
    new mode 100755
  4.  
    index c20764a..ea7ed82
  5.  
    --- a/frameworks/base/telephony/java/android/telephony/SignalStrength.java
  6.  
    +++ b/frameworks/base/telephony/java/android/telephony/SignalStrength.java
  7.  
    @@ -856,7 +856,10 @@ public class SignalStrength implements Parcelable {
  8.  
    * associated with LTE RSRP and the bars associated with the LTE
  9.  
    * RS_SNR
  10.  
    */
  11.  
    - return (rsrpIconLevel < snrIconLevel ? rsrpIconLevel : snrIconLevel);
  12.  
    +
  13.  
    + //xg change to fix the 4g signal strength not correct - 20190907
  14.  
    + //return (rsrpIconLevel < snrIconLevel ? rsrpIconLevel : snrIconLevel);
  15.  
    + return (rsrpIconLevel > snrIconLevel ? rsrpIconLevel : snrIconLevel);
  16.  
    }
  17.  
     
  18.  
    if (snrIconLevel != -1) return snrIconLevel;

 

posted @ 2020-09-14 00:34  中国人醒来了  阅读(3037)  评论(0编辑  收藏  举报