Created
January 5, 2016 19:17
-
-
Save eighthave/6c4757f5877b88c5a586 to your computer and use it in GitHub Desktop.
panic response in zom
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
} else if (Panic.isTriggerIntent(intent)) { | |
if (PanicResponder.receivedTriggerFromConnectedApp(this)) { | |
if (Preferences.uninstallApp()) { | |
Log.i(TAG, "uninstallApp"); | |
// lock and delete first for rapid response, then uninstall | |
shutdownAndLock(this); | |
PanicResponder.deleteAllAppData(this); | |
Intent uninstall = new Intent(Intent.ACTION_DELETE); | |
uninstall.setData(Uri.parse("package:" + getPackageName())); | |
startActivity(uninstall); | |
} else if (Preferences.clearAppData()) { | |
Log.i(TAG, "clearAppData"); | |
// lock first for rapid response, then delete | |
shutdownAndLock(this); | |
PanicResponder.deleteAllAppData(this); | |
} else if (Preferences.lockApp()) { | |
Log.i(TAG, "lockApp"); | |
shutdownAndLock(this); | |
} | |
// TODO add other responses here, paying attention to if/else order | |
} else if (PanicResponder.shouldUseDefaultResponseToTrigger(this)) { | |
if (Preferences.lockApp()) { | |
shutdownAndLock(this); | |
} | |
} | |
// this Intent should not trigger any more processing | |
finish(); | |
return; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment