An Apple invention published by the U.S. Patent and Trademark office on Thursday describes a method by which an iPhone can set off an alert or automatically lock the device based on detected changes in user behavior.