China Daily ran a piece about this that I found when I searched "food safety" + "smiley face" (食品安全 + 笑脸) announcing the launch of this system in 2011 in Tianjin. When I came to Shanghai in 2009, not many restaurants had these, and Shanghai was a 1st tier city by then. I guess this system spread to 2nd tier cities by 2011, thus this article. The article explains the faces much the way Mark described them above.
The report states that these faces/ratings are in accordance with a document called the Catering Service Food Safety Supervision and Quantitative Classification Management Guide《餐饮服务食品安全监督量化分级管理指南》
The article paraphrases the document by detailing what is assessed (while not exactly saying how, which is unsurprising for state media here):
Rough translation: To hold a license to serve food (hotel, canteen, restaurant, etc...), the vendor must allow state food safety assessors to assess the following areas:
- Their current license to serve food
- Their personnel management records
- The overall shop environment
- The facilities and equipment
- The food ingredients and food served
- The food preparation operations
- Tableware disinfection
- Any food additives
- How food is served (kitchen -> table)
- How food is transported to the kitchen
- Taste and quality of food served (they must sample the menu)
These checks are done "dynamically" (pop-ins) and annually (scheduled). If the score is "A" (smiley face) or "B" (flat face) they can keep their license. A's will have a follow-up in a year, B's will be subject to more dynamic follow-ups (I guess). C's will be re-reviewed after being given a chance to come up to code.