yashsingh1/xdaforums huggingface dataset:
[Android Q&A, Help & Troubleshooting] arihan9675:
I followed this too, but any image with flags like

ro.secure=0
security.perf_harden=0
ro.allow.mock.location=1
ro.debuggable=1
ro.adb.secure=0

refuses to boot, I just get a blank screen with no adb access.
[Android Q&A, Help & Troubleshooting] bigwigs:
This happens to both recovery.img & boot.img or just boot.img?

Android 13 security has made some changes. You would need to look into those.

check out - https://android.googlesource.com/platform/bootable/recovery/+/refs/tags/android-13.0.0_r76
[Android Q&A, Help & Troubleshooting] arihan9675:
I've only been trying custom recovery.img's so far.

I was under the impression that the stock firmware is android 11.
[Android Q&A, Help & Troubleshooting] bigwigs:
oh ok, i thought u were do it for android gsi
[Android Q&A, Help & Troubleshooting] bigwigs:
Effort to create generic wiki is complete - https://github.com/aimindseye/hisense-a9

Now time to play around :)
[Android Q&A, Help & Troubleshooting] bigwigs:
how are you trying to get into recovery mode?

via fastbootd or abd reboot recovery or using power + volume buttons?
[Android Q&A, Help & Troubleshooting] vbhai:
Yeah, adding those adb flags to default.prop causes a blank screen.

Shall have to dig deeper to boot recovery with ADB enabled.

@Renate Any ideas? Was looking at this guide:

[Guide] Enable ADB on the stock OxygenOS recovery

Since we don't have TWRP yet for our 8T, having ADB enabled on the stock recovery can be really helpful if you are unlocked and rooted. For example, removing problematic magisk modules. I tried to install the EdExposed module and ended with a...

xdaforums.com

Stock recovery is there in the stock ROM dump if anyone wants to play around and unpack.
[Android Q&A, Help & Troubleshooting] bigwigs:
I'm unable to push apk to /system/product/overlay

******************

D:\A9\root\A9_Fastboot\windows-x86\bin>adb push treble-overlay-Hisense-HLTE556N.apk /system/product/overlay

treble-overlay-Hisense-HLTE556N.apk: 1 file pushed, 0 skipped. 41.4 MB/s (20830 bytes in 0.000s)

adb: error: failed to copy 'treble-overlay-Hisense-HLTE556N.apk' to '/system/product/overlay/treble-overlay-Hisense-HLTE556N.apk': remote couldn't create file: Read-only file system

D:\A9\root\A9_Fastboot\windows-x86\bin>adb remount

AVB verification is disabled, disabling verity state may have no effect

Remounted /system as RW

Remounted /vendor as RW

Remount succeeded

D:\A9\root\A9_Fastboot\windows-x86\bin>adb push treble-overlay-Hisense-HLTE556N.apk /system/product/overlay

treble-overlay-Hisense-HLTE556N.apk: 1 file pushed, 0 skipped. 39.7 MB/s (20830 bytes in 0.001s)

adb: error: failed to copy 'treble-overlay-Hisense-HLTE556N.apk' to '/system/product/overlay/treble-overlay-Hisense-HLTE556N.apk': remote couldn't create file: Read-only file system

******************
[Android Q&A, Help & Troubleshooting] Renate:
This is for recovery? Maybe your image with ramdisk is wrong?

I usually just patch adbd so that it doesn't care about that stuff.
[Android Q&A, Help & Troubleshooting] deny-bas-dns:
I had this issue. Plugging in wired apple earpods with mic and unplugging them fixed the internal mic issue.
[Android Q&A, Help & Troubleshooting] vbhai:
Flash this module:

GitHub - Magisk-Modules-Alt-Repo/magisk_overlayfs: Make system partition become read-write. Kernel must support overlayfs!

Make system partition become read-write. Kernel must support overlayfs! - Magisk-Modules-Alt-Repo/magisk_overlayfs

github.com

Let me know if you're able to mount system as RW after that.
[Android Q&A, Help & Troubleshooting] vbhai:
Why don't you flash a ROM with GAPPS by default? The Lineage GSI I shared before has HAPPS by default.
[Android Q&A, Help & Troubleshooting] vbhai:
Yes. I believe that's what the overlay was for: specified the correct brightness and temperature values in the overlay.

EDIT: Check what the values are for auto brightness and colour modes in this PR:

Merge pull request #94 from vbbot/pie · TrebleDroid/vendor_hardware_overlay@91062b3

Add Hisense A9 overlay

