Slight improvement is to adjust one up or down from the mid to have the fewest guesses and more importantly to avoid getting stuck when you narrow it down to left and right that are next to each other. I see you've avoided the getting stuck case with your initial check that the number is not n itself but still you are likely doing extra queries to find the result.

When you determine that the result is less than the mid you can move the right edge to mid - 1 and when you determine the result is greater than the mid you can move the left edge to mid + 1.

Here is the typical Binary Search algorithm in Java

public int guessNumber(int n)
{
int min = 1;
int max = n;
while (min < max)
{
int mid = min + (max - min) / 2;
int g = guess(mid);
if (g == 0) return mid;
else if (g == -1) max = mid - 1;
else min = mid + 1;
}
return min;
}