Hui Yu 2d4207f8c1 Change foregroundServiceType from enum to flags
1. Now the value of manifest attribute foregroundServiceType can
be multiple flags ORed together.
2. Add a overloaded version of Service.startForeground() with an
additional parameter foregroundServiceType. The flags in parameter
foregroundServiceType must be a subset of flags specified in manifest
attribute foregroundServiceType, otherwise a IllegalArgumentException is
thrown.
3. Add a field foregroundServiceType in ServiceRecord, it is the types
that have been started on this foreground sevice.

Bug: 111453223
Test: atest frameworks/base/tests/FrameworkPerf

Change-Id: I7eb68f696e6bf75720fe9c9388a6c23a529677f7
2019-01-31 11:50:18 -08:00

31 lines
1.4 KiB
XML

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android.frameworkperf">
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-sdk android:minSdkVersion="5" />
<application android:hardwareAccelerated="false">
<uses-library android:name="android.test.runner" />
<activity android:name="FrameworkPerfActivity" android:label="Framework Perf">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<service android:name="SchedulerService"
android:foregroundServiceType="dataSync|mediaPlayback|phoneCall|location|connectedDevice">
</service>
<service android:name="TestService" android:process=":test">
</service>
<service android:name="LocalTestService">
</service>
<receiver android:name="Receiver" android:exported="true">
</receiver>
</application>
<instrumentation android:name="android.test.InstrumentationTestRunner"
android:targetPackage="com.android.frameworkperf"
android:label="Framework Perf Runner"
/>
</manifest>