github.com
[Android Q&A, Help & Troubleshooting] bigwigs:
the system was mounted as RW as I was able to use root explorer to transfer the file from /downloads folder to /system/product/overlay . I just had move file from laptop to phone in /downloads folder. weird, why adb push was given error.

I was reading online , adb root privileges need to be given under developer options which was already there. it seems there is some clash with magisk and there were recommendations to disable magisk.
[Android Q&A, Help & Troubleshooting] bigwigs:
so, this will be added in next release or build of aosp android gsi and lineage gsi if they use that repository? No need to manually move treble apk?
[Android Q&A, Help & Troubleshooting] bigwigs:
(my personal opinion) even though the lineage gsi is working but it doesn't feel like eink phone. feels phone with bad lcd screen.

no luck in changing LTE Bands on android gsi and lineage gsi either

It is not service code issue per se as one is able to update 01877(rf_bc_config) and 06828( lte_bc_config ) based on

Unlocking bands for NA usage

As has been documented on many XDA forums, we can make modifications to NVRAM on Qualcomm devices to unlock RF and LTE bands that have been disabled by the OEM. I decided to take a crack at this on the Mi A2 Lite with some mixed results, and am...

xdaforums.com

The modem programming has blocked those CDMA/GSM bands as even if values change, you cannot force it via Network Signal Guru -get error that this is operation is not permitted.

For LTE bands, it just bricks phone in a way that Cellular/wifi become inaccessible. One needs to erase modemst1 and modemst2 and flash them n reboot.
[Android Q&A, Help & Troubleshooting] vbhai:
Yeah, @AndyYan does a monthly build. This overlay should automatically work for the Hisense in the next build cycle.
[Android Q&A, Help & Troubleshooting] zxczxc4:
@vbhai - you showed that the always on display was working, did you have to do anything special for that?

How does the AOD in LineageOS work? I'm assuming there's a dedicated builtin app / apk for it?

Here's what I'd want, and happy to develop / contribute to the development:

have black text on a white background

disable any text movement

my Samsung's AOD moves the clock every so often, I guess to prevent "burn in"

bonus: add an image / background to the AOD

I do like some aspects of the stock hisense, primarily the AOD / lockscreen, and it would be amazing to have on LOS!
[Android Q&A, Help & Troubleshooting] vbhai:
There is a setting in @phhusson's GSI settings which enables always on display. Just enabled that.
[Android Q&A, Help & Troubleshooting] bigwigs:
It is called Override force-dark under Developer Settings.

Damn,, all cryptic names!
[Android Q&A, Help & Troubleshooting] bigwigs:
LineageOS GSI

LineageOS 21 settings and steps for image provided by @vbhai - https://xdaforums.com/t/hisense-a9-root-reward-offered-snapdragon-662.4495809/post-89393053

Recommended Settings-

Qualcomm features:

1. Use alternate audio policy

2. Disable soundvolume effect

3. Disable stereo support on VoIP

Misc features:

1. Use system wide BT HAL

2. Override force-dark under Developer Settings

Phh Treble Settings: (For Volte & Wifi Settings)

IMS features

- Install IMS APK and reboot

- Request IMS Network

- Force the presence of 4G Calling Setting

Change preferred network type to LTE(Network & Internet- SIMs) if it is not.

Enable VOLTE(Network & Internet- SIMs) if it is not

Download treble file - https://xdaforums.com/t/hisense-a9-root-reward-offered-snapdragon-662.4495809/post-89393621

Place treble-overlay-Hisense-HLTE556N.apk in /system/product/overlay to enable automatic brightness(root required)

E-ink settings - Single click should open the menu and Double click should refresh the screen.

It was thrown together very quickly so might not work perfectly, no warranty and I might improve it a bit later if I run into any issues trying to daily drive.

1. Download and install the apk- app-release-no-temperature.apk - https://github.com/damianmqr/a9_accessibility_service/releases/tag/v0.4

2. Go to app info. Press 3 dots and choose "allow restricted settings".

3. Enable it in accessibility settings.

4. Grant root access when prompted.

5. Use e-ink button to launch menu and give "Display over other apps" permission when settings open

6. It should now be working, use e-ink button to confirm

**** If calling doesn’t work after gsi install .i.e. person on other side cannot hear u , then either use wired headset or Bluetooth headset/ earbuds etc to make call. After first successful call, the mic will start working. It is weird bug where for calls , mic seems not enabled initially.
[Android Q&A, Help & Troubleshooting] vbhai:
Thanks for putting this together, mate!
[Android Q&A, Help & Troubleshooting] bigwigs:
Even after setting this, the clock and date and not updating so even if there AOD, clock and date need to update.
[Android Q&A, Help & Troubleshooting] zxczxc4:
A quick look online, I can see alternative AOD apps.

