Watch for profile changes and push to user manager
If the contacts Me Profile changes, push a copy of the photo to
user manager for user by the user switcher.
Also use an async task to load the profile data.
Change-Id: Ie784114622038ff14e3feb70f2ff51c372eecb3f
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 24fc8b0..b1dd657 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -59,6 +59,7 @@
<uses-permission android:name="android.permission.INTERACT_ACROSS_USERS_FULL" />
<uses-permission android:name="android.permission.COPY_PROTECTED_DATA" />
<uses-permission android:name="android.permission.MANAGE_USERS" />
+ <uses-permission android:name="android.permission.READ_PROFILE" />
<application android:label="@string/settings_label"
android:icon="@mipmap/ic_launcher_settings"
@@ -1489,5 +1490,12 @@
</intent-filter>
</receiver>
+ <!-- Watch for ContactsContract.Profile changes and update the user's photo. -->
+ <receiver android:name=".users.ProfileUpdateReceiver">
+ <intent-filter>
+ <action android:name="android.provider.Contacts.PROFILE_CHANGED" />
+ </intent-filter>
+ </receiver>
+
</application>
</manifest>