Using Trust Agents in the android app

I am trying to use the newly added TrustAgents. Manifesto commented out in the official Android Git sources . As said after implementing such a manifest, I can extend the classes from TrustAgentService.

What is it:

<uses-permission android:name="android.permission.CONTROL_KEYGUARD" />
<uses-permission android:name="android.permission.PROVIDE_TRUST_AGENT" />

<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >

    <service android:exported="true"
             android:label="@string/app_name"
             android:name=".CustomTrustAgent"
             android:permission="android.permission.BIND_TRUST_AGENT">

        <intent-filter>
            <action android:name="android.service.trust.TrustAgentService" />
            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>

        <meta-data android:name="android.service.trust.trustagent"
                   android:value="@xml/trust_agent" />

    </service>

    <activity
        android:name=".MainActivity"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
</application>

      

But I still can't renew with TrustAgentService. Using API 22. SDK is updated to the latest version.

+3


source to share


1 answer


Unfortunately, you cannot use these APIs ... neither can I.

The reason why you cannot directly subclass TrustAgentService is because it is hidden from SDK banners using the @SystemApi annotation.



Also, android.permission.BIND_TRUST_AGENT requires signing permission.

+7


source







All Articles