Android 7.1 系统 部分功能修改 汇总

1.修改蓝牙为从端 

device/qcom/msmxxx/system.prop
//设置成从模式
persist.service.bt.a2dp.sink=true
persist.service.bt.hfp.client=true


device/qcom/msmxxx/overlay/packages/apps/Bluetooth/res/values/config.xml


 
     true
     true
     true
     true
 

2.修改默认的睡眠超时和屏幕关闭超时 

device/qcom/msmxxx/overlay/frameworks/base/packages/SettingsProvider/res/values/defaults.xml

    2147483647
    2147483647

3.配置液晶屏密度

device/qcom/common/rootdir/etc/init.qcom.early_boot.sh


function set_density_by_fb() {
    #put default density based on width
    if [ -z $fb_width ]; then
        setprop ro.sf.lcd_density 320
    else
        if [ $fb_width -ge 1920 ]; then
           setprop ro.sf.lcd_density 320 # 1920x1080
        elif [ $fb_width -ge 1080 ]; then
           setprop ro.sf.lcd_density 480
        elif [ $fb_width -ge 1024 ]; then
           setprop ro.sf.lcd_density 160 # 1024x600
        elif [ $fb_width -ge 720 ]; then
           setprop ro.sf.lcd_density 320 #for 720X1280 resolution
        elif [ $fb_width -ge 480 ]; then
            setprop ro.sf.lcd_density 240 #for 480X854  resolution
        else
            setprop ro.sf.lcd_density 160
        fi
    fi
}

4.删除导航栏并锁定屏幕方向横向

device/qcom/msmxxx/overlay/frameworks/base/core/res/res/values/config.xml

   false
   false
frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java

 //addNavigationBar();


frameworks/base/services/core/java/com/android/server/wm/WindowManagerService.java

boolean updateOrientationFromAppTokensLocked(boolean inTransaction) {
    .    .........    
        //int req = getOrientationLocked();
         int req = ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE;
        .............
}

5.删除no_sim和new_sim对话框

vendor/qcom/proprietary/qrdplus/Extension/apps/PhoneFeatures/res/values/configs.xml

 false
false

6.adb设备序列号为空

kernel/msm-3.18/drivers/usb/gadget/android.c

// #if defined(CONFIG_DEBUG_ATOMIC_SLEEP)
//    id=0;
// #else 
    id = usb_string_id(cdev);
// #endif

7.增加自定义系统按键

device/qcom/common/base.mk
KEYPAD += aaaaa.kl


device/qcom/msm8953_64/AndroidBoard.mk

include $(CLEAR_VARS)
LOCAL_MODULE       := aaaaa.kl
LOCAL_MODULE_TAGS  := optional eng
LOCAL_MODULE_CLASS := ETC
LOCAL_SRC_FILES    := $(LOCAL_MODULE)
LOCAL_MODULE_PATH  := $(TARGET_OUT_KEYLAYOUT)
include $(BUILD_PREBUILT)


device/qcom/msmxxx/aaaaa.kl

key 0x17b   BACK_CAMERA
key 0x21e   ILL_LIGHT
key 0x74    POWER
frameworks/native/include/input/InputEventLabels.h
    
    DEFINE_KEYCODE(BACK_CAMERA),
    DEFINE_KEYCODE(ILL_LIGHT),


frameworks/native/include/android/keycodes.h

    AKEYCODE_BACK_CAMERA = 284,
    AKEYCODE_ILL_LIGHT = 285


frameworks/base/core/res/res/xml/global_keys.xml

 



frameworks/base/core/res/res/values/attrs.xml

   
   


frameworks/base/core/java/android/view/KeyEvent.java
   public static final int KEYCODE_BACK_CAMERA = 284;
   public static final int KEYCODE_ILL_LIGHT = 285;
   //private static final int LAST_KEYCODE = KEYCODE_SYSTEM_NAVIGATION_RIGHT;
    private static final int LAST_KEYCODE = KEYCODE_ILL_LIGHT;


    case KeyEvent.KEYCODE_BACK_CAMERA:
    case KeyEvent.KEYCODE_ILL_LIGHT:

8. user  支持 fastboot

bootable/bootloader/lk/makefile

#ifeq ($(TARGET_BUILD_VARIANT),user)
#  CFLAGS += -DDISABLE_FASTBOOT_CMDS=1
#endif

9.修改Telephony.getDeviceId 返回IMEI

