Android 9 Source Code

This is my logs.
LOG_TAG: gps_serial
Nougat gps lib works fine.
Pie gps lib does not work.

I can provide prebuilt lib for test.

2 Likes

Can you also provide the prebuilt lib files, perhaps also upload the source code of the gps to Github or a tar zip file and a link to the gps device?
It might help so Khadas or others can fix it easier.

1 Like

Gps lib works perfect on vim1, 2, EDGE nougat, geekboox and many other boards. Need to fix Pie source.
I can send prebuilt lib on e-mail, without any upload and including on ROM.

2 Likes

device\rockchip\rk3399

diff --git a/device.mk b/device.mk
index 127d2cb..ea7ae57 100755
--- a/device.mk
+++ b/device.mk
@@ -601,6 +601,11 @@ PRODUCT_PACKAGES += \
     android.hardware.bluetooth@1.0-impl \
     android.hardware.bluetooth@1.0-service
 
+# GPS HAL
+PRODUCT_PACKAGES += \
+    android.hardware.gnss@1.0-impl \
+    android.hardware.gnss@1.0-service
+
 # for realtek bluetooth
 PRODUCT_PACKAGES += \
     bluetooth_rtk.default \

cd device\rockchip\rk3399

diff --git a/manifest.xml b/manifest.xml
index 409da27..3da69d8 100755
--- a/manifest.xml
+++ b/manifest.xml
@@ -171,6 +171,15 @@
             <instance>default</instance>
         </interface>
     </hal>
+     <hal format="hidl">
+        <name>android.hardware.gnss</name>
+        <transport>hwbinder</transport>
+        <version>1.0</version>
+        <interface>
+            <name>IGnss</name>
+            <instance>default</instance>
+        </interface>
+    </hal>
     <sepolicy>
         <version>26.0</version>
     </sepolicy>

Try adding, give me instant feedback.

2 Likes

I modified:

diff --git a/device.mk b/device.mk
index f4e279f..13574a6 100755
--- a/device.mk
+++ b/device.mk
@@ -70,6 +70,11 @@ PRODUCT_PACKAGES += \
      android.hardware.camera.provider@2.4-external-service
 endif
 
+# GPS HAL
+PRODUCT_PACKAGES += \
+    android.hardware.gnss@1.0-impl \
+    android.hardware.gnss@1.0-service
+
 # setup dalvik vm configs.
 $(call inherit-product, frameworks/native/build/tablet-10in-xhdpi-2048-dalvik-heap.mk)
 
diff --git a/manifest.xml b/manifest.xml
index 80f4ef0..afffa58 100755
--- a/manifest.xml
+++ b/manifest.xml
@@ -210,6 +210,15 @@
             <instance>armnn</instance>
         </interface>
     </hal>
+    <hal format="hidl">
+        <name>android.hardware.gnss</name>
+        <transport>hwbinder</transport>
+        <version>1.0</version>
+        <interface>
+            <name>IGnss</name>
+            <instance>default</instance>
+        </interface>
+    </hal>
 
 </manifest>

and add debug logs in gps library. This is logcat from Nougat with debug messages.

Some information: ROM Pie has:
/system/lib/android.hardware.gnss@1.0.so
/system/lib/android.hardware.gnss@1.1.so
/system/lib64/android.hardware.gnss@1.0.so
/system/lib64/android.hardware.gnss@1.1.so
/vendor/lib/hw/android.hardware.gnss@1.0-impl.so
/vendor/lib64/hw/android.hardware.gnss@1.0-impl.so

  1. Logcat from ROM without /system/lib/hw/gps.default.so and /system/lib64/hw/gps.default.so
  2. Logcat from ROM with /system/lib/hw/gps.default.so and /system/lib64/hw/gps.default.so
  3. Logcat from ROM with /vendor/lib/hw/gps.default.so and /vendor/lib64/hw/gps.default.so - It has gps_serial messages, but gps does not work.
2 Likes

In addition, add the following code to the following directory:
device\rockchip\common

+    <hal format="hidl">
+        <name>android.hardware.gnss</name>
+        <transport>hwbinder</transport>
+        <version>1.0</version>
+        <interface>
+            <name>IGnss</name>
+            <instance>default</instance>
+        </interface>
+    </hal>
2 Likes

I added it, but log is same.

Also I maked more tests, and I found some issue.
The logcat contains gps_serial messages only if I change the state of the gps.default.so files, like apply “chmod” for library files. After reboot, logcat does not contains gps_serial messages. It is very strange.

hwservicemanager: getTransport: Cannot find entry android.hardware.gnss@1.0::IGnss/default in either framework or device manifest.

