Originally Posted by shaji_ka_71
A bit of progress on the aircommand investigation check the notification in the screenshot. It has been triggered manually
Hope we can crack it up further.
Sent from my GT-I9500 using xda app-developers app
Further to my previous post, a bit of how I managed to trigger "SPen detached"
Like I mentioned earlier I have found in the framework.jar and framework2.jar files most of the coding for the Air Command.
After going through a lot of coding, I have found two intents that gets broadcast and possibly triggers the Aircommand.
You can try manually the following
1) From a terminal session on the mobile
a) su (This will give you root previlages)
b) am broadcast -a com.samsung.pen.INSERT
This will broadcast the pen detached intent and triggers the Pen detached function
Note I had already used the Gesture Search Play Store App and set up the Pen Settings to trigger the AIR Command on Pen Detachment in the settings. Ideally when the S-Pen is detached in Note 3 the Air command gets triggered, if enabled in Setting. But still the Air Command does not get triggered in our S4 and gives us the message that SPen has been detached and suggests possible apps to use with S-Pen.
May be porting the framework.jar, framework2.jar and Framework-Res.apk from Note 3 to our S4 might trigger it.
We need to explore this further
2) From your PC and mobile connected
a) ADB SHELL
c) am broadcast -a com.samsung.pen.INSERT
There is one more intent that possibly triggers the broadcast when the side button is clicked in the SPen
See the codes below
private void broadcastAirButtonShowState(boolean flag)
Intent intent = new Intent();
Log.i("AirButtonImpl", (new StringBuilder()).append("broadcastAirButtonShowSta te() isShow=").append(flag).toString());
I have not been able to trigger manually the intent com.sec.android.intent.action.AIR_BUTTON by passing the additional flags and parameters isShow and true
So you all can start exploring and hope we can do it.
Most of the codes are there in the S4 Framework files, though I have not done a one to one comparison of the codes with Note 3.
May be Samsung wanted us to use S-Pen Functions, though not the stylus as such
For triggering the Action Memo using a broadcast use
am broadcast -a android.intent.action.QUICKMEMO_LAUNCH