Immigrants or non-citizens of the United States have long faced a double problem when arrested for a crime: their own criminal defense attorneys rarely understand U.S. immigration law (it's a separate and complex specialty); and therefore may, with all good intentions in counseling the client, advise a plea bargain or other course of action that turns out to be a disastrous outcome for the person's immigration status. In the worst-case scenario, an immigrant may plea to a crime that leads to deportation, when proceeding to trial might have yielded a verdict allowing him or her to stay in the United States.
The U.S. Supreme Court addressed a case where inadequate warnings from criminal defense counsel led to a green card holder receiving a deportation order based on a conviction obtained through plea bargain in Padilla v. Commonwealth of Kentucky, 559 U.S. 356 (2010). The Court held that defense counsel's failure to inform a client whether a plea carries a risk of deportation is constitutionally deficient.
That didn't solve the problem to the degree that many hoped. Criminal defense attorneys are still learning how to interpret the immigration effects of different crimes. (Consulting with an immigration attorney can help, but not all immigration attorneys are well schooled in this area, either.) Worse yet, when a defense attorney tries to negotiate with a prosecutor in light of the immigration consequences for the immigrant, prosecutors commonly say, in effect, "So what? Not my problem."
The state of California therefore decided to take the Padilla holding one step further, by passing AB 1343, which went into effect in January of 2016. The new law not only mandates that defense counsel give accurate and affirmative advice about the immigration consequences of a proposed disposition, and assist in defending against those consequences, but puts responsibilities on the prosecutors, as well.
California prosecuting attorneys must now, within the boundaries of serving the interests of justice, take adverse immigration consequences into account during the plea negotiation process. This is a huge change, requiring new training statewide, and a complete adjustment of prosecutors' mindsets. Only time will tell how it actually plays out.