I have arrived at Android Studio 3.0.0 (from the stable channel) via 3.0.0-rcX (from the Canary channel).
When I start a brand new app and build it, the following code (inside the app) shows that the FLAG_TEST_ONLY flag is set.
Log.e(TAG, "ApplicationInfo: " + (getApplicationInfo().flags & ApplicationInfo.FLAG_TEST_ONLY));
10-31 09:54:05.226 16129-16129/com.example.dummy E/MainActivity: ApplicationInfo: 256
The app's manifest is:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.dummy">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
The flag stops Device Policy Controllers from being able to install it: Upgrading app in background using Device Policy Controller
Why is this flag set, and how to I stop it from being set?