It’s the same error, Whether confirm the manifest in the machine has been added successfully.

And there should be /vendor/bin/HW/android. hardware. gnss@1.0-service. Have you compiled this?

Yes, I added it:

davemf@ubuntu:~/EDGE_Pie/device/rockchip/common$ git diff
diff --git a/manifest.xml b/manifest.xml
index a9ca080..8ac56ab 100755
--- a/manifest.xml
+++ b/manifest.xml
@@ -200,6 +200,15 @@
             <instance>default</instance>
         </interface>
     </hal>
+    <hal format="hidl">
+        <name>android.hardware.gnss</name>
+        <transport>hwbinder</transport>
+        <version>1.0</version>
+        <interface>
+            <name>IGnss</name>
+            <instance>default</instance>
+        </interface>
+    </hal>
 
 </manifest>

/vendor/bin/HW/android. hardware. gnss@1.0-service is absents.

rk3399:/vendor/bin/hw # ls -la
total 4060
drwxr-xr-x 2 root shell    4096 2019-08-08 18:27 .
drwxr-xr-x 3 root shell    4096 2019-08-08 18:27 ..
-rwxr-xr-x 1 root shell   14968 2019-08-08 18:27 android.hardware.audio@2.0-service
-rwxr-xr-x 1 root shell   68344 2019-08-08 18:27 android.hardware.bluetooth@1.0-service
-rwxr-xr-x 1 root shell    6744 2019-08-08 18:27 android.hardware.camera.provider@2.4-external-service
-rwxr-xr-x 1 root shell    6744 2019-08-08 18:27 android.hardware.camera.provider@2.4-service
-rwxr-xr-x 1 root shell   37424 2019-08-08 18:27 android.hardware.cas@1.0-service
-rwxr-xr-x 1 root shell   69096 2019-08-08 18:27 android.hardware.configstore@1.1-service
-rwxr-xr-x 1 root shell   10844 2019-08-08 18:27 android.hardware.drm@1.0-service
-rwxr-xr-x 1 root shell  137648 2019-08-08 18:27 android.hardware.drm@1.1-service.clearkey
-rwxr-xr-x 1 root shell   20040 2019-08-08 18:27 android.hardware.drm@1.1-service.widevine
-rwxr-xr-x 1 root shell   68344 2019-08-08 18:27 android.hardware.gatekeeper@1.0-service
-rwxr-xr-x 1 root shell   68344 2019-08-08 18:27 android.hardware.graphics.allocator@2.0-service
-rwxr-xr-x 1 root shell   68344 2019-08-08 18:27 android.hardware.graphics.composer@2.1-service
-rwxr-xr-x 1 root shell  136144 2019-08-08 18:27 android.hardware.health@2.0-service
-rwxr-xr-x 1 root shell   68344 2019-08-08 18:27 android.hardware.keymaster@3.0-service
-rwxr-xr-x 1 root shell   68344 2019-08-08 18:27 android.hardware.light@2.0-service
-rwxr-xr-x 1 root shell   10952 2019-08-08 18:27 android.hardware.media.omx@1.0-service
-rwxr-xr-x 1 root shell   68344 2019-08-08 18:27 android.hardware.power@1.0-service
-rwxr-xr-x 1 root shell   68344 2019-08-08 18:27 android.hardware.sensors@1.0-service
-rwxr-xr-x 1 root shell   68344 2019-08-08 18:27 android.hardware.tv.cec@1.0-service
-rwxr-xr-x 1 root shell  410656 2019-08-08 18:27 android.hardware.wifi@1.0-service
-rwxr-xr-x 1 root shell  816400 2019-08-08 18:27 hostapd
-rwxr-xr-x 1 root shell   68352 2019-08-08 18:27 rockchip.hardware.outputmanager@1.0-service
-rwxr-xr-x 1 root shell 2520456 2019-08-08 18:27 wpa_supplicant

The firmware I compiled is exit. You can check it again.

hlm@Server:/users/hlm/9_Edge$ find out/target/product/ -iname "android.hardware.gnss@1.0-service"
out/target/product/rk3399/obj/EXECUTABLES/android.hardware.gnss@1.0-service_intermediates/LINKED/android.hardware.gnss@1.0-service
out/target/product/rk3399/obj/EXECUTABLES/android.hardware.gnss@1.0-service_intermediates/android.hardware.gnss@1.0-service
out/target/product/rk3399/obj/EXECUTABLES/android.hardware.gnss@1.0-service_intermediates/PACKED/android.hardware.gnss@1.0-service
out/target/product/rk3399/symbols/vendor/bin/hw/android.hardware.gnss@1.0-service
out/target/product/rk3399/vendor/bin/hw/android.hardware.gnss@1.0-service
hlm@Server:/users/hlm/9_Edge/device/rockchip/common$ git diff
diff --git a/manifest.xml b/manifest.xml
index a9ca080..125ee1d 100755
--- a/manifest.xml
+++ b/manifest.xml
@@ -201,5 +201,15 @@
         </interface>
     </hal>
 
