when a user unregisters, record his user agent for posterity

This commit is contained in:
Brian Acton 2021-02-11 19:35:56 -08:00 committed by Jon Chambers
parent fdcf317963
commit 8fc6f9c442
1 changed files with 13 additions and 0 deletions

View File

@ -49,6 +49,19 @@ public class PushFeedbackProcessor extends AccountDatabaseCrawlerListener {
device.getUninstalledFeedbackTimestamp() + TimeUnit.DAYS.toMillis(2) <= Util.todayInMillis())
{
if (device.getLastSeen() + TimeUnit.DAYS.toMillis(2) <= Util.todayInMillis()) {
String type = "unknown";
if (!Util.isEmpty(device.getApnId()) && device.getId() == 1) {
type = "iPhone";
} else if (!Util.isEmpty(device.getApnId()) && device.getId() != 1) {
type = "iPad";
} else if (!Util.isEmpty(device.getGcmId())) {
type = "Android";
} else if (device.getFetchesMessages() && "OWA".equals(device.getUserAgent())) {
type = "Android Tweaker";
} else if (device.getFetchesMessages()) {
type = "Desktop";
}
device.setUserAgent(type);
device.setGcmId(null);
device.setApnId(null);
device.setVoipApnId(null);