Save status and set up sync adapter.

There are two parts to this CL:
1. Set up the sync adapter - this involves relevant xml files and
additions to the manifest and subclassing the general VvmSyncAdapter.
2. Processing the status sms that activates the voicemail source -
saving it to the voicemail status database and registering a sync
account.
These were done together because in order to have a fully-functioning
sync adapter, at least one sync account must be registered for it.

Also moved the code from VvmSyncService to OmtpVvmSyncService because
there's no need to have a super class yet. Note that most of the syncing
logic was removed for now so it  can be added incrementally.

Bug: 19236241
Change-Id: If2baf43de4bd70761feadd2d2bd5c4f58c25d19b
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 14a283a..dcdae0c 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -98,6 +98,10 @@
     <uses-permission android:name="android.permission.REGISTER_CALL_PROVIDER" />
     <uses-permission android:name="android.permission.REGISTER_SIM_SUBSCRIPTION" />
     <uses-permission android:name="android.permission.BIND_CARRIER_MESSAGING_SERVICE" />
+    <uses-permission android:name="android.permission.READ_SYNC_SETTINGS" />
+    <uses-permission android:name="android.permission.WRITE_SYNC_SETTINGS" />
+    <uses-permission android:name="android.permission.AUTHENTICATE_ACCOUNTS" />
+    <uses-permission android:name="android.permission.MANAGE_ACCOUNTS" />
 
     <!-- This tells the activity manager to not delay any of our activity
          start requests, even if they happen immediately after the user
@@ -583,7 +587,6 @@
                 <action android:name="android.content.action.SEARCH_INDEXABLES_PROVIDER" />
             </intent-filter>
         </provider>
-
         <receiver android:name="com.android.phone.vvm.omtp.sms.OmtpMessageReceiver"
             android:exported="true">
             <intent-filter>
@@ -591,5 +594,24 @@
                 <data android:scheme="sms" />
             </intent-filter>
         </receiver>
+        <service
+                android:name="com.android.phone.vvm.omtp.OmtpVvmSyncService"
+                android:exported="true"
+                android:process=":sync">
+            <intent-filter>
+                <action android:name="android.content.SyncAdapter"/>
+            </intent-filter>
+            <meta-data android:name="android.content.SyncAdapter"
+                    android:resource="@xml/syncadapter" />
+        </service>
+        <service
+            android:name="android.telecom.AuthenticatorService">
+        <intent-filter>
+            <action android:name="android.accounts.AccountAuthenticator"/>
+        </intent-filter>
+        <meta-data
+            android:name="android.accounts.AccountAuthenticator"
+            android:resource="@xml/authenticator" />
+       </service>
     </application>
 </manifest>