Only those two factors would cause the shift from S1 to S2. This is a shift to the right, which means that this is an increase in supply. The law of supply states that as the price increases, the supply increases. High prices make sellers more inclined to provide to make a profit. Other factors that contribute to a shift in supply also include the price of relevant input. This means if the cost of resources used to produce a certain good increases, the supply decreases.
Milk is an ingredient used in the production of ice cream. If the price of milk increases, the supply of ice cream would decreases because sellers would be less inclined to produce more if the price of production increases. This is what rules out the second factor.
Another factor would be the emergence of competition or number of sellers. If someone else is supplying them with the same good in the same area, then you would expect an increase in supply.