I am trying to set up a Tasker task that will delete all alarms in the clock. I had it setup and working great on my old phone. What I did was made a copy of the alarms database when there were no alarms. When I want to delete the alarms that are currently set, Tasker runs a shell command to delete the current database with the alarms in it. Then Tasker runs a shell command to copy the empty database and rename it. Then some commands to change permissions and owner.
When I tried to move this all over to my new phone is when I ran into some trouble. The new phone is a One Plus 3 for what it's worth. So I copied everything thing over and the only thing that looked like it needed to be changed was the package name for the shell commands. I changed that and tried the Tasker task. No luck. The clock app froze up. I restored everything from my backups. I decided to do some testing to see where the issue is.
I used the Root Explorer app to copy the alarms database. When I tried to open the copied database I got the following error message:
An error occurred while opening the database. Attempt to invoke virtual method 'android.database.Cursor android.database.sqlite.SQLiteDatabase.query(java.lang.String, java.lang.String[], java.lang.String, java.lang.String[], java.lang.String, java.lang.String, java.lang.String)' on a null object reference
I can still open the original database just fine. But it appears something is happening when I make a copy of it. Any insight would be a big help. Thanks