Switch framework to using new scheduled-work API

Also add the intended permission-use enforcement to said API.

Bug 14994893
Bug 14993295

Change-Id: I5a3ffd32d0702c68f4ef6da68f7fa6e9de674380
diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml
index 90d49968..d34181e 100644
--- a/core/res/AndroidManifest.xml
+++ b/core/res/AndroidManifest.xml
@@ -1754,12 +1754,13 @@
         android:label="@string/permlab_recovery"
         android:description="@string/permdesc_recovery" />
 
-    <!-- Allows the system to bind to an application's idle services
+    <!-- Allows the system to bind to an application's task services
          @hide -->
-    <permission android:name="android.permission.BIND_IDLE_SERVICE"
+    <permission android:name="android.permission.BIND_TASK_SERVICE"
         android:protectionLevel="signature"
-        android:label="@string/permlab_bindIdleService"
-        android:description="@string/permdesc_bindIdleService" />
+        android:label="@string/permlab_bindTaskService"
+        android:description="@string/permdesc_bindTaskService" />
+    <uses-permission android:name="android.permission.BIND_TASK_SERVICE"/>
 
     <!-- ========================================= -->
     <!-- Permissions for special development tools -->
@@ -2875,10 +2876,7 @@
 
         <service android:name="com.android.server.MountServiceIdler"
                  android:exported="false"
-                 android:permission="android.permission.BIND_IDLE_SERVICE" >
-            <intent-filter>
-                <action android:name="android.service.idle.IdleService" />
-            </intent-filter>
+                 android:permission="android.permission.BIND_TASK_SERVICE" >
         </service>
 
     </application>