[APP]/[Guide] Flip Cover on AOSP rom's!

Search This thread

Linus_BE

Senior Member
Oct 23, 2011
99
23
29
I'll have to try this...can you export the project in Tasker and post it here?

Sent from my SM-N900T using Tapatalk
Sure here you go: https://www.dropbox.com/sh/qyta934c3nfdhjc/CCkRVs0RRY

You may have to adjust the values for when to lock/unlock the device and you need secure settings plugin.

You can check your magnetic field values by going to state -> sensor -> magnetic field -> scan and then close your cover while looking at the value when it's nearly closed.
 

cnims

Member
Aug 7, 2012
33
7
Thanks, I tried this again and it will work for a little while after calibrating the compass but after a few minutes it stops working consistantly. I'll just stick to stock ROM for now.

Sent from my SM-N900T using Tapatalk
 

Linus_BE

Senior Member
Oct 23, 2011
99
23
29
Thanks, I tried this again and it will work for a little while after calibrating the compass but after a few minutes it stops working consistantly. I'll just stick to stock ROM for now.

Sent from my SM-N900T using Tapatalk
I had that too but now it's been working consistently for over a day :)
 

Canadoc

Senior Member
Nov 29, 2010
1,828
133
Samsung Galaxy S23 Ultra

Top Liked Posts

  • There are no posts matching your filters.
  • 8
    [How-to get partial flip-cover function on AOSP] This is no longer needed. :)
    - Remember that this will require a magnet inside the case's lid.

    Hey guys!

    I was fiddling around with our sensors tonight and I figured out the magnetometer is working in our device.

    So I researched the Market and found an exciting application called Magnet Unlocker.

    This application supports a lot of different ways to lock/unlock a device. Including with the use of a magnetic field.

    Anyways, I did a lot of settings options and I cannot for the life of me get the application to both use Lock and Unlock, the unlock/lock processes get's jammed up in each other and starts to lock/unlock within seconds of eachother, so I basically use only unlock, since that's the most handy when I look at it. The device can still turn off by itself after a set time due to lacking user interaction.

    With the settings I give you here, I have at least made the tablet turn on when the lid is flipped off the screen. The built-in dispay off setting is taking care of turning off the screen(in my case 1 minute after I close the lid)

    So I present to you a small image guide on how to reach optimal settings.

    I hope this is useful to you. :)

    SPfWyCw.png
    4
    Nice find!

    For those willing to spend a few minutes, I was able to get both cover Lock and Unlock working quite easily with Tasker and Secure Settings (Paid + Free). Secure Settings is needed since Tasker cannot turn on the screen in Android 2.3+.

    To Lock:
    Create a new Profile, State, Sensor, Magnetic Field. Press Scan and have a look at the value when the cover is nearly closed (you can peek under the cover). A value of 285+ works fine for me so far. So set From '285' and To 'Any'.

    For the Exit Task, Display, System Lock.

    To Unlock:
    Same as before, just use the lower range: From '0' To '284' for me. (or you can use Invert)

    For the Exit Task, Plugin, Secure Settings. Hit the pencil for Configuration and choose Wake Device. I then used Screen Dim and 5 seconds, but these are up to you. Press Save and you are done!

    DiOAk9r.png


    EDIT: I added a variable check to keep it from running constantly. I think it still needs a little work, things are a bit wonky, but get you get the idea. When it locks, set %CASE to CLOSED. In order to unlock, it must then read %CASE as CLOSED, before setting it to OPEN.
    Profile: Case Unlock (4)
    State: Magnetic Field [ Axis:All From:0 To:284 ]
    State: Variable Value [ Name:%CASE Op:Matches Value:CLOSED ]
    Enter: Anon (5)
    A1: Secure Settings [ Configuration:Screen Dim
    5 Seconds Package:com.intangibleobject.securesettings.plugin Name:Secure Settings Timeout (Seconds):0 ]
    A2: Variable Set [ Name:%CASE To: OPEN Do Maths: Off Append: Off ]

    Profile: Case Lock (2)
    State: Magnetic Field [ Axis:All From:285 To:Any ]
    State: Variable Value [ Name:%CASE Op:Matches Value: OPEN ]
    Enter: Anon (3)
    A1: System Lock
    A2: Variable Set [ Name:%CASE To:CLOSED Do Maths: Off Append: Off ]

    You also might want to disable Run In Foreground from Settings - Monitor - General if you don't want to see a notification all the time.

    Happy Smart Covering! :highfive:
    1
    It works for me when I calibrate the magnetometer :) Sometimes the magnetometer does not work properly but after this method it works again. I can now lock and unlock the screen with my smart cover using tasker.

    http://xdaforums.com/showthread.php?t=1778131