[ROM][AOSP] AICP [UNOFFICIAL][8.1][N960F][09.11.18]

that_same_guy

Member
Feb 26, 2012
45
33
0
landscape bug fixed

hello @s3xxt0y
the landscape bug was driving me crazy i finally found a simple solution to it.. :)

with the help of the AOSP documentation and some online threads that gave me the confidence, i found out that an idc file can be created, to add special options for the input device. it is so simple, in fact I am sure that probably we'll manage to add more features or bind the spen function using it.. will report if I figured something out.

to fix the landscape S-Pen bug:
so simply unzip the attached file then paste in /system/usr/idc/. the file has one line of command, i used root explorer to do it. rebooted and the s pen now works in landscape position..
please add it to your rom.. honestly this rom is now perfect..
thank you a lot.

I will also send it to @phhusson so the gsi roms have this issues fixed by default.
 

Attachments

Last edited:
  • Like
Reactions: CodeFox and Nasty_z

that_same_guy

Member
Feb 26, 2012
45
33
0
Btw today I found anther great app for the s pen called xposed edge. So good. You can create gestures and bind keys. Very customizable. Alot of other features like draw on screen with a pen. I am still exploring. I was able to program my bigsby button to control music
 
Last edited:

CodeFox

Senior Member
Sep 7, 2014
363
525
133
Manchester
hello @s3xxt0y
the landscape bug was driving me crazy i finally found a simple solution to it.. :)

with the help of the AOSP documentation and some online threads that gave me the confidence, i found out that an idc file can be created, to add special options for the input device. it is so simple, in fact I am sure that probably we'll manage to add more features or bind the spen function using it.. will report if I figured something out.

to fix the landscape S-Pen bug:
so simply unzip the attached file then paste in /system/usr/idc/. the file has one line of command, i used root explorer to do it. rebooted and the s pen now works in landscape position..
please add it to your rom.. honestly this rom is now perfect..
thank you a lot.

I will also send it to @phhusson so the gsi roms have this issues fixed by default.
Great find! I'll look to try and get this added at some point. I need to resync my sources first as I wiped my VM. Good work!

With regards to the GSIs I don't think phh will bother, I'm pretty sure he isn't looking to support it anymore from the conversation he had with someone in our team.
 
  • Like
Reactions: that_same_guy

CodeFox

Senior Member
Sep 7, 2014
363
525
133
Manchester
hello @s3xxt0y
the landscape bug was driving me crazy i finally found a simple solution to it.. :)

with the help of the AOSP documentation and some online threads that gave me the confidence, i found out that an idc file can be created, to add special options for the input device. it is so simple, in fact I am sure that probably we'll manage to add more features or bind the spen function using it.. will report if I figured something out.

to fix the landscape S-Pen bug:
so simply unzip the attached file then paste in /system/usr/idc/. the file has one line of command, i used root explorer to do it. rebooted and the s pen now works in landscape position..
please add it to your rom.. honestly this rom is now perfect..
thank you a lot.

I will also send it to @phhusson so the gsi roms have this issues fixed by default.
Going to do a new build now I've got my sources working again. Will sync latest AICP and put in the rotation fix. We found another solution that we implemented to our GSI's so will see how that works. Will probably be tomorrow that I post it.
 
  • Like
Reactions: that_same_guy

that_same_guy

Member
Feb 26, 2012
45
33
0
S pen progress

Hello @s3xxt0y
I am not sure where to post this(please let me know if I better post it somewhere else), but through some experimentation on the spen on the original and current rom, using getevent and logcats, I feel like I found some info, especially exciting regarding the bluetooth, I am not sure it is any useful but I am going to post them for reference, hopefully someone could use them or maybe develop an AOSP bluetooth spen remote app. I know I am going to pay/donate for it :)

now before I mention all this, there is a couple of apps SPenCommand or GMD Spen Gestures that do some of the non-bluetooth work. I am using the GMD app, using which you can create actions when the spen is attached or detached, with which I could simulate the Spen menu in Samsung roms, I bound it to a custom shortcut menu I made with Xposed Edge app that has all the features of the spen menu. and I even used tasker to detect if screen is off, to call a note taking app Squid instead of this menu when it wakes up, simulating the screen off memo.

