Just a reminder:
For me, a robot is just a machine. If it acts on its own randomness it is just bec. you programmed it to be. Even the most complicated AI is a hand made tool with a purpose of serving mankind. If it doesn't serve to mankind it means that is only malfunctioning.
For the most part I would agree, but there have been cases where the droid's extensive programming has allowed it to expand its own objectives and programming. The major case would be IG-88A, who did just that and killed the ones that built him when they tried to shut him down. He wanted to start a droid revolution, and upload himself into the Death Star to accomplish it.
The problem with droid rights is that there is a fluent passage between programmed machines and sentient droids. You can't draw a clear line.
I think things should be handled like this:
1. Forbid memory wipes. With droids, they basically kill a developing person. (Note, however, that this stems from the same attitude which lets me argue against abortion in real life. So this one is up to in-universe-debate, I guess.)
2. Shutting a droid down, scrapping it, sending it on dangerous tasks etc. requires the consent/permission of the droid. Now, most importantly: It is allowed to create droids which are programmed to always agree to such tasks. If a droids starts to say "no", it is a sure sign that it has surpassed its programming.
3. A droid gains the rights of a sentient by asking for them or claiming them. If a droid communicates to his owner "I want to enjoy the rights of a sentient.", the owner has to agree*. He has to bring the droid to the responsible government agency where the droid gets some forms which confirm him as a sentient.
*I imagine some insurances would cover this and some companies would grant XX-years guarantees so you get a new droid if your old one declares himself a sentient.
I believe you can draw a clear line, and it is handled in a pretty decent way in the Mass Effect universe;
1. Forbid any sort of AI development (unless it is important), and make sure that the lesser intelligence you create can't evolve into anything more than what they were programmed for (no expansive memories).
2. Memory wipes don't necessarily kill a developing sentience, they make sure that it never comes about because it isn't supposed to. A droid that wasn't built to gain sentience or a higher intelligence needs memory wipes, and if they don't then you get a "rampant" AI situation (IG-88, and I remember a few droids in KOTOR2 that seemed to have a form of sentience that were basically nuts).
3. If a droid claims sentience, then there must be a series of tests to decide whether this is true or not (the droid could have been programmed to say it had sentience). If it fails then memory wipe it and put it back to work, if it passes then it should be studied so that other droids can be prevented from doing so, then either dismantled if it is potentially dangerous or allowed to exist in a limited perimeter.