Its too bad that your niece felt awkward by the whole interaction. But heres the bottom line: She doesn't have to talk to police if she doesn't want to. She can politely ask if she is under arrest or free to leave. Unfortunately, officers have an intimidating presence so we all feel compelled to speak with them.
Such an interaction would be unnerving for anyone who isn't doing anything but just going about their own business. In any case, while it is not illegal for the police to ask such questions (under the circumstances as you have described them in your post), it is also not illegal for your niece to refuse to answer any intrusive questions (although, such a refusal can look suspicious to the police). If stopped and not cited or not while driving, providing one's name and the information on their drivers license will do (keeping in mind that every situation and the surrounding facts are different).
Ms. Berjis is licensed to practice law in the State of California. The laws of your jurisdiction may differ and thus this answer is for informational and educational purposes only and is not to be considered as legal advice. Since all facts are not addressed in the question, this answer could change depending on other significant and important facts. This answer in no way constitutes an attorney-client relationship.
To the excellent answers already provided, I would just add that your niece should look into whatever formal complaint procedures the PD has.
This post is for information purposes only and does not constitute legal advice, nor does it establish an attorney client relationship with Mr. Cassara.
Your niece should indeed make a complaint to the internal affairs division of the Pol Dept, or to the watch commander. Very likely the officer will claim that he had info from roll call or the radio about a suspect in the area matching your niece's description, but that can defense can be investigated and verified or contradicted. Many times officers are disciplined for being untruthful about their reasons for stops when the department would not have disciplined them for the stop itself.
I know that you think that this was race-based. My experience tell me that it is just as likely that it was gender -- that he was angling for an opportunity to flirt and exchange numbers. It happens. In either event, it was most likely improper and will likely be corrected by the department if it can be verified.
No legal advice here. READ THIS BEFORE you contact me! My responses to questions on Avvo are never intended as legal advice and must not be relied upon as if they were legal advice. I give legal advice ONLY in the course of a formal attorney-client relationship. Exchange of information through Avvo's Questions forum does not establish an attorney-client relationship with me. That relationship is established only by joint execution of a written agreement for legal services. My law firm does not provide free consultations. Please do not call or write to me with a “few questions” that require me to analyze the specific facts of your history and your license application and prescribe for you how to get a State license. Send me an email to schedule a paid Consultation for that kind of information, direction, and assistance. My law firm presently accepts cases involving State and federal licenses and permits; discipline against State and federal licenses; and disciplinary and academic challenges to universities, colleges, boarding schools, and private schools. We take cases of wrongful termination or employment discrimination only if the claims involve peace officers, universities or colleges.