Home | History | Annotate | Download | only in 3_software
      1 ## 3.5\. API Behavioral Compatibility
      2 
      3 The behaviors of each of the API types (managed, soft, native, and web) must be
      4 consistent with the preferred implementation of the upstream
      5 [Android Open Source Project](http://source.android.com/). Some specific areas
      6 of compatibility are:
      7 
      8 *    [C-0-1] Devices MUST NOT change the behavior or semantics of a
      9      standard intent.
     10 *    [C-0-2] Devices MUST NOT alter the lifecycle or lifecycle semantics of
     11      a particular type of system component (such as Service, Activity, ContentProvider, etc.).
     12 *    [C-0-3] Devices MUST NOT change the semantics of a standard permission.
     13 *    Devices MUST NOT alter the limitations enforced on background applications.
     14      More specifically, for background apps:
     15      *    [C-0-4] they MUST stop executing callbacks that are registered by the
     16           app to receive outputs from the [`GnssMeasurement`](
     17           https://developer.android.com/reference/android/location/GnssMeasurement.html)
     18           and [`GnssNavigationMessage`](
     19           https://developer.android.com/reference/android/location/GnssNavigationMessage.html).
     20      *    [C-0-5] they MUST rate-limit the frequency of updates that are
     21           provided to the app through the [`LocationManager`](
     22           https://developer.android.com/reference/android/location/LocationManager.html)
     23           API class or the [`WifiManager.startScan()`](
     24           https://developer.android.com/reference/android/net/wifi/WifiManager.html#startScan%28%29)
     25           method.
     26      *    [C-0-6] if the app is targeting API level 25 or higher, they MUST NOT
     27           allow to register broadcast receivers for the implicit broadcasts of
     28           standard Android intents in the app's manifest, unless the broadcast
     29           intent requires a `"signature"` or `"signatureOrSystem"`
     30           [`protectionLevel`](
     31           https://developer.android.com/guide/topics/manifest/permission-element.html#plevel)
     32           permission or are on the [exemption list](
     33           https://developer.android.com/preview/features/background-broadcasts.html)
     34           .
     35      *    [C-0-7] if the app is targeting API level 25 or higher, they MUST stop
     36           the app's background services, just as if the app had called the
     37           services'[`stopSelf()`](
     38           https://developer.android.com/reference/android/app/Service.html#stopSelf%28%29)
     39           method, unless the app is placed on a temporary whitelist to handle a
     40           task that's visible to the user.
     41      *    [C-0-8] if the app is targeting API level 25 or higher, they MUST
     42           release the wakelocks the app holds.
     43 
     44 The above list is not comprehensive. The Compatibility Test Suite (CTS) tests
     45 significant portions of the platform for behavioral compatibility, but not all.
     46 It is the responsibility of the implementer to ensure behavioral compatibility
     47 with the Android Open Source Project. For this reason, device implementers
     48 SHOULD use the source code available via the Android Open Source Project where
     49 possible, rather than re-implement significant parts of the system.