Merge "Initial libmemtrack" into klp-dev
diff --git a/healthd/healthd.cpp b/healthd/healthd.cpp
index 1719c22..9b84c3e 100644
--- a/healthd/healthd.cpp
+++ b/healthd/healthd.cpp
@@ -249,6 +249,9 @@
             if (events[n].data.ptr)
                 (*(void (*)())events[n].data.ptr)();
         }
+
+        if (!nevents)
+            periodic_chores();
     }
 
     return;
diff --git a/include/system/audio.h b/include/system/audio.h
index b90f4a9..aa7ac02 100644
--- a/include/system/audio.h
+++ b/include/system/audio.h
@@ -72,6 +72,11 @@
                                           /*  play the mix captured by this audio source.      */
     AUDIO_SOURCE_CNT,
     AUDIO_SOURCE_MAX                 = AUDIO_SOURCE_CNT - 1,
+    AUDIO_SOURCE_HOTWORD             = 1999, /* A low-priority, preemptible audio source for
+                                                for background software hotword detection.
+                                                Same tuning as AUDIO_SOURCE_VOICE_RECOGNITION.
+                                                Used only internally to the framework. Not exposed
+                                                at the audio HAL. */
 } audio_source_t;
 
 /* special audio session values
diff --git a/rootdir/init.rc b/rootdir/init.rc
index 6140ba1..19ab6cc 100644
--- a/rootdir/init.rc
+++ b/rootdir/init.rc
@@ -42,13 +42,13 @@
     mkdir /acct/uid
 
 # Create cgroup mount point for memory
-    mount tmpfs none /sys/fs/cgroup
-    mkdir /sys/fs/cgroup/memory
+    mount tmpfs none /sys/fs/cgroup mode=0750,uid=0,gid=1000
+    mkdir /sys/fs/cgroup/memory 0750 root system
     mount cgroup none /sys/fs/cgroup/memory memory
     write /sys/fs/cgroup/memory/memory.move_charge_at_immigrate 1
     chown root system /sys/fs/cgroup/memory/tasks
     chmod 0660 /sys/fs/cgroup/memory/tasks
-    mkdir /sys/fs/cgroup/memory/sw
+    mkdir /sys/fs/cgroup/memory/sw 0750 root system
     write /sys/fs/cgroup/memory/sw/memory.swappiness 100
     write /sys/fs/cgroup/memory/sw/memory.move_charge_at_immigrate 1
     chown root system /sys/fs/cgroup/memory/sw/tasks