Loading Android.bp +2 −1 Original line number Diff line number Diff line Loading @@ -687,6 +687,7 @@ java_defaults { "core/java/com/android/server/DropboxLogTags.logtags", "core/java/org/chromium/arc/EventLogTags.logtags", ":apex-properties", ":platform-properties", ":framework-statslog-gen", Loading api/current.txt +1 −2 Original line number Diff line number Diff line Loading @@ -38820,8 +38820,7 @@ package android.provider { field @Deprecated public static final String LOCATION_MODE = "location_mode"; field @Deprecated public static final int LOCATION_MODE_BATTERY_SAVING = 2; // 0x2 field @Deprecated public static final int LOCATION_MODE_HIGH_ACCURACY = 3; // 0x3 field @Deprecated public static final int LOCATION_MODE_OFF = 0; // 0x0 field @Deprecated public static final int LOCATION_MODE_ON = 3; // 0x3 field public static final int LOCATION_MODE_OFF = 0; // 0x0 field @Deprecated public static final int LOCATION_MODE_SENSORS_ONLY = 1; // 0x1 field @Deprecated public static final String LOCATION_PROVIDERS_ALLOWED = "location_providers_allowed"; field @Deprecated public static final String LOCK_PATTERN_ENABLED = "lock_pattern_autolock"; api/system-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -6046,6 +6046,7 @@ package android.provider { field public static final String LAST_SETUP_SHOWN = "last_setup_shown"; field public static final String LOCATION_ACCESS_CHECK_DELAY_MILLIS = "location_access_check_delay_millis"; field public static final String LOCATION_ACCESS_CHECK_INTERVAL_MILLIS = "location_access_check_interval_millis"; field public static final int LOCATION_MODE_ON = 3; // 0x3 field public static final String LOCATION_PERMISSIONS_UPGRADE_TO_Q_MODE = "location_permissions_upgrade_to_q_mode"; field public static final String LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS = "lock_screen_allow_private_notifications"; field public static final String LOCK_SCREEN_SHOW_NOTIFICATIONS = "lock_screen_show_notifications"; Loading cmds/statsd/src/StatsService.cpp +51 −21 Original line number Diff line number Diff line Loading @@ -1202,9 +1202,10 @@ Status StatsService::unregisterPullerCallback(int32_t atomTag, const String16& p return Status::ok(); } Status StatsService::sendBinaryPushStateChangedAtom(const android::String16& trainName, int64_t trainVersionCode, int options, int32_t state, Status StatsService::sendBinaryPushStateChangedAtom(const android::String16& trainNameIn, const int64_t trainVersionCodeIn, const int options, const int32_t state, const std::vector<int64_t>& experimentIdsIn) { uid_t uid = IPCThreadState::self()->getCallingUid(); // For testing Loading @@ -1224,34 +1225,64 @@ Status StatsService::sendBinaryPushStateChangedAtom(const android::String16& tra // TODO: add verifier permission bool readTrainInfoSuccess = false; InstallTrainInfo trainInfo; if (trainVersionCode == -1 || experimentIdsIn.empty() || trainName.size() == 0) { readTrainInfoSuccess = StorageManager::readTrainInfo(trainInfo); InstallTrainInfo trainInfoOnDisk; readTrainInfoSuccess = StorageManager::readTrainInfo(trainInfoOnDisk); bool resetExperimentIds = false; int64_t trainVersionCode = trainVersionCodeIn; std::string trainNameUtf8 = std::string(String8(trainNameIn).string()); if (readTrainInfoSuccess) { // Keep the old train version if we received an empty version. if (trainVersionCodeIn == -1) { trainVersionCode = trainInfoOnDisk.trainVersionCode; } else if (trainVersionCodeIn != trainInfoOnDisk.trainVersionCode) { // Reset experiment ids if we receive a new non-empty train version. resetExperimentIds = true; } // Keep the old train name if we received an empty train name. if (trainNameUtf8.size() == 0) { trainNameUtf8 = trainInfoOnDisk.trainName; } else if (trainNameUtf8 != trainInfoOnDisk.trainName) { // Reset experiment ids if we received a new valid train name. resetExperimentIds = true; } if (trainVersionCode == -1 && readTrainInfoSuccess) { trainVersionCode = trainInfo.trainVersionCode; // Reset if we received a different experiment id. if (!experimentIdsIn.empty() && (trainInfoOnDisk.experimentIds.empty() || experimentIdsIn[0] != trainInfoOnDisk.experimentIds[0])) { resetExperimentIds = true; } } // Find the right experiment IDs std::vector<int64_t> experimentIds; if (readTrainInfoSuccess && experimentIdsIn.empty()) { experimentIds = trainInfo.experimentIds; } else { if (resetExperimentIds || !readTrainInfoSuccess) { experimentIds = experimentIdsIn; } else { experimentIds = trainInfoOnDisk.experimentIds; } if (!experimentIds.empty()) { int64_t firstId = experimentIds[0]; switch (state) { case android::util::BINARY_PUSH_STATE_CHANGED__STATE__INSTALL_SUCCESS: experimentIds.push_back(firstId + 1); break; case android::util::BINARY_PUSH_STATE_CHANGED__STATE__INSTALLER_ROLLBACK_INITIATED: experimentIds.push_back(firstId + 2); break; case android::util::BINARY_PUSH_STATE_CHANGED__STATE__INSTALLER_ROLLBACK_SUCCESS: experimentIds.push_back(firstId + 3); break; } } // Flatten the experiment IDs to proto vector<uint8_t> experimentIdsProtoBuffer; writeExperimentIdsToProto(experimentIds, &experimentIdsProtoBuffer); // Find the right train name std::string trainNameUtf8; if (readTrainInfoSuccess && trainName.size() == 0) { trainNameUtf8 = trainInfo.trainName; } else { trainNameUtf8 = std::string(String8(trainName).string()); } StorageManager::writeTrainInfo(trainVersionCode, trainNameUtf8, state, experimentIds); userid_t userId = multiuser_get_user_id(uid); bool requiresStaging = options & IStatsManager::FLAG_REQUIRE_STAGING; Loading @@ -1260,7 +1291,6 @@ Status StatsService::sendBinaryPushStateChangedAtom(const android::String16& tra LogEvent event(trainNameUtf8, trainVersionCode, requiresStaging, rollbackEnabled, requiresLowLatencyMonitor, state, experimentIdsProtoBuffer, userId); mProcessor->OnLogEvent(&event); StorageManager::writeTrainInfo(trainVersionCode, trainNameUtf8, state, experimentIds); return Status::ok(); } Loading cmds/statsd/src/StatsService.h +5 −2 Original line number Diff line number Diff line Loading @@ -189,8 +189,11 @@ public: * Binder call to log BinaryPushStateChanged atom. */ virtual Status sendBinaryPushStateChangedAtom( const android::String16& trainName, int64_t trainVersionCode, int options, int32_t state, const std::vector<int64_t>& experimentIds) override; const android::String16& trainNameIn, const int64_t trainVersionCodeIn, const int options, const int32_t state, const std::vector<int64_t>& experimentIdsIn) override; /** * Binder call to get registered experiment IDs. Loading Loading
Android.bp +2 −1 Original line number Diff line number Diff line Loading @@ -687,6 +687,7 @@ java_defaults { "core/java/com/android/server/DropboxLogTags.logtags", "core/java/org/chromium/arc/EventLogTags.logtags", ":apex-properties", ":platform-properties", ":framework-statslog-gen", Loading
api/current.txt +1 −2 Original line number Diff line number Diff line Loading @@ -38820,8 +38820,7 @@ package android.provider { field @Deprecated public static final String LOCATION_MODE = "location_mode"; field @Deprecated public static final int LOCATION_MODE_BATTERY_SAVING = 2; // 0x2 field @Deprecated public static final int LOCATION_MODE_HIGH_ACCURACY = 3; // 0x3 field @Deprecated public static final int LOCATION_MODE_OFF = 0; // 0x0 field @Deprecated public static final int LOCATION_MODE_ON = 3; // 0x3 field public static final int LOCATION_MODE_OFF = 0; // 0x0 field @Deprecated public static final int LOCATION_MODE_SENSORS_ONLY = 1; // 0x1 field @Deprecated public static final String LOCATION_PROVIDERS_ALLOWED = "location_providers_allowed"; field @Deprecated public static final String LOCK_PATTERN_ENABLED = "lock_pattern_autolock";
api/system-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -6046,6 +6046,7 @@ package android.provider { field public static final String LAST_SETUP_SHOWN = "last_setup_shown"; field public static final String LOCATION_ACCESS_CHECK_DELAY_MILLIS = "location_access_check_delay_millis"; field public static final String LOCATION_ACCESS_CHECK_INTERVAL_MILLIS = "location_access_check_interval_millis"; field public static final int LOCATION_MODE_ON = 3; // 0x3 field public static final String LOCATION_PERMISSIONS_UPGRADE_TO_Q_MODE = "location_permissions_upgrade_to_q_mode"; field public static final String LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS = "lock_screen_allow_private_notifications"; field public static final String LOCK_SCREEN_SHOW_NOTIFICATIONS = "lock_screen_show_notifications"; Loading
cmds/statsd/src/StatsService.cpp +51 −21 Original line number Diff line number Diff line Loading @@ -1202,9 +1202,10 @@ Status StatsService::unregisterPullerCallback(int32_t atomTag, const String16& p return Status::ok(); } Status StatsService::sendBinaryPushStateChangedAtom(const android::String16& trainName, int64_t trainVersionCode, int options, int32_t state, Status StatsService::sendBinaryPushStateChangedAtom(const android::String16& trainNameIn, const int64_t trainVersionCodeIn, const int options, const int32_t state, const std::vector<int64_t>& experimentIdsIn) { uid_t uid = IPCThreadState::self()->getCallingUid(); // For testing Loading @@ -1224,34 +1225,64 @@ Status StatsService::sendBinaryPushStateChangedAtom(const android::String16& tra // TODO: add verifier permission bool readTrainInfoSuccess = false; InstallTrainInfo trainInfo; if (trainVersionCode == -1 || experimentIdsIn.empty() || trainName.size() == 0) { readTrainInfoSuccess = StorageManager::readTrainInfo(trainInfo); InstallTrainInfo trainInfoOnDisk; readTrainInfoSuccess = StorageManager::readTrainInfo(trainInfoOnDisk); bool resetExperimentIds = false; int64_t trainVersionCode = trainVersionCodeIn; std::string trainNameUtf8 = std::string(String8(trainNameIn).string()); if (readTrainInfoSuccess) { // Keep the old train version if we received an empty version. if (trainVersionCodeIn == -1) { trainVersionCode = trainInfoOnDisk.trainVersionCode; } else if (trainVersionCodeIn != trainInfoOnDisk.trainVersionCode) { // Reset experiment ids if we receive a new non-empty train version. resetExperimentIds = true; } // Keep the old train name if we received an empty train name. if (trainNameUtf8.size() == 0) { trainNameUtf8 = trainInfoOnDisk.trainName; } else if (trainNameUtf8 != trainInfoOnDisk.trainName) { // Reset experiment ids if we received a new valid train name. resetExperimentIds = true; } if (trainVersionCode == -1 && readTrainInfoSuccess) { trainVersionCode = trainInfo.trainVersionCode; // Reset if we received a different experiment id. if (!experimentIdsIn.empty() && (trainInfoOnDisk.experimentIds.empty() || experimentIdsIn[0] != trainInfoOnDisk.experimentIds[0])) { resetExperimentIds = true; } } // Find the right experiment IDs std::vector<int64_t> experimentIds; if (readTrainInfoSuccess && experimentIdsIn.empty()) { experimentIds = trainInfo.experimentIds; } else { if (resetExperimentIds || !readTrainInfoSuccess) { experimentIds = experimentIdsIn; } else { experimentIds = trainInfoOnDisk.experimentIds; } if (!experimentIds.empty()) { int64_t firstId = experimentIds[0]; switch (state) { case android::util::BINARY_PUSH_STATE_CHANGED__STATE__INSTALL_SUCCESS: experimentIds.push_back(firstId + 1); break; case android::util::BINARY_PUSH_STATE_CHANGED__STATE__INSTALLER_ROLLBACK_INITIATED: experimentIds.push_back(firstId + 2); break; case android::util::BINARY_PUSH_STATE_CHANGED__STATE__INSTALLER_ROLLBACK_SUCCESS: experimentIds.push_back(firstId + 3); break; } } // Flatten the experiment IDs to proto vector<uint8_t> experimentIdsProtoBuffer; writeExperimentIdsToProto(experimentIds, &experimentIdsProtoBuffer); // Find the right train name std::string trainNameUtf8; if (readTrainInfoSuccess && trainName.size() == 0) { trainNameUtf8 = trainInfo.trainName; } else { trainNameUtf8 = std::string(String8(trainName).string()); } StorageManager::writeTrainInfo(trainVersionCode, trainNameUtf8, state, experimentIds); userid_t userId = multiuser_get_user_id(uid); bool requiresStaging = options & IStatsManager::FLAG_REQUIRE_STAGING; Loading @@ -1260,7 +1291,6 @@ Status StatsService::sendBinaryPushStateChangedAtom(const android::String16& tra LogEvent event(trainNameUtf8, trainVersionCode, requiresStaging, rollbackEnabled, requiresLowLatencyMonitor, state, experimentIdsProtoBuffer, userId); mProcessor->OnLogEvent(&event); StorageManager::writeTrainInfo(trainVersionCode, trainNameUtf8, state, experimentIds); return Status::ok(); } Loading
cmds/statsd/src/StatsService.h +5 −2 Original line number Diff line number Diff line Loading @@ -189,8 +189,11 @@ public: * Binder call to log BinaryPushStateChanged atom. */ virtual Status sendBinaryPushStateChangedAtom( const android::String16& trainName, int64_t trainVersionCode, int options, int32_t state, const std::vector<int64_t>& experimentIds) override; const android::String16& trainNameIn, const int64_t trainVersionCodeIn, const int options, const int32_t state, const std::vector<int64_t>& experimentIdsIn) override; /** * Binder call to get registered experiment IDs. Loading