summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Kevin Chyn <kchyn@google.com> 2019-04-13 06:24:04 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2019-04-13 06:24:04 +0000
commit27a8e5b3d41e04926f969adc2c471b2525d99aaf (patch)
tree1d3b4c4054d906f7caf2a1f8e41824fc6a1297e6
parent62c6f21dac510227821cdc52fc439aa25ebd5b5b (diff)
parent34c1f8e9297649c7abc2f43b25214c7ba71ca7d9 (diff)
Merge "Adding Face Setting Stats." into qt-dev
-rw-r--r--cmds/statsd/src/atoms.proto23
-rw-r--r--cmds/statsd/src/external/StatsPullerManager.cpp3
-rw-r--r--services/core/java/com/android/server/stats/StatsCompanionService.java39
3 files changed, 64 insertions, 1 deletions
diff --git a/cmds/statsd/src/atoms.proto b/cmds/statsd/src/atoms.proto
index 544b86e026e5..55d3fba8845d 100644
--- a/cmds/statsd/src/atoms.proto
+++ b/cmds/statsd/src/atoms.proto
@@ -279,7 +279,7 @@ message Atom {
}
// Pulled events will start at field 10000.
- // Next: 10058
+ // Next: 10059
oneof pulled {
WifiBytesTransfer wifi_bytes_transfer = 10000;
WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001;
@@ -339,6 +339,7 @@ message Atom {
GpuStatsAppInfo gpu_stats_app_info = 10055;
SystemIonHeapSize system_ion_heap_size = 10056;
AppsOnExternalStorageInfo apps_on_external_storage_info = 10057;
+ FaceSettings face_settings = 10058;
}
// DO NOT USE field numbers above 100,000 in AOSP.
@@ -5926,3 +5927,23 @@ message AppsOnExternalStorageInfo {
// The name of the package that is installed on the external storage.
optional string package_name = 2;
}
+
+/**
+ * Logs the settings related to Face.
+ * Logged from:
+ * frameworks/base/services/core/java/com/android/server/stats
+ */
+message FaceSettings {
+ // Whether or not face unlock is allowed on Keyguard.
+ optional bool unlock_keyguard_enabled = 1;
+ // Whether or not face unlock dismisses the Keyguard.
+ optional bool unlock_dismisses_keyguard = 2;
+ // Whether or not face unlock requires attention.
+ optional bool unlock_attention_required = 3;
+ // Whether or not face unlock is allowed for apps (through BiometricPrompt).
+ optional bool unlock_app_enabled = 4;
+ // Whether or not face unlock always requires user confirmation.
+ optional bool unlock_always_require_confirmation = 5;
+ // Whether or not a diverse set of poses are required during enrollment.
+ optional bool unlock_diversity_required = 6;
+}
diff --git a/cmds/statsd/src/external/StatsPullerManager.cpp b/cmds/statsd/src/external/StatsPullerManager.cpp
index d6411a748081..51839c4077bc 100644
--- a/cmds/statsd/src/external/StatsPullerManager.cpp
+++ b/cmds/statsd/src/external/StatsPullerManager.cpp
@@ -254,6 +254,9 @@ std::map<int, PullAtomInfo> StatsPullerManager::kAllPullAtomInfo = {
// AppsOnExternalStorageInfo
{android::util::APPS_ON_EXTERNAL_STORAGE_INFO,
{.puller = new StatsCompanionServicePuller(android::util::APPS_ON_EXTERNAL_STORAGE_INFO)}},
+ // Face Settings
+ {android::util::FACE_SETTINGS,
+ {.puller = new StatsCompanionServicePuller(android::util::FACE_SETTINGS)}},
};
StatsPullerManager::StatsPullerManager() : mNextPullTimeNs(NO_ALARM_UPDATE) {
diff --git a/services/core/java/com/android/server/stats/StatsCompanionService.java b/services/core/java/com/android/server/stats/StatsCompanionService.java
index 96924c04e5e1..10ed88f49231 100644
--- a/services/core/java/com/android/server/stats/StatsCompanionService.java
+++ b/services/core/java/com/android/server/stats/StatsCompanionService.java
@@ -92,6 +92,7 @@ import android.os.UserManager;
import android.os.storage.DiskInfo;
import android.os.storage.StorageManager;
import android.os.storage.VolumeInfo;
+import android.provider.Settings;
import android.stats.storage.StorageEnums;
import android.telephony.ModemActivityInfo;
import android.telephony.TelephonyManager;
@@ -2057,6 +2058,40 @@ public class StatsCompanionService extends IStatsCompanionService.Stub {
}
}
+ private void pullFaceSettings(int tagId, long elapsedNanos, long wallClockNanos,
+ List<StatsLogEventWrapper> pulledData) {
+ long callingToken = Binder.clearCallingIdentity();
+ try {
+ List<UserInfo> users = mContext.getSystemService(UserManager.class).getUsers();
+ int numUsers = users.size();
+ for (int userNum = 0; userNum < numUsers; userNum++) {
+ int userId = users.get(userNum).getUserHandle().getIdentifier();
+
+ StatsLogEventWrapper e =
+ new StatsLogEventWrapper(tagId, elapsedNanos, wallClockNanos);
+ e.writeBoolean(Settings.Secure.getIntForUser(mContext.getContentResolver(),
+ Settings.Secure.FACE_UNLOCK_KEYGUARD_ENABLED, 1,
+ userId) != 0);
+ e.writeBoolean(Settings.Secure.getIntForUser(mContext.getContentResolver(),
+ Settings.Secure.FACE_UNLOCK_DISMISSES_KEYGUARD,
+ 0, userId) != 0);
+ e.writeBoolean(Settings.Secure.getIntForUser(mContext.getContentResolver(),
+ Settings.Secure.FACE_UNLOCK_ATTENTION_REQUIRED, 1,
+ userId) != 0);
+ e.writeBoolean(Settings.Secure.getIntForUser(mContext.getContentResolver(),
+ Settings.Secure.FACE_UNLOCK_APP_ENABLED, 1,
+ userId) != 0);
+ e.writeBoolean(Settings.Secure.getIntForUser(mContext.getContentResolver(),
+ Settings.Secure.FACE_UNLOCK_ALWAYS_REQUIRE_CONFIRMATION, 0,
+ userId) != 0);
+
+ pulledData.add(e);
+ }
+ } finally {
+ Binder.restoreCallingIdentity(callingToken);
+ }
+ }
+
/**
* Pulls various data.
*/
@@ -2261,6 +2296,10 @@ public class StatsCompanionService extends IStatsCompanionService.Stub {
pullAppsOnExternalStorageInfo(tagId, elapsedNanos, wallClockNanos, ret);
break;
}
+ case StatsLog.FACE_SETTINGS: {
+ pullFaceSettings(tagId, elapsedNanos, wallClockNanos, ret);
+ break;
+ }
default:
Slog.w(TAG, "No such tagId data as " + tagId);
return null;