What does the resetApp() do behind the scenes?

We are struggling with our understanding of the resetApp() method contained within Appium’s Java Client. What does the resetApp() do behind the scenes, so to speak?

We are testing Android applications

It will either uninstall the app or run adb shell pm clear.

@bootstraponline

I see. So, what triggers one versus the other? That is, what triggers it using ‘adb shell pm clear’ versus uninstalling the application?

It has to do with the capabilities. If fullReset is enabled then it’ll avoid pm clear.