2007 Riley made his first career start for the injured
Nate Longshore in California's homecoming game against
Oregon State. Riley passed for 294 yards, two touchdowns, and rushed for a touchdown but California lost the game when he scrambled instead of throwing the ball away to set up a field goal to tie the game. Riley did get credit for putting Cal in a situation to win after being down 31–21 late in the fourth quarter. Riley took over for Longshore in the second quarter of the
2007 Armed Forces Bowl. He passed for 269 yard, 3 touchdowns, and rushed for a touchdown, helping the Bears turn a 21–0 deficit into a victory. Riley was the game's MVP.
2008 Riley competed with Longshore for the starting quarterback job, winning the position for the first four games. He led the Bears to wins over
Michigan State at home, throwing for 202 yards and two touchdowns. He only played during the first half of the Bears' 66–3 rout of
Washington State, which allowed the backup players to get some starting time. The win resulted in the Bears breaking into the Top 25 at #23, but they were upset in
College Park, Maryland on September 13 by the unranked
Maryland Terrapins. With the Bears' offense stifled by the Terrapins' defense for three quarters, Riley threw three touchdown passes in the fourth quarter for 423 yards on 58 attempts, a school record for the most pass attempts. Two weeks later, he started against
Colorado State at home on September 27, during which he threw for 59 yards and one touchdown pass. With Cal up 21–0, Nate Longshore stepped in at quarterback in the third quarter and threw for two touchdowns in the fourth. This resulted in the starting quarterback position being reopened by head coach
Jeff Tedford for the following week against
Arizona State on October 4. Longshore was picked as the starter and led the Bears to a 24–14 victory. On October 18, Riley stepped in at quarterback in the fourth quarter during an away game against the Arizona Wildcats. He was unable to lead a comeback, throwing for 97 yards and one interception, and the Bears fell to the Wildcats 42–27. Riley got the start the following week against the UCLA Bruins, his first since Colorado State nearly a month prior. He threw for 153 yards and two touchdowns, both in the fourth quarter, in the 41–20 victory. Riley also got the start the following week against the
Oregon Ducks. He sustained a concussion after being hit in the first quarter when he failed to slide while trying to gain a first down and did not return to the game. Longshore stepped in and led the Bears to a 26–16 upset over #23 Oregon. The following week against
USC, Riley took over in the second half but was unable to lead the Bears to an upset of the #6 Trojans. Riley got the start the following week against
Stanford for the 111th
Big Game. He threw for 101 yards, including three touchdown passes, in the Bears' 37–16 victory over the Cardinal and reclaiming of the
Stanford Axe. Riley's three start run ended when Longshore was picked over him to start the
2008 Emerald Bowl against the
Miami Hurricanes, which the Bears won 24–17. Riley was expected to compete for the starting quarterback position in 2009 with redshirt freshman Brock Mansion.
2009 Riley was named the starter for the 2009 season a week before the team's season opener against
Maryland, a contrast to 2008 when head coach Jeff Tedford alternated between him and
Nate Longshore. On September 5, Riley threw for 298 yards and four touchdowns against the Terrapins, each to a different receiver. The following week against
Eastern Washington he threw for 151 yards and a score, also getting his first rushing touchdown of the season. At Cal's first away game on September 19 against
Minnesota, he passed for 252 yards. Riley struggled the following week against
Oregon, being sacked four times and held to 123 passing yards. Although was replaced in the fourth quarter by Beau Sweeney, the Bears could only muster a field goal to Oregon's 42 points. Riley fared slightly better against
USC on October 3, throwing for 198 yards and an interception. However, the Bears were again blown out in a 30–3 loss. Two weeks later against
UCLA, Riley bounced back, leading the Bears to a 45–26 victory in which he threw for 205 yards and three touchdowns. He followed this up with a 229-yard and three touchdown performance against
Washington State, the worst team in the conference. Riley played perhaps his best game of the season against
Arizona State in
Tempe. Cal narrowly defeated the Sun Devils 23–21, with Riley throwing for 351 yards and a pair of touchdowns. On November 7, despite passing for 200 yards and a touchdown, Cal sustained its fifth straight loss to
Oregon State. In Cal's final home game against #18
Arizona, the Bears upset the Wildcats 24–16. Riley threw for 181 yards and a touchdown, being intercepted twice. Cal entered the
Big Game against
Stanford as the underdog on November 21, hanging on to pull off a 34–28 upset in which Riley threw for 235 yards and a touchdown. The regular season ended for Riley on a sour note, with an upset by
Washington in which he was sacked five times, despite throwing for a score and 215 yards. Against
Utah in the
Poinsettia Bowl, Riley passed for 214 yards in the 37–27 loss. He accounted for all three of Cal's turnovers and was sacked four times.
2010 Riley entered the 2010 season as the Pac-10 Conference leader in wins and touchdown passes. He was named to the watch list for the
Manning Award on July 22. Despite an inconsistent performance in 2009, he retained the starting quarterback job. In the season opener against
UC Davis on September 4, Riley threw for 258 yards and three touchdowns, following this up with 197 yards and four scores, all to different receivers, the following week against
Colorado. On September 17 he had 277 yards, a touchdown and three interceptions in a loss to
Nevada in
Reno, while throwing for 116 yards and an interception in a narrow loss to
Arizona on September 25. On October 9 against
UCLA, he threw for 83 yards and a touchdown, while scoring himself on a rushing touchdown. Riley sustained a season-ending injury to his left knee when he was hit low during an October 30 road game against
Oregon State and had to be helped from the field. He did not return to the game. Junior redshirt Brock Mansion was the starter for the remainder of the season. ==Post-college career==