OSDN Git Service

Update primary key in VIS sound model database.
authorChris Thornton <thorntonc@google.com>
Sun, 16 Oct 2016 23:23:29 +0000 (16:23 -0700)
committerChris Thornton <thorntonc@google.com>
Mon, 17 Oct 2016 17:12:04 +0000 (10:12 -0700)
commit5bd5cf75e1d86baa49fb65836d69f294714d7066
tree3e6f099749609c8833202b5fab2c4b4988fce8a2
parente422b0b29f9fc61ffca1578503a06b8d924a462a
Update primary key in VIS sound model database.

The public API for getting at KeyphraseSoundModels is based on the user,
locale, and keyphrase ID. However, the sound model database would allow
multiple models to be registered using the same values, as it has a
primary key on the model UUID. This can potentially lead to a scenario
where multiple models are enrolled for the same user, and the data that
is returned when querying models is arbitrary.

V6 of the sound model database now enforces a primary key over the user
ID, locale and keyphrase ID. When inserting a new model with the same
primary key, the old model will be removed and the new model will be
used instead.

When upgrading from V5 to V6, if there are any models that would violate
the primary key constraint, they are all dropped.

Bug: 32174118
Change-Id: I9597c6a994f01a426625c3be2c53e826f26f5156
services/voiceinteraction/java/com/android/server/voiceinteraction/DatabaseHelper.java