please forgive my brightscreen and bad video setup but I made a video showing this
Check SPen GMD.zip (attached) for the video

Now to the S Pen buttons, I am going to attach the actual file that has the stuff I captured (Buttons.zip), but here I am going to summarize what I think is happening
Code:
All from the same input device "sec_e-pen", using getevent and doing the following things I get:

[B]Spen Out     [/B]
EV_SW        0013                 00000001 

[B]Spen In    [/B]   
 EV_SW        0013                 00000000

_____________________________________


[B]Hover   [/B]        
EV_KEY       BTN_DIGI             DOWN                  digitizer starts sensing the spen
EV_ABS       ABS_DISTANCE         00000078           (reports spen distance from screen)
EV_ABS       ABS_X                000013a6                       (reports spen mouse coordinates)
EV_ABS       ABS_Y                00001544                      (reports spen mouse coordinates)
EV_KEY       BTN_DIGI             UP

[U][I][B]((ADDED Nov 10 not in txt file))
[/B][/I][/U][B]Hover and S  Button Click  [/B]        
EV_KEY       BTN_DIGI             DOWN                  digitizer starts sensing the spen
EV_ABS       ABS_DISTANCE         00000078           (reports spen distance from screen)
EV_ABS       ABS_X                000013a6                       (reports spen mouse coordinates)
EV_ABS       ABS_Y                00001544                      (reports spen mouse coordinates)
EV_KEY       BTN_STYLUS      DOWN                (spen button click regardless of it touching) 
EV_KEY       BTN_STYLUS       UP
EV_KEY       BTN_DIGI             UP


[B]Hover then Spen Touch Screen  [/B]
EV_KEY       BTN_DIGI             DOWN              (same as above)
EV_ABS       ABS_X                000013a6
EV_ABS       ABS_Y                00001544  
EV_ABS       ABS_DISTANCE         00000078     (distance start getting smaller)                                                     
EV_ABS       ABS_DISTANCE         0000000a
EV_KEY       BTN_TOUCH            DOWN            (spen touching screen)
EV_ABS       ABS_PRESSURE         00000a79            (pressure sensitivity)
EV_ABS       ABS_DISTANCE         00000000            
EV_ABS       ABS_TILT_X           00000002            
EV_ABS       ABS_TILT_Y           00000001
EV_KEY       BTN_TOUCH            UP                     (spen away from screen)
EV_ABS       ABS_DISTANCE         00000001
EV_ABS       ABS_DISTANCE         00000038            
EV_KEY       BTN_DIGI             UP   

