Archive for the android Category

Note: Wifi Country code in AOSP

Posted in android with tags , on 2017 年 11 月 15 日 by Kun-Yi

WIFI Country code follow ISO 3166 defined , see “WIFI_COUNTRY_CODE" in
the Country will auto change when USIM insert with Telecom signaling, see “setWifiCountryCodeFromMcc" in

MCC mean Mobile Country Code


Note: Tethering provision for Telecom operator config on Android

Posted in android with tags , on 2017 年 11 月 15 日 by Kun-Yi

use jgrep to search the below keywords, will got detail information, just need to change string resource, may to use override method like this

  • config_mobile_hotspot_provision_app
  • config_mobile_hotspot_provision_response
  • config_mobile_hotspot_provision_check_period
  • config_mobile_hotspot_provision_app_no_ui

And you need to check system property “net.tethering.noprovisioning" value

Note: How to make Android O v8.0.0_r4 for Hikey960

Posted in android with tags , on 2017 年 08 月 28 日 by Kun-Yi
  1.  ref .  Using Reference Boards step to download source code, but change branch name to android-8.0.0_r4, like the below
    repo init -u -b android-8.0.0_r4
  2.  repo sync -jN (#N for your Host machine, Normally use 8~12, dependency network, SSD/HDD state)
  3. change the below projects to master branch and checkout with special commit hash
    device/linaro/bootloader/OpenPlatfprmPkg — “ca8a8eeb"
    device/linaro/bootloader/arm-trusted-firmware — “d2baddd"
    device/linaro/bootloader/edk2 — “99d893a"
    device/linaro/hikey-kernel — “7517d7dbe"
    device/linaro/hikey — “0ac1c5c5c41
  4. modify device/linaro/hikey/hikey960/
    diff –git a/hikey960/ b/hikey960/
    index 00598e7..92321b4 100644
    — a/hikey960/
    +++ b/hikey960/
    @@ -3,8 +3,20 @@ include device/linaro/hikey/
    -TARGET_CPU_VARIANT := cortex-a73
    -TARGET_2ND_CPU_VARIANT := cortex-a73
    +TARGET_ARCH := arm64
    +TARGET_ARCH_VARIANT := armv8-a
    +TARGET_CPU_ABI := arm64-v8a
    +TARGET_CPU_VARIANT := generic
    +TARGET_2ND_ARCH := arm
    +TARGET_2ND_ARCH_VARIANT := armv7-a-neon
    +TARGET_2ND_CPU_ABI := armeabi-v7a
    +TARGET_2ND_CPU_ABI2 := armeabi
    +TARGET_2ND_CPU_VARIANT := generic
    +#TARGET_CPU_VARIANT := cortex-a73
    +#TARGET_2ND_CPU_VARIANT := cortex-a73
  5. make -jN (dependency your build machine, for me, the value is 8)
  6. waiting build success, then to ref. Using Reference Boards, for update your hikey960 board
  7. enjoy the play

Note: Hikey960 with Android v8.0.0_r1 boot success!

Posted in android with tags , on 2017 年 08 月 25 日 by Kun-Yi

終於把Hikey960 with Android O v8.0.0_r1 弄開機啦!

Note: Create a local mirror repo of CyanogenMod

Posted in android with tags on 2014 年 08 月 14 日 by Kun-Yi

1. create an AOSP local mirror repos
    mkdir -p ~/mirror_aosp
    cd ~/mirror_aosp
    repo init -u –mirror
    repo sync -j4

2. create CyanogenMod special branch/tag mirror repos
    mkdir ~/mirror_cm11
    cd ~/mirror_cm11
    repo init -u git:// -b cm-11.0 –mirror –reference=~/mirror_aosp
    repo sync -j4

3. fetch for local development
    mkdir ~/dev_cm11
    cd ~/dev_cm11
    repo init -u ~/mirror_cm11 -b cm-11.0 –reference=~/mirror_cm11
    repo sync -j10



Note: Android default/preferred network setting for RIL

Posted in android with tags , on 2014 年 08 月 11 日 by Kun-Yi

check the code snippet in for Android Jelly bean,

“property ro.telephony.default_network"

// Set the preferred network mode to 0 = Global, CDMA default
int type;
if (TelephonyManager.getLteOnCdmaModeStatic() == PhoneConstants.LTE_ON_CDMA_TRUE) {
type = Phone.NT_MODE_GLOBAL;
} else {
type = SystemProperties.getInt(“ro.telephony.default_network", RILConstants.PREFERRED_NETWORK_MODE);

loadSetting(stmt, Settings.Global.PREFERRED_NETWORK_MODE, type);

Note: Android HWC and CTS test item android.view.cts.DisplayRefreshRateTest

Posted in android with tags , , on 2014 年 07 月 01 日 by Kun-Yi

裏面有提到 HWComposer 需要回報 display 的一些資訊 如Resolution/DPI/Refresh rate 等等..

常見 android.view.cts.DisplayRefreshRateTest 測試不過就是這邊回報的值不正確

目前OMAP4 平台上是直接修改 hardware/ti/omap4xxx/hwc/display.c 內的 LCD_DISPLAY_FPS

更好的作法是kernel 按照目前的 pixel clock 與 LCD timinig 去算出正確的 refresh rate 然後 HAL 起來的時候去讀

更好的改法如下 (for OMAP4)


@@ -195,7 +195,10 @@ static void setup_config(display_config_t *config, int xres, int yres, struct ds
 static void setup_lcd_config(display_config_t *config, int xres, int yres, struct dsscomp_display_info *info)
-    setup_config(config, xres, yres, info, LCD_DISPLAY_FPS, LCD_DISPLAY_DEFAULT_DPI);
+    const uint32_t ht = info->timings.x_res + info->timings.hsw + info->timings.hfp + info->timings.hbp;
+    const uint32_t vt = info->timings.y_res + info->timings.vsw + info->timings.vfp + info->timings.vbp;
+    int fps = (info->timings.pixel_clock*100)/((ht*vt)/10);
+    setup_config(config, xres, yres, info, fps, LCD_DISPLAY_DEFAULT_DPI);