Clear user session on profile change My wife's company want to loan android tablets (Nexus 7's with 5.0 in the pilot) to clients for the duration of a consultation.  Restricted profiles in lollypop make this more achievable.  Question : is there a way when the client has finished to wipe his/her data automatically?  Obviously an app would be ideal but writing something might work.  The use cases are basically privacy (obviously) but also ensuring that users don't leave anything inappropriate for the next user.

I currently write java apps on unix but am a novice with android.  Is it possible for instance to write something that listens for a profile change event?  A restricted user "template" with allowed apps prepopulated so the user profile could be quickly deleted and recreated?
I think Guest Mode is made exactly for this purpose:
http://www.androidbeat.com/2015/01/activate-guest-mode-android-5-lollipop/

As far as I can tell, when you exit guest mode, it deletes any data/settings they have entered.  The only downside is that you would need to reinstall any special apps you want clients to be able to use.