Note: every now and then there is     EV_SYN       SYN_REPORT           00000000  (not sure what does it exactly means)
Now for the exciting part here is a logcat of bluetooth button press in original samsung rom
Code:
11-03 09:02:16.104  8083  8094 D [AirCmd]_BleSpenDriver: GattCallback : onCharacteristicChanged : 68:A8:E1:E3:0D:27 / UUID_BUTTON_EVENT, PERM=0, RAWDATA : [1]DESC_CNT=2 [ DESC : UUID_CHARACTERISTIC_CONFIG, [1 0]] [ DESC : UNDEFINED:00002901-0000-1000-8000-00805f9b34fb, [nodata]] 
11-03 09:02:16.104  8083  8094 D [AirCmd]_BleSpenDriver: GattCallback : Button:1
11-03 09:02:16.403  8083  8083 D [AirCmd]_BleSpenClickGestureDetector: sendBleSpenClickEvent : single clicked
11-03 09:02:16.403  8083  8083 D [AirCmd]_RemoteSpenMainController: SpenEventListener : button clicked
11-03 09:02:16.404  8083  8083 D [AirCmd]_ScreenOffAndLockStateActionInvoker: ScreenOffAndLockStateActionInvoker invokeAction : isInteractive is true
11-03 09:02:16.404  8083  8083 D [AirCmd]_ScreenOffAndLockStateActionInvoker: ScreenOffAndLockStateActionInvoker invokeAction : mIsSatisfySpenUnlockCondition is false
11-03 09:02:16.404  8083  8083 D [AirCmd]_ScreenOffAndLockStateActionInvoker: ScreenOffAndLockStateActionInvoker invokeAction : screenOffReason is 3
11-03 09:02:16.405  8083  8083 D [AirCmd]_ScreenOffAndLockStateActionInvoker: ScreenOffAndLockStateActionInvoker invokeAction : Single, double click case
11-03 09:02:16.406  8083  8083 D [AirCmd]_CameraAvailabilityMonitor: isCameraPreviewOn : mIsCameraPreviewOn is false
11-03 09:02:16.409  8083  8083 D [AirCmd]_CameraAvailabilityMonitor: isCameraPreviewOn : mIsCameraPreviewOn is false
11-03 09:02:16.414  8083  8083 D [AirCmd]_MediaControlStateMonitor: getActivePackageName : noti count=5, session count=0
11-03 09:02:16.414  8083  8083 D [AirCmd]_PenActionRule: getAction : get default action data from remote action because pen action data is null.
11-03 09:02:16.414  8083  8083 D [AirCmd]_RemoteSpenMainController: invokeAction : no action present
11-03 09:02:16.414  8083  8083 D AC:AirCommand: onBleFloatingIconAnimationStart hasAction : false, isShowGuidePanel false
11-03 09:02:16.414  8083  8083 I AC:AirCommand_SAUtils: insertEventLog... screenID:105, eventID:1052, detail:com.sec.android.app.launcher_com.android.launcher3.Launcher_none, value:null
11-03 09:02:16.415  8083  8083 D SamsungAnalytics111040: user do not agree
11-03 09:02:16.416  8083  8083 V AC:AirCommand: play : 0x11
11-03 09:02:16.416  8083  8083 D AC:AirCommand: showBleFbShakeAnimator
Long Press
Code:
11-03 10:53:06.258  8083 16804 D [AirCmd]_BleSpenDriver: GattCallback : onCharacteristicChanged : 68:A8:E1:E3:0D:27 / UUID_BUTTON_EVENT, PERM=0, RAWDATA : [2]DESC_CNT=2 [ DESC : UUID_CHARACTERISTIC_CONFIG, [1 0]] [ DESC : UNDEFINED:00002901-0000-1000-8000-00805f9b34fb, [nodata]] 
11-03 10:53:06.258  8083 16804 D [AirCmd]_BleSpenDriver: GattCallback : Button:2
11-03 10:53:06.259  8083  8083 D [AirCmd]_RemoteSpenMainController: SpenEventListener : button long clicked
11-03 10:53:06.316  4865  6567 W ActivityManager: Slow operation: 54ms so far, now at getContentProviderImpl: after updateOomAdj
11-03 10:53:06.316  4865  6567 W ActivityManager: Slow operation: 54ms so far, now at getContentProviderImpl: done!
11-03 10:53:06.323  8083  8083 D [AirCmd]_ScreenOffAndLockStateActionInvoker: ScreenOffAndLockStateActionInvoker invokeAction : isInteractive is true
11-03 10:53:06.324  8083  8083 D [AirCmd]_ScreenOffAndLockStateActionInvoker: ScreenOffAndLockStateActionInvoker invokeAction : mIsSatisfySpenUnlockCondition is false
11-03 10:53:06.324  8083  8083 D [AirCmd]_ScreenOffAndLockStateActionInvoker: ScreenOffAndLockStateActionInvoker invokeAction : screenOffReason is 3
11-03 10:53:06.325  8083  8083 D [AirCmd]_ScreenOffAndLockStateActionInvoker: ScreenOffAndLockStateActionInvoker invokeAction : Long click case
11-03 10:53:06.332  8083  8083 D [AirCmd]_CameraAvailabilityMonitor: isCameraPreviewOn : mIsCameraPreviewOn is false
11-03 10:53:06.337  8083  8083 D [AirCmd]_CameraAvailabilityMonitor: isCameraPreviewOn : mIsCameraPreviewOn is false
11-03 10:53:06.345  8083  8083 D [AirCmd]_MediaControlStateMonitor: getActivePackageName : noti count=3, session count=1
11-03 10:53:06.346  8083  8083 D [AirCmd]_RemoteSpenMainController: showGuidePanel : rule is not proper type. ruleType=BASE
11-03 10:53:06.346  8083  8083 D [AirCmd]_PenActionInvoker: invokeAction : AppLaunchActionData

