trigger for closing s cover (samsung)

Post your feature requets for new triggers, conditions, actions and other improvements.

Moderator: Martin

henkster
Posts: 23
Joined: 08 Feb 2014 10:52

trigger for closing s cover (samsung)

Post by henkster » 07 Mar 2014 13:09

I was wondering if it would be possible to have a trigger for closing s cover (samsung).
normally it would trigger the built in app s view. but alongside that, i want to change screen timeout for example. or other things.
Kind regards for your respons!

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: trigger for closing s cover (samsung)

Post by Martin » 07 Mar 2014 13:54

To my knowledge Android has no API for this and Samsung does not provide an extension to access the feature so it's probably not possible to add a trigger in Automagic.

On a rooted device you could check if the system log prints something special when the cover is closed and react to this output with trigger Command Output: logcat -c; logcat -v time *:D (check: as root).

Regards,
Martin

henkster
Posts: 23
Joined: 08 Feb 2014 10:52

Re: trigger for closing s cover (samsung)

Post by henkster » 08 Mar 2014 21:39

Okay i did. Now what? Thw flow had an emergency stop. The phone is rooted by the way
Last edited by henkster on 08 Mar 2014 21:44, edited 1 time in total.

henkster
Posts: 23
Joined: 08 Feb 2014 10:52

Re: trigger for closing s cover (samsung)

Post by henkster » 08 Mar 2014 21:42

Where can i find the system log?

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: trigger for closing s cover (samsung)

Post by Martin » 10 Mar 2014 16:57

You can test-execute the command directly in the trigger Command Output by using the button 'Test command...'.
This should print the log in a new window.

PaulyQ
Posts: 29
Joined: 18 Oct 2013 20:36

Re: trigger for closing s cover (samsung)

Post by PaulyQ » 12 Mar 2014 20:22

Found this on Stack Overflow:

"Search for com.samsung.cover.OPEN or com.samsung.ssrm.COVER_OPEN

In the extras, coverOpen will tell you if the cover opened or closed"

henkster
Posts: 23
Joined: 08 Feb 2014 10:52

Re: trigger for closing s cover (samsung)

Post by henkster » 13 Mar 2014 07:35

Okay but how to trigger it with automagic?

PaulyQ
Posts: 29
Joined: 18 Oct 2013 20:36

Re: trigger for closing s cover (samsung)

Post by PaulyQ » 13 Mar 2014 19:05

The trigger is "General Broadcast". If you copy either
"com.samsung.cover.OPEN" or "com.samsung.ssrm.COVER_OPEN" into the action field
Then use Access Intent Extras field to extract result then you should be angle to see if you have opened or closed the cover. Unfortunately, I'm on a Note 2 and don't use the S View cover so I can't test it myself. I've added a flow for testing if Spen is detached as nearest example of this that I have.

http://automagic4android.com/flow.php?i ... 9a1b2683a5

henkster
Posts: 23
Joined: 08 Feb 2014 10:52

Re: trigger for closing s cover (samsung)

Post by henkster » 14 Mar 2014 13:28

Does not seem to work either. Logcat did not seem to give me anything strangely enough. However I saw with cpu overlay that the command "com.android.SuspendWindow" was called. Can I trigger automagic to use that? "General broadcast" did not work for me..

henkster
Posts: 23
Joined: 08 Feb 2014 10:52

Re: trigger for closing s cover (samsung)

Post by henkster » 14 Mar 2014 20:19

This is the output of logcat:
03-14 19:44:49.218 I/SuspendWindow(845): --------hallStatusChange,status=0
03-14 19:44:49.219 I/SuspendWindow(845): -------UpdataViewForHallStatus,status=0
03-14 19:44:49.225 V/ActivityManager(621): Broadcast: Intent { act=android.agold.action.UPDATE_SUSPEND_WINDOW flg=0x10 (has extras) } ordered=false userid=0 callerApp=ProcessRecord{424f3ae8 845:com.android.SuspendWindow/u0a10076}
03-14 19:44:49.236 I/SuspendWindow(845): -----BootReceiver--intent.getAction()=android.intent.action.AGOLD_COMPLETED
03-14 19:44:49.239 I/SuspendWindow(845): ----mBroadcastReceiver--action=android.agold.action.UPDATE_SUSPEND_WINDOW
03-14 19:44:49.282 I/SuspendWindow(845): ----mTimeNumberView----
03-14 19:44:49.285 I/SuspendWindow(845): *************X=202***********Y=197
03-14 19:44:49.285 I/SuspendWindow(845): ************mWeekStr= vr
03-14 19:44:49.299 I/jbl (845): -----SuspendWindowService----onStartCommand----
03-14 19:44:49.300 I/SuspendWindow(845): ------AgoldCheckHallStatus----status=0
03-14 19:44:49.300 I/SuspendWindow(845): hour=19 minute=44
03-14 19:44:49.302 I/ScrollLayout(845): SetOnViewChangeListener mOnViewChangeListener = com.android.SuspendWindow.windowView$1@42339418
03-14 19:44:49.303 I/SuspendWindow(845): getNewMissedCallSize : selection=type=3 AND new=1
03-14 19:44:49.319 I/SuspendWindow(845): --GetMissCallCount--mMissCallCount=0
03-14 19:44:49.339 I/SuspendWindow(845): -----agoldGetMessagesCount,mMissInfoCount=3
03-14 19:44:49.364 I/SuspendWindow(845): ----mTimeNumberView----
03-14 19:44:49.365 I/SuspendWindow(845): *************X=202***********Y=197
03-14 19:44:49.365 I/SuspendWindow(845): ************mWeekStr= vr
03-14 19:44:49.404 I/SuspendWindow(845): ----mTimeNumberView----
03-14 19:44:49.406 I/SuspendWindow(845): *************X=202***********Y=197
03-14 19:44:49.406 I/SuspendWindow(845): ************mWeekStr= vr
03-14 19:44:49.940 I/SuspendWindow(845): --------hallStatusChange,status=1
03-14 19:44:49.941 I/SuspendWindow(845): -------UpdataViewForHallStatus,status=1
03-14 19:44:49.949 V/ActivityManager(621): Broadcast: Intent { act=agold.andorid.intent.hide.SUSPEND_WINDOW flg=0x10 } ordered=false userid=0 callerApp=ProcessRecord{424f3ae8 845:com.android.SuspendWindow/u0a10076}
03-14 19:44:49.963 I/SuspendWindow(845): ----mBroadcastReceiver--action=agold.andorid.intent.hide.SUSPEND_WINDOW

Locked