I have no idea how they are with battery life as it seems like not a true replacement, just an additional overlay.

But on stock, I've been testing this one out for a few minutes:

AlwaysOn | Always On Display | F-Droid - Free and Open Source Android App Repository

Android app which adds an always on display. Free, no ads and open source.

f-droid.org

Not perfect, but seems like we can change the background image (can provide a while background image), and change the text color to black.
[Android Q&A, Help & Troubleshooting] SirMaynard:
For the unfamiliar, is there a simple guide for how to flash this lineage image?
[Android Q&A, Help & Troubleshooting] bigwigs:
If you are doing this first time, recommend having edl cable handy. Also, backup ur phone if needed.

Check out - https://github.com/aimindseye/hisense-a9/blob/main/updateandroidgsi.md

Make sure u have prerequisites done.
[Android Q&A, Help & Troubleshooting] damianmqr:
I've made a new release for the Accessibility Service that controls backlight colour and refresh modes.

The newest release can be found under

Release v1.4.1 · damianmqr/A9PatchingService

Add Quick Setting Tiles for Clearing Screen and Opening Settings Add support for Dark Colors in AOD Fix MusicView Album Cover retrieval and Add Placeholder Add Timeout for MusicView Add Saving the ...

github.com

This version (v0.5) comes with a lot of changes and is pretty experimental, these are

Refresh modes are now set and restored per-application

There is a settings button in the menu that allows for customization (disabling night mode button, disabling per-application modes, setting default per application mode and swapping single and double-click behaviour)

Brightness range has been fixed (previously I mistakenly thought the range was 0-100)

The current refresh mode is indicated by a different colour button in menu

Please not that despite the name this is tested on Hi Reader Pro, but should work the same on the A9,

Next release I'd probably make it easier to install and fix any issues found

EDIT: Be sure to get v0.5.2 if you want to try it out, I made a mistake in a default value for a setting which caused a crash of the service (Should have tested with cache cleared..)
[Android Q&A, Help & Troubleshooting] bigwigs:
Hisense A9 - LTE/GSM/WCMDA modifications are not possible based on my research and playing around for last couple of months.

This is either blocked in Qualcomm modem permanently or it requires some additional service code to update it via QXDM or manually updated qcn files via QPST or any other qualcommm tools.

LTE bands modifications by changing NV Items- 06828 and 65633 either results in brick with network access(wifi/cellular) disabled or no effect shown in Network Signal Guru.

For CDMA, GSM, modifying NV items is possible but newly added bands cannot be enforced by Network Signal Guru as it results in “ The operation is prohibited” error.

So, atleast for me this phone either becomes a dumb phone equivalent which I can use for distraction free time or sell n move on. This no way can replace my existing phone.

Attaching screenshots of Network Signal Guru.
[Android Q&A, Help & Troubleshooting] vbhai:
Here is @AndyYan Lineage 21 build of the GSI ROM for the Hisense A9. Has the following features:

1. The overlay is installed by default which enables automatic brightness etc.

2. DPI is fixed for the Hisense- change added in the build.prop

ro.sf.lcd_density=360

3. Added the accessibility service for the Hisense that @sperhoooo wrote. It is enabled by default and is granted the necessary permission to draw on other apps. Superuser permission is redundant and not required since this is made a system app by default and is put inside /system/priv-app

4. Added this code in /system/etc/init/vndk.rc to disable HW overlays on startup and enable @sperhoooo accessibility service and grant it the necessary permissions. Credit to @phhusson for pointing out how to execute commands on startup:

on property:sys.boot_completed=1
start phh_on_boot
chown wifi system /data/misc/wifi
chown system wifi /data/misc/wifi/hostapd.conf
exec_background u:r:phhsu_daemon:s0 root -- /system/bin/service call SurfaceFlinger 1008 i32 1
exec_background u:r:phhsu_daemon:s0 root -- /system/bin/settings put secure enabled_accessibility_services com.lmqr.ha9_comp_service/.A9AccessibilityService
exec_background u:r:phhsu_daemon:s0 root -- /system/bin/appops set com.lmqr.ha9_comp_service SYSTEM_ALERT_WINDOW allow

5. The treble GSI settings should be enabled by default once this pull request is merged:

Fix Hisense A9 vendor fingerprint by vbbot · Pull Request #1 · TrebleDroid/treble_presets

Presets for various Treble devices on TrebleDroid GSIs - Fix Hisense A9 vendor fingerprint by vbbot · Pull Request #1 · TrebleDroid/treble_presets

github.com

