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 Settings.java
the Country will auto change when USIM insert with Telecom signaling, see “setWifiCountryCodeFromMcc" in MccTable.java

Tips:
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 https://android.googlesource.com/platform/manifest -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/BoardConfig.mk
    diff –git a/hikey960/BoardConfig.mk b/hikey960/BoardConfig.mk
    index 00598e7..92321b4 100644
    — a/hikey960/BoardConfig.mk
    +++ b/hikey960/BoardConfig.mk
    @@ -3,8 +3,20 @@ include device/linaro/hikey/BoardConfigCommon.mk
    TARGET_BOOTLOADER_BOARD_NAME := hikey960
    TARGET_BOARD_PLATFORM := hikey960
    -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 弄開機啦!

https://plus.google.com/u/0/photos/115270660462348164673/album/6458121557908343953/6458121562021074946?authkey=CIHysdm7oNflwQE

https://plus.google.com/u/0/photos/115270660462348164673/album/6458121557908343953/6458121565094052034?authkey=CIHysdm7oNflwQE

https://plus.google.com/u/0/photos/115270660462348164673/album/6458121557908343953/6458121562288292002?authkey=CIHysdm7oNflwQE

https://plus.google.com/u/0/photos/115270660462348164673/album/6458121557908343953/6458121565165748434?authkey=CIHysdm7oNflwQE

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 https://android.googlesource.com/mirror/manifest –mirror
    repo sync -j4

2. create CyanogenMod special branch/tag mirror repos
    mkdir ~/mirror_cm11
    cd ~/mirror_cm11
    repo init -u git://github.com/CyangenMod/android.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

ref.

  1. https://source.android.com/source/downloading.html#using-a-local-mirror
  2. https://www.excentral.org/archives/2011/02/24/android-repo-mirroring

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 DatabaseHelper.java 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

https://source.android.com/devices/reference/hwcomposer_8h_source.html

裏面有提到 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);
 }