+    <hal format="hidl">
+       <name>android.hardware.gnss</name>
+       <transport>hwbinder</transport>
+       <version>1.0</version>
+       <interface>
+           <name>IGnss</name>
+           <instance>default</instance>
+       </interface>
+   </hal>
+
 </manifest>

hlm@Server:/users/hlm/9_Edge/device/rockchip/rk3399$ git diff
diff --git a/device.mk b/device.mk
index e49f228..883fc6f 100755
--- a/device.mk
+++ b/device.mk
@@ -23,6 +23,11 @@ PRODUCT_PACKAGES += \
     displayd \
     libion
 
+# GPS HAL
+PRODUCT_PACKAGES += \
+    android.hardware.gnss@1.0-impl \
+    android.hardware.gnss@1.0-service
+
 #enable this for support f2fs with data partion
 BOARD_USERDATAIMAGE_FILE_SYSTEM_TYPE := f2fs
2 Likes

image
When you compile firmware, the download tool can’t point to the address where the firmware was generated, otherwise it can’t generate your modified firmware. It’s better to turn off the download tool when compiling firmware.

2 Likes

Ok, thank you.
I’ll rebuild ROM later.

Someone knows if this is possible?

Say you download an SDK, only .repo folder.
Now you use a PC without internet access or the Github source where the SDK was uploaded is now removed.
How can you extract the locally stored .repo folder(eg. 100GB) into the source code folders like kernel, u-boot, frameworks, device, external etc. since repo sync wants to connect to the internet to download latest code from Github which doesn’t work if you don’t have an internet connection or the original code was removed from Github?
It must be possible since all the code is already downloaded previously to your PC, just how to extract it locally?

1 Like
$ repo sync -d                        

-d The parameter representation is separated from the current branch and switched to the branch defined in manifest

1 Like

If you need update folder only, not all repo, you can use:

$ repo sync -d .

1 Like
hlm@Server:/users/hlm/test$ repo sync -d linux
Fetching project linux
Skipped fetching project linux (already have persistent ref)
Checking out project linux
Checking out files: 100% (61817/61817), done.
Syncing work tree: 100% (1/1), done.

hlm@Server:/users/hlm/test$ repo sync -d u-boot
Fetching project u-boot
Skipped fetching project u-boot (already have persistent ref)
Checking out project u-boot
Syncing work tree: 100% (1/1), done.

hlm@Server:/users/hlm/test$ la
.repo  kernel  u-boot

@goenjoy
May be Can I get you gps library for the test? What is your email?

I don’t have a GPS library.

I can send to your email.

Another example eg.
Someone else downloaded Rockchip SDK .repo folder for you
now you use the .repo folder on your PC but you don’t have access to the remote repositories because they are password protected.
How to extract already downloaded .repo folder?

If I run:
repo sync

… A new repo command ( 1.23) is available.
… You should upgrade soon:

cp /sdk/.repo/repo/repo /usr/bin/repo

git@www.rockchip.com.cn’s password: git@www.rockchip.com.cn’s password:

It asks for Rockchip ssh server password which I don’t have.
Can you skip this check so it uses local .repo folder(which already is the latest version files) and still extract it?

extract from manifest.xml contains:

<?xml version="1.0" encoding="UTF-8"? <manifest <remote name="aosp" fetch="ssh://git@www.rockchip.com.cn/gerrit/"/ <remote name="rk" fetch="ssh://git@www.rockchip.com.cn/gerrit/"/ <default remote="aosp" revision="refs/tags/android-9.0.0_r33" sync-j="4"/ <project name="RKDocs" path="RKDocs/rk3328" remote="rk" revision="rk3328/box/android-9.0"/ <project name="RKTools" remote="rk" revision="rk3328/atv/develop9.0"/ <project path="external/pcba_rockchip" name="rk/platform/external/rk-pcba-test" groups="pdk" remote="rk" revision="rk33/mid/9.0/develop-drm" / <project groups="pdk-cw-fs,pdk" name="device/common"/ <project groups="pdk" name="device/generic/arm64"/ <project groups="pdk" name="device/generic/armv7-a-neon"/