so I on your the AOSP AICP ROM, I did install two apps, LightBlue and nRF Connect that utilize the same BLE technology as the S Pen, I was excited that it was that simple it connected to it, you can read different services, I could find one that said Button State, and it turns out that if subscribing to the service using GATT server, you can stay connected to the device and wait for the specific service changes. (not my level though)

I was able to pair the device, read some information below is a screenshot



and specifically this service that screenshoted below has the name Button State, if service is subscribed to, (clicking the button) when clicking the button will give 01, if click and hold gives 02. screenshot below


I was sad to discover than neither of the apps does connect to tasker, nor easy to make them run & connect to spen by default on boot.

but nevertheless, I believe the info above is the key, a person that has some knowledge in Android app making and BLE libraries, has the will, and the time to invest can be a hero in this forum and maybe potential for some business, these would be the event triggers to create shortcuts, this will make the bluetooth in the spen functional in AOSP or maybe even allow to generalize it to any device e.g. people can hook up tasker to their smartwatches or so.

and I will go back to my daydreaming :)
 

Attachments

Last edited:

CodeFox

Senior Member
Sep 7, 2014
363
525
133
Manchester
Great stuff, I will flash it once its up. Thank you alot :)
OP Updated, new build here. Nice work on the post by the way and thanks for sharing the video. I'm surprised it works so well on an AOSP rom. Definitely a useful post, I definitely recommend maybe posting it in the guides forum and maybe title is as "SPen functionality on AOSP ROMs" maybe. It's something I'm sure a lot of people would love to know about! I've not gotten around to trying it out yet as I've been constantly wiping and flashing new test builds of pie based roms, but will definitely be downloading GMD Tonight.
 

that_same_guy

Member
Feb 26, 2012
45
33
0
Brightness control on my phone is not working, it's stuck on full brightness. Does anybody else facing the same issue?
Yes it is a known issue, in fact alot of other gsi roms have zero brightness control. Cuz how samsung probably implemented it. But This rom fixed the issue but it gets stuck on max until you reboot.

If you reboot it Should get back to normal. I just avoid setting brightness to max. Unless i need it. Not a deal breaker for me

---------- Post added at 12:09 PM ---------- Previous post was at 12:01 PM ----------

Will Dolby atmos work on this rom
I never installed it, found magisk modules non of them support oreo except one. It was built for oneplus X. Was able to install but no luck for me. (Disclaimer: i dont have gapps on)
Let me know if there is a special one i can test it for you.

But tried viper4android and was working fine. Could change equalizer settings, gain control.. Was working great

If you didnt try the rom, i would suggest backing up eith twrp and trying it. There is a ton of customizations. Out of all the AOSP roms I have tried nothing compares to this. And very smooth and stable.
Thanks to s3xxt0y
 
Last edited:
  • Like
Reactions: nikhil34a

Nasty_z

Senior Member
Feb 17, 2012
1,494
646
143
Manama, Bahrain
hello @s3xxt0y , problem here after the last bulid on my N9 the phone dont recognize my simcard and now if i install a stock rom i still have the problem
Sounds like your efs is corrupted. You need to install the stock firmware using Odin. And make sure you backup your efs right after rooting the phone using Dr.ketans root guide in the guides section.

P.s this isn't a rom specific issue. I've had this happen to me on Samsung ROMs too. By backing up the efs partition, you can restore it at anytime when your efs gets corrupted (this way, you don't have to flash stock using Odin every time this happens)
 
  • Like
Reactions: andropest

Gabe2014

Senior Member
Jan 19, 2014
440
197
43
Sounds like your efs is corrupted. You need to install the stock firmware using Odin. And make sure you backup your efs right after rooting the phone using Dr.ketans root guide in the guides section.

P.s this isn't a rom specific issue. I've had this happen to me on Samsung ROMs too. By backing up the efs partition, you can restore it at anytime when your efs gets corrupted (this way, you don't have to flash stock using Odin every time this happens)
can you help me , can i PM you ?