IN THE FINAL days of major lawmaking before the winter break, the Massachusetts House and Senate are poised to send the governor legislation to ban drivers from handheld cellphone use.

The bill has sought to balance the goal of stricter traffic laws to curb a road hazard that has led to deaths in Massachusetts with a separate but related goal of establishing a new check on police to prevent them from cracking down disproportionally on certain racial groups. It was concerns about racial-profiling that created the biggest disagreement about the proposal.

Gov. Charlie Baker has already indicated he would be happy to approve any such legislation that would outlaw behavior that can dangerously distract drivers and lead to carnage and tears.

If lawmakers are able to send the bill to the governor this week and he signs it into law, then starting by February, police could begin issuing warnings to drivers who use an electronic device not in hands-free mode. Starting March 31, an escalating series of penalties would kick in for motorists who run afoul of the restriction, with those who commit the offense twice required to undergo a driving education program, and those who violate it three times subject to higher insurance costs.

If the bill becomes law – as seems overwhelmingly likely – Massachusetts will join 20 other states and Washington, DC, in banning handheld cellphone use by drivers – including Arizona, where the ban takes effect in 2021.

The House plans to vote Tuesday on the compromise bill.

With both House and Senate leaders now on the same page, the bill is likely to reach the governor’s desk in the next few days, about a week before Thanksgiving, which is one of the biggest travel holidays, with millions of Americans taking to the roads. The House and Senate both passed earlier versions of the distracted driving bill, and then a bipartisan conference committee of three state reps and three senators spent months working out a compromise version.

Lawmakers in the Senate and racial justice activists saw the bill as a unique chance to enact changes in police record-keeping that they hoped would dissuade police from racial profiling.

The idea is that by requiring police to collect data about race and other information from traffic stops, superior officers would be able to monitor patrol officers to curb discriminatory enforcement, and policymakers could track trends around the state.

The conference committee report that was filed Monday afternoon opts for a less expansive police data-collection regime than the Senate passed and the American Civil Liberties Union endorsed.

Under the compromise bill, the Registry of Motor Vehicles would collect data from every citation issued but not from every motor vehicle stop. The bill directs the RMV to collect data about the race, age, and gender of the person stopped, and whether the incident resulted in a ticket, an arrest, or a warning.

“This is a case of one step forward, two steps back. It’s a step forward for the legislature to acknowledge racial disparities in traffic stops as a problem, but a missed opportunity to effectively address it,” said Rahsaan Hall, racial justice program director at the ACLU of Massachusetts. “Despite the Senate’s best efforts to increase data collection and transparency, this bill simply repackages existing law on data collection and imposes new limits on data access.”

If a police force appears to have engaged in racial- or gender-profiling, the secretary of public safety and security can require the department to collect additional data on all stops, and mandate training about implicit bias for officers. The secretary is also directed to study the feasibility of alternative methods for collecting more accurate data, including data on all stops, and all stops that result in a search or a frisk of someone.

The bill attempted to deal with two distinct issues, which can both have implications for motorists’ safety.

Data collected around the country through the Stanford Open Policing Project have shown disparities between how drivers of different races are treated during police stops, with white drivers more likely to be let off with a warning while black and Hispanic drivers are more likely to be arrested.

Meanwhile, a growing body of evidence has underscored the dangers presented by drivers whose attention is divided by a phone conversation or some other distraction from their electronic device.

Mary Maguire, director of public and legislative affairs for AAA Massachusetts, said her organization will spread the word about the new law if it is passed.

The proposed ban on all handheld cellphone use by drivers would allow police to more easily enforce the more narrowly constructed ban on texting and driving that dates back to 2010, according to Maguire. That bill is difficult to enforce because while it bans sending and receiving messages, it allows drivers to punch in phone numbers and talk on a handheld cellphone or use certain applications, even distracting ones featuring games or videos.

In addition to the safety benefits, Maguire said she thinks a ban on handheld phone may even help with an issue that’s become one of the biggest quality-of-life complaints in Greater Boston: traffic gridlock. Maguire said when drivers are stuck in traffic, they often turn to their phones to pass the time, and wind up moving more sluggishly through intersections, making the traffic even worse.

“This is really a move in the right direction,” Maguire said.