Loading core/java/android/service/autofill/AutofillServiceInfo.java +18 −4 Original line number Diff line number Diff line Loading @@ -25,16 +25,20 @@ import android.content.pm.ServiceInfo; import android.content.res.Resources; import android.content.res.TypedArray; import android.content.res.XmlResourceParser; import android.metrics.LogMaker; import android.os.RemoteException; import android.util.AttributeSet; import android.util.Log; import android.util.Xml; import com.android.internal.R; import com.android.internal.logging.MetricsLogger; import com.android.internal.logging.nano.MetricsProto.MetricsEvent; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; import java.io.IOException; /** Loading Loading @@ -91,11 +95,21 @@ public final class AutofillServiceInfo { private static TypedArray getMetaDataArray(PackageManager pm, ServiceInfo si) { // Check for permissions. if (!Manifest.permission.BIND_AUTOFILL_SERVICE.equals(si.permission)) { Log.w(TAG, "AutofillService from '" + si.packageName + "' does not require permission " if (Manifest.permission.BIND_AUTOFILL.equals(si.permission)) { // Let it go for now... Log.w(TAG, "AutofillService from '" + si.packageName + "' uses unsupported " + "permission " + Manifest.permission.BIND_AUTOFILL + ". It works for " + "now, but might not be supported on future releases"); new MetricsLogger().write(new LogMaker(MetricsEvent.AUTOFILL_INVALID_PERMISSION) .setPackageName(si.packageName)); } else { Log.w(TAG, "AutofillService from '" + si.packageName + "' does not require permission " + Manifest.permission.BIND_AUTOFILL_SERVICE); throw new SecurityException("Service does not require permission " + Manifest.permission.BIND_AUTOFILL_SERVICE); } } // Get the AutoFill metadata, if declared. XmlResourceParser parser = si.loadXmlMetaData(pm, AutofillService.SERVICE_META_DATA); Loading core/res/AndroidManifest.xml +9 −0 Original line number Diff line number Diff line Loading @@ -2723,6 +2723,15 @@ <permission android:name="android.permission.BIND_AUTOFILL_SERVICE" android:protectionLevel="signature" /> <!-- Alternative version of android.permission.BIND_AUTOFILL_FIELD_CLASSIFICATION_SERVICE. This permission was renamed during the O previews but it was supported on the final O release, so we need to carry it over. <p>Protection level: signature @hide --> <permission android:name="android.permission.BIND_AUTOFILL" android:protectionLevel="signature" /> <!-- Must be required by an {@link android.service.autofill.AutofillFieldClassificationService} to ensure that only the system can bind to it. @hide This is not a third-party API (intended for OEMs and system apps). Loading proto/src/metrics_constants.proto +5 −0 Original line number Diff line number Diff line Loading @@ -5168,6 +5168,11 @@ message MetricsEvent { // OS: P ROTATION_SUGGESTION_SHOWN = 1288; // An autofill service was bound using an unofficial(but still supported) permission. // Package: Package of the autofill service // OS: P AUTOFILL_INVALID_PERMISSION = 1289; // ---- End P Constants, all P constants go above this line ---- // Add new aosp constants above this line. // END OF AOSP CONSTANTS Loading Loading
core/java/android/service/autofill/AutofillServiceInfo.java +18 −4 Original line number Diff line number Diff line Loading @@ -25,16 +25,20 @@ import android.content.pm.ServiceInfo; import android.content.res.Resources; import android.content.res.TypedArray; import android.content.res.XmlResourceParser; import android.metrics.LogMaker; import android.os.RemoteException; import android.util.AttributeSet; import android.util.Log; import android.util.Xml; import com.android.internal.R; import com.android.internal.logging.MetricsLogger; import com.android.internal.logging.nano.MetricsProto.MetricsEvent; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; import java.io.IOException; /** Loading Loading @@ -91,11 +95,21 @@ public final class AutofillServiceInfo { private static TypedArray getMetaDataArray(PackageManager pm, ServiceInfo si) { // Check for permissions. if (!Manifest.permission.BIND_AUTOFILL_SERVICE.equals(si.permission)) { Log.w(TAG, "AutofillService from '" + si.packageName + "' does not require permission " if (Manifest.permission.BIND_AUTOFILL.equals(si.permission)) { // Let it go for now... Log.w(TAG, "AutofillService from '" + si.packageName + "' uses unsupported " + "permission " + Manifest.permission.BIND_AUTOFILL + ". It works for " + "now, but might not be supported on future releases"); new MetricsLogger().write(new LogMaker(MetricsEvent.AUTOFILL_INVALID_PERMISSION) .setPackageName(si.packageName)); } else { Log.w(TAG, "AutofillService from '" + si.packageName + "' does not require permission " + Manifest.permission.BIND_AUTOFILL_SERVICE); throw new SecurityException("Service does not require permission " + Manifest.permission.BIND_AUTOFILL_SERVICE); } } // Get the AutoFill metadata, if declared. XmlResourceParser parser = si.loadXmlMetaData(pm, AutofillService.SERVICE_META_DATA); Loading
core/res/AndroidManifest.xml +9 −0 Original line number Diff line number Diff line Loading @@ -2723,6 +2723,15 @@ <permission android:name="android.permission.BIND_AUTOFILL_SERVICE" android:protectionLevel="signature" /> <!-- Alternative version of android.permission.BIND_AUTOFILL_FIELD_CLASSIFICATION_SERVICE. This permission was renamed during the O previews but it was supported on the final O release, so we need to carry it over. <p>Protection level: signature @hide --> <permission android:name="android.permission.BIND_AUTOFILL" android:protectionLevel="signature" /> <!-- Must be required by an {@link android.service.autofill.AutofillFieldClassificationService} to ensure that only the system can bind to it. @hide This is not a third-party API (intended for OEMs and system apps). Loading
proto/src/metrics_constants.proto +5 −0 Original line number Diff line number Diff line Loading @@ -5168,6 +5168,11 @@ message MetricsEvent { // OS: P ROTATION_SUGGESTION_SHOWN = 1288; // An autofill service was bound using an unofficial(but still supported) permission. // Package: Package of the autofill service // OS: P AUTOFILL_INVALID_PERMISSION = 1289; // ---- End P Constants, all P constants go above this line ---- // Add new aosp constants above this line. // END OF AOSP CONSTANTS Loading