Is there any way to perform this operation via an intent? Maybe something to add to the intent I've written above ? Yes, but be careful. You can pass in Intent.EXTRA_UNINSTALL_ALL_USERS. However, it's hidden because it: should not be part of normal application flow You could just pass in...

https://dev.mysql.com/doc/refman/5.5/en/information-functions.html#function_last-insert-id: The ID that was generated is maintained in the server on a per-connection basis. This means that the value returned by the function to a given client is the first AUTO_INCREMENT value generated for most recent statement affecting an AUTO_INCREMENT column by that client. This value cannot be affected...

Ok, finally figured out what was causing the problem (totally feel dumb). Apparently the servers used randomly get backed up, and when they do, the permissions get overwritten. If anyone else runs into this, review the access permissions for the directory and all the files. Thanks Nathan for your advice!