Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash on every open #12

Open
ghost opened this issue Jun 6, 2017 · 10 comments
Open

Crash on every open #12

ghost opened this issue Jun 6, 2017 · 10 comments
Labels
bug General label for all bugs (i.e. things not working as intended) unknown cause

Comments

@ghost
Copy link

ghost commented Jun 6, 2017

Every time I created more than 2 profiles and 2 events, the app crashes. If I clear the app data and the cache manually now, I can start it until I created the profiles and events. I only used WiFi and time in the events if this help you.

@renyuneyun
Copy link
Owner

Hi, I don't seem to have that issue, so could you please help me to find out more relevant information?

  1. When will the crash happen? Exactly the time you press the save button? Shortly after you click the save button? Or when you start the app again?
  2. Is that exactly because of more than 2 profiles and 2 events? Specifically, are these two conditions essential (e.g. maybe 1 profile and 2 events will also do)?
  3. Each event is designed to be of a single condition (e.g. either WiFi or time, but not both. however, you can chain events [by setting "parent"] to check for multiple conditions), though this shouldn't cause crash because the extra one will be ignored.
  4. What would happen if you create two events both with WiFi (or both with time)? What about one with WiFi and one with time?
  5. Do you use any permission managements? Please make sure you grant Easer relevant permissions (and don't forget to allow Easer to change system settings if you are using Android 6.0 or above).

@ghost
Copy link
Author

ghost commented Jun 7, 2017

  1. About an half second second after pressing the save button and on every startup.
  2. With 1 profile and 2 events it still not works.
  3. Can you give me some more information about parents please?
  4. I don't think that this is the problem because I just tested:
  • created 1 profile with silent mode
  • created 2 events
  • edited some options in this profile
  • now it crashes
  1. Only the preinstalled Settings app from Android and the only permission which I can give to Easer is location access. (I use Android 6.0.1)

BTW: I can't delete events inside the app "Failed to save.".

@renyuneyun
Copy link
Owner

By looking at these steps, I highly suspect it's because you didn't grant Easer the permission to change system settings... That permission is not listed in each app's permission control. You need to click the gear on the up-right corner of the "Apps" page (in Settings), and then you can find it. If you still can't find it, have a look at this.

The permission issues will be fixed in the future (by checking and requiring parmissions dynamically), but currently you have to do that manually.

"Parent" means the child will be checked only after parent is satisfied ("parent" is the term used in the tree data structure). Each event has a field called parent and you can use the spinner (when editing/adding an event) to select another event (or nothing) as it's parent. Bear in mind that you can select empty profile (i.e. don't select any profile) for any events.
For example, you have two events A and B: A checks for the date to see if it's after 2017-Mar-4; B checks for the time to see if it's after 3:00 am.
If you make A the parent of B, then only after 2017-Mar-4 3:00 B will be triggered (rather than be triggered everyday after 3:00) (and load the selected profile if any).
If you make B the parent of A, then only after 3:00 everyday Easer will check if it's already later than 2017-Mar-4 (rather than check it everyday 0:00 [as designed]).
Remember, every satisfied event will all load it's profile, so the "parent"s will also load their profiles. If you want to load a profile only after many events are satisfied, chain them and set the profile in the leaf node (which means leave the "profile" field of all levels of parents empty).

Thanks for reporting the failed to delete issue... It seems I unintentionally broke that...

@ghost
Copy link
Author

ghost commented Jun 7, 2017

Thanks for the help, I gave the permission to change system settings now but it still crashes.
Also it would be more easier to create events and profiles if you put the "add" button in the bottom left corner which is like the refresh button on the first page.

@renyuneyun
Copy link
Owner

Hmm... I still can't reproduce the crash on a Android 6.0 emulator.
Can you give me a minimal example that can reproduce the crash? What is the profile and what are the events (andr what do you set in their "parent" and "profile" fields)?

I'm thinking about listing events in trees, so currently that page won't be changed. But the profile page doesn't have this plan so I'll add a FAB there then.

@ghost
Copy link
Author

ghost commented Jun 7, 2017

My profile:

Name: Profile

  • [Y] WiFi - off
  • [Y] Mobile data - off
  • [Y] Bluetooth - off
  • [Y] Auto Rotation - on
  • [N] Send Broadcast
  • [N] Brightness
  • [Y] Ringer Mode - Silent

My event:
Title: 1
Parent: none
Profile: Profile

  • [Y] Time - After 2:00 A.M.

@renyuneyun
Copy link
Owner

Still nothing...

However, I do find one cause of crash: if I rename a profile and some events are using that profile, then there will be inconsistency and Easer will crash. Not sure if that's the same issue because you didn't mention that.

@ghost
Copy link
Author

ghost commented Jun 7, 2017

One time this was the reason but all the other time i didn't do that.

@renyuneyun renyuneyun added bug General label for all bugs (i.e. things not working as intended) unknown cause labels Jun 7, 2017
@renyuneyun
Copy link
Owner

renyuneyun commented Jun 7, 2017

That's weird...
I don't find any possible sources and can't reproduce that. If you can use LogCat (or ADB), maybe we can find out more information from the logs.
If not, let's wait to see if others also have this problem...

By the way, what's your phone model and which ROM you are using (stock ROM?)?

@ghost
Copy link
Author

ghost commented Jun 7, 2017

I'll try Logcat tomorrow.
I am using a Galaxy S5 Cat6 without any custom ROMS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug General label for all bugs (i.e. things not working as intended) unknown cause
Projects
None yet
Development

No branches or pull requests

1 participant