Exactly - the correct solution is that border inspection of luggage (for contraband) NOT be considered a legal basis for searching my information storage.
Warrantless search of gadgets / accounts should be prohibited for citizens. For non-citizens, it should require a significant justification.
Finally, NONE of the data examined at the border should be stored for longer than necessary to reach a go/no-go determination.