In my world, automation reaches a new level with the introduction of androids. Robotic human beings capable of doing any job a regular person can. The concept of these androids is that they can be used in a wide variety of jobs as opposed to simpler robotic workers.

At a certain point in my world, I want these androids to be less like slaves and even gain rights and freedoms. To achieve this however, they must want to have these rights and freedoms; which means they would need to be sapient and self aware to an extent. Obviously this is a problem with the public scare concerning Artificial Intelligence. How do I justify an android being programmed with self awareness? How close can I get to justifying an android being truly human as far as the mind goes?