Improve diff detection

Bug: 63999
Change-Id: I02b18d43a6e5ffd1bdd5f78ef0ceb98d1c516103
Merge "Improve diff detection"