frameworks/base/telephony/java/android/telephony/TelephonyManager.java

    /*public String getDeviceId(int slotId) {
        android.util.SeempLog.record_str(8, ""+slotId);
        // FIXME this assumes phoneId == slotId
        try {
            IPhoneSubInfo info = getSubscriberInfo();
            if (info == null)
                return null;
            return info.getDeviceIdForPhone(slotId, mContext.getOpPackageName());
        } catch (RemoteException ex) {
            return null;
        } catch (NullPointerException ex) {
            return null;
        }
    }*/
    public String getDeviceId(int slotId) {
        ITelephony telephony = getITelephony();
        if (telephony == null) return null;

        try {
            return telephony.getImeiForSlot(slotId, getOpPackageName());
        } catch (RemoteException ex) {
            return null;
        } catch (NullPointerException ex) {
            return null;
        }
    }

10.修改开机提示无网络问题 或者网络图标问题

frameworks/base/services/core/java/com/android/server/connectivity/NetworkMonitor.java

    //private static final String DEFAULT_HTTPS_URL     = "https://www.google.com/generate_204";
    //private static final String DEFAULT_HTTP_URL      =
    //        "http://connectivitycheck.gstatic.com/generate_204";
    //private static final String DEFAULT_FALLBACK_URL  = "http://www.google.com/gen_204";
    private static final String DEFAULT_HTTPS_URL     = "https://www.qualcomm.cn/generate_204";
    private static final String DEFAULT_HTTP_URL      =
              "http://www.qualcomm.cn/generate_204";
    private static final String DEFAULT_FALLBACK_URL  = "http://www.qualcomm.cn/generate_204";

11 .删除检查com.google.android.gms

frameworks/base/services/core/java/com/android/server/PersistentDataBlockService.java

  private int getAllowedUid(int userHandle) {

        //String allowedPackage = mContext.getResources()
        //        .getString(R.string.config_persistentDataPackageName);
        //PackageManager pm = mContext.getPackageManager();
        int allowedUid = -1;
        /*try {
            allowedUid = pm.getPackageUidAsUser(allowedPackage,
                    PackageManager.MATCH_SYSTEM_ONLY, userHandle);
        } catch (PackageManager.NameNotFoundException e) {
            // not expected
            Slog.e(TAG, "not able to find package " + allowedPackage, e);
        }*/

        return allowedUid;
    }

11 .在启动时启动警告消息服务

packages/apps/Settings/src/com/android/settings/FallbackHome.java

    private void maybeFinish() {
        if (getSystemService(UserManager.class).isUserUnlocked()) {
            final Intent homeIntent = new Intent(Intent.ACTION_MAIN)
                    .addCategory(Intent.CATEGORY_HOME);
            final ResolveInfo homeInfo = getPackageManager().resolveActivity(homeIntent, 0);
            if (Objects.equals(getPackageName(), homeInfo.activityInfo.packageName)) {
                Log.d(TAG, "User unlocked but no home; let's hope someone enables one soon?");
                mHandler.sendEmptyMessageDelayed(0, 500);
            } else {
                Log.d(TAG, "User unlocked and real home found; let's go!");
                
               //add code
                
                Intent warningIntent = new Intent();
                warningIntent.setPackage("com.pvetec.warningmessage");
                warningIntent.setAction("pvetec.intent.action.boot.disclaimer.service.start");
                startService(warningIntent);
               //add code

                getSystemService(PowerManager.class).userActivity(
                        SystemClock.uptimeMillis(), false);
                finish();
            }
        }
    

12 .用emmc和usbotg挂载路径

system/vold/PublicVolume.cpp

    idx = msyspath.find("2-1.2");
    if(idx == std::string::npos){

    } else {
        stableName = "usbotg-2-1.2";
    }

    idx = msyspath.find("mmc1:0002");
    if(idx == std::string::npos){

    } else {
        stableName = "mmc1-0002";
    }

13 .usb3.0和usb2.0设备安装路径

system/vold/PublicVolume.cpp

  idx = msyspath.find("xhci-hcd.0.auto/usb");
    if(idx == std::string::npos){

    } else {
        stableName = "usbotg-2-1.2";
    }

    idx = msyspath.find("mmc1:");
    if(idx == std::string::npos){

    } else {
        stableName = "mmc1-0002";
    }

 

 

 

 

 

 

 

 

你可能感兴趣的:(Framework,Java,Android)