UBports Robot Logo UBports Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    UT on Meizu MX4 without using physical buttons

    Scheduled Pinned Locked Moved General
    21 Posts 5 Posters 3.9k Views 3 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
      Reply
      • Reply as topic
      Log in to reply
      This topic has been deleted. Only users with topic management privileges can see it.
      • jamiewebJ Offline
        jamieweb
        last edited by jamieweb

        Hi,

        I would like to be able to use UT on my Meizu MX4, but ideally I'd like to be able to do this without using the physical buttons, as I can in Flyme.

        Does the latest version of UT support tap to wake, swipe to wake, raise to wake, etc? And is there a way to lock the phone without using the physical lock button?

        I remember on UT in 2015 this wasn't possible, but I'm hoping the features have been implemented by now.

        Kind regards,
        Jamie

        LakotaubpL ? 2 Replies Last reply Reply Quote 0
        • LakotaubpL Offline
          Lakotaubp @jamieweb
          last edited by

          @jamieweb You do need the button to wake the device, and thats pretty much it. To put the device to sleep just set a low screen lock time in system settings.

          jamiewebJ 1 Reply Last reply Reply Quote 0
          • ? Offline
            A Former User @jamieweb
            last edited by A Former User

            @jamieweb You can also lock the phone with a slide to the system indicator and than push lock.
            But then, the phone ist just locked and the screen is not off.

            jamiewebJ 1 Reply Last reply Reply Quote 1
            • jamiewebJ Offline
              jamieweb @Guest
              last edited by

              @thilov Is there a terminal command I can use to simulate pressing the physical lock button? I could just create a launcher for that.

              ? 1 Reply Last reply Reply Quote 0
              • ? Offline
                A Former User @jamieweb
                last edited by A Former User

                @jamieweb

                dbus-send --type=method_call --dest=org.gnome.ScreenSaver /org/gnome/ScreenSaver org.gnome.ScreenSaver.Lock
                

                locks the phone but the screen is still on.

                jamiewebJ 1 Reply Last reply Reply Quote 1
                • jamiewebJ Offline
                  jamieweb @Lakotaubp
                  last edited by

                  @Lakotaubp Am I able to wake the device using the MX4's touch home ring? Or can I rebind it to a volume button or something? I want to preserve my lock button as it feels like it's about to break.

                  1 Reply Last reply Reply Quote 0
                  • jamiewebJ Offline
                    jamieweb @Guest
                    last edited by

                    @thilov Ah awesome stuff, thanks for this. Is there a way to do this and turn the screen off too?

                    AlainW94A 1 Reply Last reply Reply Quote 0
                    • AlainW94A Offline
                      AlainW94 @jamieweb
                      last edited by AlainW94

                      @jamieweb you can spy dbus with dbus-monitor on a adb shell terminal , then try to lock and wake up the phone, you shoulder be able to see the commands that you need .

                      sudo dbus-monitor --system 
                      

                      Meizu Pro 5, Meizu Pro 5, Meizu Pro 5, Meizu Pro 5 (Yes I have 4 of them)
                      Never forget that they are much more ideas inside two heads than in one...

                      jamiewebJ 2 Replies Last reply Reply Quote 1
                      • jamiewebJ Offline
                        jamieweb @AlainW94
                        last edited by

                        @AlainW94 Cool, I'll try that. Will this work with the on-device terminal as well? Or does it have to be via adb?

                        AlainW94A 1 Reply Last reply Reply Quote 0
                        • AlainW94A Offline
                          AlainW94 @jamieweb
                          last edited by

                          @jamieweb the on device terminal will be paused when the device will go to sleep so you will not see anything with dbus

                          Meizu Pro 5, Meizu Pro 5, Meizu Pro 5, Meizu Pro 5 (Yes I have 4 of them)
                          Never forget that they are much more ideas inside two heads than in one...

                          jamiewebJ 1 Reply Last reply Reply Quote 1
                          • jamiewebJ Offline
                            jamieweb @AlainW94
                            last edited by

                            @AlainW94 Ok thanks, hopefully this will solve the ability to lock the phone. Do you have any ideas for how I could wake the phone without using the physical lock button?

                            Will dbus be able to read the Meizu MX4's touch home ring when the device is locked?

                            AlainW94A 1 Reply Last reply Reply Quote 0
                            • AlainW94A Offline
                              AlainW94 @jamieweb
                              last edited by AlainW94

                              @jamieweb I worked on dbus a little with my pro5 finger print reader. included in the home button . From memories the home button send a signal ove dbus or a proximity valus from the finger. I think that an app can read this value but it nerd to run even if the phone is sleeping and this is the problem as when the phone is sleeping, no app are running anymore excepted core apps

                              Meizu Pro 5, Meizu Pro 5, Meizu Pro 5, Meizu Pro 5 (Yes I have 4 of them)
                              Never forget that they are much more ideas inside two heads than in one...

                              jamiewebJ 1 Reply Last reply Reply Quote 1
                              • jamiewebJ Offline
                                jamieweb @AlainW94
                                last edited by

                                @AlainW94 Ah right I see. What would be the process for getting a user-written script to run while sleeping as a core app?

                                AlainW94A 1 Reply Last reply Reply Quote 0
                                • AlainW94A Offline
                                  AlainW94 @jamieweb
                                  last edited by

                                  @jamieweb You can maybe try with a cron task, but I think that you will have to set the filesystem as writtable before to setup your task. Try to run your task every 2 second if it's a script. if you have a loop insinde then you can run it at startup. PS : I don't know if cron is still running when the phone is sleeping, I think yes but without testing it ...

                                  Meizu Pro 5, Meizu Pro 5, Meizu Pro 5, Meizu Pro 5 (Yes I have 4 of them)
                                  Never forget that they are much more ideas inside two heads than in one...

                                  D 1 Reply Last reply Reply Quote 1
                                  • D Offline
                                    doniks @AlainW94
                                    last edited by

                                    maybe upstart would be better than cron. at least it doesn't require rw partition. this https://wiki.ubuntuusers.de/Baustelle/Ubuntu_Touch/Snippets/#Skalierung-der-Anzeige uses an upstart job to change the scaling. in a similar way, I'm sure you can write any other job

                                    1 Reply Last reply Reply Quote 3
                                    • jamiewebJ Offline
                                      jamieweb @AlainW94
                                      last edited by

                                      @AlainW94 I've set up an adb shell and run this command to see what happens on dbus when I press the lock button. Unfortunately there are dozens/hundreds of dbus commands in the log output, rather than just one command that I can put in a launcher.

                                      Do you know whether there is a way to find the overarching command that triggers all of this off when the lock button is pressed?

                                      On a side note, it looks like most of the dbus commands when pressing the lock button are to make the screen fade out over a short period.

                                      AlainW94A 1 Reply Last reply Reply Quote 0
                                      • AlainW94A Offline
                                        AlainW94 @jamieweb
                                        last edited by

                                        @jamieweb Hi ! I did not have my notes under the hand for now but one things that you can try to reduce the amount of dbus messages is to switch off gsm/wifi/bluetooth you should have less messages over dbus. Tomorrow I will take a look at my notes to check what can be useful for you.

                                        Meizu Pro 5, Meizu Pro 5, Meizu Pro 5, Meizu Pro 5 (Yes I have 4 of them)
                                        Never forget that they are much more ideas inside two heads than in one...

                                        jamiewebJ 1 Reply Last reply Reply Quote 1
                                        • jamiewebJ Offline
                                          jamieweb @AlainW94
                                          last edited by

                                          @AlainW94 Thanks for taking the time to have a look.

                                          Unfortunately, I think that all of the dbus messages were actually related to locking the phone, I only ran the monitor command for about 2 seconds - just enough time to press lock.

                                          Ideally I'd like to find the command that actually triggers all of this off and just create a launcher for that, rather than trying to reverse engineer with dbus commands.

                                          AlainW94A 1 Reply Last reply Reply Quote 0
                                          • AlainW94A Offline
                                            AlainW94 @jamieweb
                                            last edited by

                                            @jamieweb The only things I found back from my notes regarding D-BUS is this :

                                            signal time=1544722135.567846 sender=:1.0 -> destination=(null destination) serial=8601 path=/com/ubuntu/Upstart; interface=com.ubuntu.Upstart0_6; member=EventEmitted
                                               string "dbus"
                                               array [
                                                  string "SIGNAL=Activity"
                                                  string "BUS=system"
                                                  string "INTERFACE=com.canonical.Unity.UserActivity"
                                                  string "OBJPATH=/com/canonical/Unity/UserActivity"
                                                  string "SENDER=:1.21"
                                                  string "ARG0=0"
                                               ]
                                            
                                            signal time=1544722135.795139 sender=:1.0 -> destination=(null destination) serial=8602 path=/com/ubuntu/Upstart; interface=com.ubuntu.Upstart0_6; member=EventEmitted
                                               string "dbus"
                                               array [
                                                  string "SIGNAL=Activity"
                                                  string "BUS=system"
                                                  string "INTERFACE=com.canonical.Unity.UserActivity"
                                                  string "OBJPATH=/com/canonical/Unity/UserActivity"
                                                  string "SENDER=:1.21"
                                                  string "ARG0=1"
                                               ]
                                            

                                            When the home button is pushed. I'm not sure that this will help you a lot...

                                            Meizu Pro 5, Meizu Pro 5, Meizu Pro 5, Meizu Pro 5 (Yes I have 4 of them)
                                            Never forget that they are much more ideas inside two heads than in one...

                                            1 Reply Last reply Reply Quote 1
                                            • AlainW94A Offline
                                              AlainW94
                                              last edited by

                                              With this command you will lock the user screen but not power off the display :

                                              loginctl lock-session c1
                                              

                                              Meizu Pro 5, Meizu Pro 5, Meizu Pro 5, Meizu Pro 5 (Yes I have 4 of them)
                                              Never forget that they are much more ideas inside two heads than in one...

                                              AlainW94A 1 Reply Last reply Reply Quote 1
                                              • First post
                                                Last post