On android.text.format.Time it is documented that the month value range is from 0 to 11, so december should have the (unintuitive) value 11 in this api. So when you say 12 instead of 11, so your future date is in january, and then you are additional 30/31 days later which could explain your result of 40 instead of 10 days.
I feel sorry for you to use such a bad api.