Make sure that you connect to the internet while setting the phone up. Set it up with Vysor/Scrcpy initially.

Till the time the pull request is not merged, the settings you should enable in Phh Treble Settings are:

1. Qualcomm Features:

- Use alternate audio policy

- Disable soundvolume effect

- Disable stereo support on VoIP

2. IMS features:

- Install IMS APK for Qualcomm vendor

- Request IMS network

- Force the presence of 4G Calling setting

3. Misc features:

- Disable HW overlays

- Force allow Always-On Display (optional)

- Use System Wide BT HAL (enabled by default)

Once again, these settings should get enabled by default once you connect to the internet during phone setup and when the pull request to fix the Hisense vendor fingerprint is merged.
[Android Q&A, Help & Troubleshooting] ferlanero:
Where is it?
[Android Q&A, Help & Troubleshooting] vbhai:
Forgot to attach it to the message. Attaching the file now.

EDIT: Done!
[Android Q&A, Help & Troubleshooting] bigwigs:
@dferreira , can u use the above code solve ur service issue? What are differences between ur service n @sperhoooo service apart from driver?
[Android Q&A, Help & Troubleshooting] vbhai:
Don't think there's any difference. The only thing I believe @dferreira was trying was to make it a system service which I've already done with the code mentioned in my previous message.

Though would he interesting to hear what he says.
[Android Q&A, Help & Troubleshooting] bigwigs:
Yeah, i want to see if there is an additional functionality or not. I think his approach might be different to, where he was planning to create service that would call driver using java code.
[Android Q&A, Help & Troubleshooting] dferreira:
My goal for the service is to have a service that any app can interact with via an exposed Context API and without root. So things like getSystemService("einkservice") will work on any app on that build. The accessibility service works, but I would rather have the service running on the background and have the speed modes as part of the notification tray, not a draw over the top drawer. Adjusting brightness and night light of the OS should change the respective settings of the display.

For example, my goal is for my service to run as part of the OS boot, thus you can see the LineageOS boot animation, and don't need to use Vysor/scrcpy to set the phone up. I want it to be as close as possible to OOTB experience for LineageOS. I'm doing this with a vendor overlay, which allows us to actually get official builds of LineageOS in the future. I found out we can use prebuilt kernel as well, so you can also get official updates with LineageOS Recovery too. That's what I'm aiming for. I'm currently doing this with LineageOS 20 simply because that's where I started. Porting this to 21 after will be easier.

My challenge now is figuring out how to add my vendor overlay service to be accessible to the services.jar (framework/base/core) SystemServer. Right now it compiles, but then SystemServer says it can't find the EinkService.java. It's a class path problem.
[Android Q&A, Help & Troubleshooting] bigwigs:
Ok, thanks for detailed explanation.

This is similar to what currently EpdManager code does.

I was looking thro framework.jar and services.jar yesterday.

On startup , System services looks for settings to check for epd type set in build.prop and then instantiates service implementing EpdManager interface.

But if you are going this route, wouldn’t you need to have this service be called by every part of UI similarly to what vision apks do? The whole Hisense UI code is calling some part of EpdManager service (atleast it looks that way). This way , would there be issues with using 3rd party launchers like Niagara ?

I’m not familiar with Android working these days so I maybe wrong in my earlier assumptions.
[Android Q&A, Help & Troubleshooting] dferreira:
That's how Hisense implemented by adding application layer stuff into their EpdManager service. Really bad architecture.

My EpdManager service contains two methods (currently):

- clearScreen()

