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 @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
                                  • AlainW94A Offline
                                    AlainW94 @AlainW94
                                    last edited by

                                    @jamieweb You can also take a look at repowerd, it seems to be the deamon that is handling the power button : launchpad repowerd I see some event of it in syslog when pressing the power button.

                                    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
                                    • First post
                                      Last post