- setSpeedMode(EinkSpeed) where EinkSpeed is an Enum with the values we need for the kernel driver. So you can call `setSpeedMode(EinkSpeed.FAST) and it's the fastest refresh mode.

When calling these methods, the service updates the kernel driver without root. Any app can call these two methods from the service. On boot, I'm setting the default speed to Smooth and connecting to the display epd_connect so we see boot animation. Then in the notification tray, you can change it to other speed modes. Pressing the refresh button will call clearScreen(). The problem with the accessibility service is that it's not immediately available and we need to wait until the OS boots to be able to interact with the kernel driver.
[Android Q&A, Help & Troubleshooting] bigwigs:
As i said my android knowledge is not current but from the days when this was relevant - https://www.linaro.org/blog/adding-a-new-system-service-to-android-5-tips-and-how-to/

So, I guess you have check usual culprits of permission issues which result in class not found errors sometimes.

Have you decompiled the services.jar that gets created by ur build to check it contains all the stuff u need?
[Android Q&A, Help & Troubleshooting] dferreira:
I've checked and it's not there :) something is a miss on the Android.bp file to tell the build to add this overlay together with services.jar. Sadly not much online on how to do this for .bp. Google has changed a lot the build process and sadly even their AOSP documentation is not up to date.
[Android Q&A, Help & Troubleshooting] bigwigs:
see if this helps - https://medium.com/@number1shiksha/how-to-create-a-system-service-in-android-aosp-72cec54e28b4
[Android Q&A, Help & Troubleshooting] bigwigs:
New Android Build system - Soong-
[Android Q&A, Help & Troubleshooting] Renate:
Oh! I'm so glad.

I was afraid that my current knowledge would stay relevant.
[Android Q&A, Help & Troubleshooting] bigwigs:
Android needs to keep you on ur toes 😉
[Android Q&A, Help & Troubleshooting] Kandwo:
I'm very excited to follow the progress with LineageOS. I'm currently quite happy with the setup that I have on the stock ROM. The only thing that doesn't really work as it should is the echo on the other end when calling using apps (Telegram, Signal, etc) without earbuds/headphones. I hope that can be fixed on LineageOS since it must be software related (normal phone calls over 4G work fine). For now I'll just use headphones (they don't even have a mic, but still remove the echo).

The one thing I worry about is the task switcher/current open apps. Would that be portable? It looks great in the stock rom and is very useful with its 4 apps in contrast to the app carousel that barely shows 1,5 apps at any given time.

What are the main advantages as you see them of switching to LineageOS? Except for future updates and more control over the phone.

BTW, is this in any way relevant for LineageOS or the stock ROM? https://ledstrain.org/d/2714-new-tablet-giveaway-no-blue-light-no-flicker/2 (see the post about flickering/subpixel dithering)
[Android Q&A, Help & Troubleshooting] bigwigs:
since phone has eink screen and not lcd screen, there shouldn't be any concern with blue light etc, irrespective of which rom/gsi one uses.

Advantages of stock rom would be eink experience, aggressive battery management to make battery last longer( battery is not strong point of this device).

about echo fixing in lineageOS, don't know about it. I haven't had any issues with echo on app calls. I don't use Telegram or Signal, but whatsapp works great on stock rom.

With LineageOS, also no echo. I did make some settings on Lineage Settings as mentioned in above posts.
[Android Q&A, Help & Troubleshooting] vbhai:
The benefit of using Lineage is that there is no bloatware and tracking that the stock ROM has. Hisense goes to great lengths to have telemetry and other crap in its stock ROM.

Love the clean experience Lineage or AOSP offers.
[Android Q&A, Help & Troubleshooting] bigwigs:
Wish, we can get theme from stock rom somehow. Eink screen doesn't work well with all this Material themes.

Also, it has become so difficult to create themes now.
[Android Q&A, Help & Troubleshooting] dferreira:
In Developer Options, disable animations by setting delay to 0. Use adaptive theme and choose a white background for wallpaper. All apps with adaptive icon support will become black 😉
[Android Q&A, Help & Troubleshooting] dferreira:
As someone that did one of largest battery usage studies in academia, this backfires big time. Here is what happens: apps want to stay alive, OS tells them no. Infinite loop keeping app dead and they come back because they have a scheduler or alarm or push notification to awake the app. Your battery dies because of “zombie” wake up calls. Battery life IS better if manufacturers let the OS manage things. That’s why I like LineageOS: don’t f around, don’t find out.

If you are curious:

Understanding Human-Smartphone Concerns: A Study of Battery Life

This paper presents a large, 4-week study of more than 4000 people to assess their smartphone charging habits to identify timeslots suitable for opportunistic data uploading and power intensive operations on such devices, as well as opportunities to provide...

link.springer.com

Revisiting human-battery interaction with an interactive battery interface | Proceedings of the 2013 ACM international joint conference on Pervasive and ubiquitous computing

dl.acm.org
[Android Q&A, Help & Troubleshooting] vbhai:
Abaolutely

As usual, ridiculous pricing to get access to research. Gotta search for this on a site that ends with hub 👀
[Android Q&A, Help & Troubleshooting] dferreira:
They are also uploaded to ResearchGate or our university repo :) you can get them using Google Scholar. We have a open-science mandate!
[Android Q&A, Help & Troubleshooting] bigwigs:
I have done animation settings but scrolling is still not smooth. I would need to play around with brightness too.
[Android Q&A, Help & Troubleshooting] bigwigs:
@dferreira , did any of links I provided earlier,help in resolving ur service issues?
[Android Q&A, Help & Troubleshooting] dferreira:
You probably need to update the refresh rate of the eink to fast if you want it smooth - it will create ghosting.