Platforma Android 15 zawiera zmiany w działaniu, które mogą mieć wpływ na Twoją aplikację.
Poniższe zmiany w działaniu mają zastosowanie do wszystkich aplikacji działających na Androidzie 15, niezależnie od targetSdkVersion
. Przetestuj aplikację, a następnie w razie potrzeby zmodyfikuj ją, aby prawidłowo obsługiwała te funkcje.
Sprawdź też listę zmian w zachowaniu, które mają wpływ tylko na aplikacje kierowane na Androida 15.
Główna funkcja
Android 15 modyfikuje lub rozszerza różne podstawowe funkcje systemu Android.
Zmiany stanu zatrzymania pakietu
The intention of the package FLAG_STOPPED
state (which users
can engage in AOSP builds by long-pressing an app icon and selecting "Force
Stop") has always been to keep apps in this state until the user explicitly
removes the app from this state by directly launching the app or indirectly
interacting with the app (through the sharesheet or a widget, selecting the app
as live wallpaper, etc.). In Android 15, we've updated the behavior of the
system to be aligned with this intended behavior. Apps should only be removed
from the stopped state through direct or indirect user action.
To support the intended behavior, in addition to the existing restrictions, the
system also cancels all pending intents when the app enters the
stopped state on a device running Android 15. When the user's actions remove the
app from the stopped state, the ACTION_BOOT_COMPLETED
broadcast is delivered to the app providing an opportunity to re-register any
pending intents.
You can call the new
ApplicationStartInfo.wasForceStopped()
method to confirm whether the app was put into the stopped state.
Obsługa rozmiarów stron 16 KB
W przeszłości Android obsługiwał tylko strony pamięci o rozmiarze 4 KB, co optymalizowało wydajność pamięci systemowej pod kątem średniej ilości pamięci całkowitej, jaką zwykle miały urządzenia z Androidem. Od Androida 15 AOSP obsługuje urządzenia skonfigurowane do używania rozmiaru strony 16 KB (urządzenia 16 KB). Jeśli Twoja aplikacja używa bibliotek NDK bezpośrednio lub pośrednio za pomocą pakietu SDK, musisz ją przebudować, aby działała na urządzeniach o rozmiarze strony 16 KB.
Producenci urządzeń nadal tworzą urządzenia z większą ilością pamięci fizycznej (RAM). Wiele z nich będzie korzystać ze stron o rozmiarze 16 KB (a w przyszłości większych), aby zoptymalizować wydajność urządzenia. Dodanie obsługi urządzeń ze stronami o rozmiarze 16 KB umożliwia uruchamianie aplikacji na tych urządzeniach i korzystanie z powiązanych z tym ulepszeń wydajności. Bez ponownej kompilacji aplikacje nie będą działać na urządzeniach 16 KB w przyszłych wersjach Androida.
Aby pomóc Ci dodać obsługę w aplikacji, przygotowaliśmy wskazówki dotyczące sprawdzania, czy zmiana ma wpływ na Twoją aplikację, ponownego jej kompilowania (w odpowiednich przypadkach) oraz testowania aplikacji w środowisku 16 KB przy użyciu emulatorów (w tym obrazów systemu Android 15 dla emulatora Androida).
Benefits and performance gains
Urządzenia skonfigurowane z użyciem stron o rozmiarze 16 KB zużywają średnio nieco więcej pamięci, ale zyskują też różne ulepszenia wydajności zarówno systemu, jak i aplikacji:
- Krótszy czas uruchamiania aplikacji, gdy system jest pod presją pamięci: średnio o 3,16% krótszy, a w przypadku niektórych testowanych aplikacji o znacznie więcej (do 30%).
- Zmniejszone zużycie energii podczas uruchamiania aplikacji: średnio o 4,56%
- Szybsze uruchamianie aparatu: średnio o 4,48% szybsze uruchomienia z pamięci i o 6,60% szybsze uruchomienia „na zimno”
- Skrócony czas uruchamiania systemu: skrócenie o 8% (około 950 milisekund)
Te ulepszenia bazują na naszych wstępnych testach. Wyniki na rzeczywistych urządzeniach mogą się różnić. W miarę kontynuowania testów będziemy przeprowadzać dodatkową analizę potencjalnych zysków w przypadku aplikacji.
Check if your app is impacted
If your app uses any native code, then you should rebuild your app with support for 16 KB devices. If you are unsure if your app uses native code, you can use the APK Analyzer to identify whether any native code is present and then check the alignment of ELF segments for any shared libraries that you find. Android Studio also provides features that help you to automatically detect alignment issues.
If your app only uses code written in the Java programming language or in Kotlin, including all libraries or SDKs, then your app already supports 16 KB devices. Nevertheless, we recommend that you test your app in a 16 KB environment to verify that there are no unexpected regressions in app behavior.
Wymagane zmiany w niektórych aplikacjach, aby obsługiwały przestrzeń prywatną
Private space is a new feature in Android 15 that lets users create a separate space on their device where they can keep sensitive apps away from prying eyes, under an additional layer of authentication. Because apps in the private space have restricted visibility, some types of apps need to take additional steps to be able to see and interact with apps in a user's private space.
All apps
Because apps in the private space are kept in a separate user profile, similar to work profiles, apps shouldn't assume that any installed copies of their app that aren't in the main profile are in the work profile. If your app has logic related to work profile apps that make this assumption, you'll need to adjust this logic.
Medical apps
When a user locks the private space, all apps in the private space are stopped, and those apps can't perform foreground or background activities, including showing notifications. This behavior might critically impact the use and function of medical apps installed in the private space.
The private space setup experience warns users that the private space is not suitable for apps that need to perform critical foreground or background activities, such as showing notifications from medical apps. However, apps can't determine whether or not they're being used in the private space, so they can't show a warning to the user for this case.
For these reasons, if you develop a medical app, review how this feature might impact your app and take appropriate actions—such as informing your users not to install your app in the private space—to avoid disrupting critical app capabilities.
Launcher apps
If you develop a launcher app, you must do the following before apps in the private space will be visible:
- Your app must be assigned as the default launcher app for the device—that
is, possessing the
ROLE_HOME
role. - Your app must declare the
ACCESS_HIDDEN_PROFILES
normal permission in your app's manifest file.
Launcher apps that declare the ACCESS_HIDDEN_PROFILES
permission must handle
the following private space use cases:
- Your app must have a separate launcher container for apps installed in the
private space. Use the
getLauncherUserInfo()
method to determine which type of user profile is being handled. - The user must be able to hide and show the private space container.
- The user must be able to lock and unlock the private space container. Use
the
requestQuietModeEnabled()
method to lock (by passingtrue
) or unlock (by passingfalse
) the private space. While locked, no apps in the private space container should be visible or discoverable through mechanisms such as search. Your app should register a receiver for the
ACTION_PROFILE_AVAILABLE
andACTION_PROFILE_UNAVAILABLE
broadcasts and update the UI in your app when the locked or unlocked state of the private space container changes. Both of these broadcasts includeEXTRA_USER
, which your app can use to refer to the private profile user.You can also use the
isQuietModeEnabled()
method to check whether the private space profile is locked or not.
App store apps
The private space includes an "Install Apps" button that launches an implicit
intent to install apps into the user's private space. In order for your app to
receive this implicit intent, declare an <intent-filter>
in your app's manifest file with a <category>
of
CATEGORY_APP_MARKET
.
Czcionka emotikonów oparta na PNG została usunięta
The legacy, PNG-based emoji font file (NotoColorEmojiLegacy.ttf
) has been
removed, leaving just the vector-based file. Beginning with Android 13 (API
level 33), the emoji font file used by the system emoji renderer changed from a
PNG-based file to a vector based file. The system retained
the legacy font file in Android 13 and 14 for compatibility reasons, so that
apps with their own font renderers could continue to use the legacy font file
until they were able to upgrade.
To check if your app is affected, search your app's code for references to the
NotoColorEmojiLegacy.ttf
file.
You can choose to adapt your app in a number of ways:
- Use platform APIs for text rendering. You can render text to a bitmap-backed
Canvas
and use that to get a raw image if necessary. - Add COLRv1 font support to your app. The FreeType open source library supports COLRv1 in version 2.13.0 and higher.
- As a last resort, you can bundle the legacy emoji font file
(
NotoColorEmoji.ttf
) into your APK, although in that case your app will be missing the latest emoji updates. For more information, see the Noto Emoji GitHub project page.
Zwiększenie minimalnej docelowej wersji pakietu SDK z 23 do 24
Android 15 builds on the
the changes that were made in Android 14 and extends this
security further. In Android 15, apps with a
targetSdkVersion
lower than 24 can't be installed.
Requiring apps to meet modern API levels helps to ensure better security and
privacy.
Malware often targets lower API levels in order to bypass security and privacy
protections that have been introduced in higher Android versions. For example,
some malware apps use a targetSdkVersion
of 22 to avoid being subjected to the
runtime permission model introduced in 2015 by Android 6.0 Marshmallow (API
level 23). This Android 15 change makes it harder for malware to avoid security
and privacy improvements. Attempting to install an app targeting a lower API
level results in an installation failure, with a message like the following one
appearing in Logcat:
INSTALL_FAILED_DEPRECATED_SDK_VERSION: App package must target at least SDK version 24, but found 7
On devices upgrading to Android 15, any apps with a targetSdkVersion
lower
than 24 remain installed.
If you need to test an app targeting an older API level, use the following ADB command:
adb install --bypass-low-target-sdk-block FILENAME.apk
Prywatność i bezpieczeństwo
Android 15 introduces robust measures to combat one-time passcode (OTP) fraud and to protect the user's sensitive content, focusing on hardening the Notification Listener Service and screenshare protections. Key enhancements include redacting OTPs from notifications accessible to untrusted apps, hiding notifications during screenshare, and securing app activities when OTPs are posted. These changes aim to keep the user's sensitive content safe from unauthorized actors.
Developers need to be aware of the following to ensure their apps are compatible with the changes in Android 15:
OTP Redaction
Android will stop untrusted apps that implement a
NotificationListenerService
from reading unredacted content
from notifications where an OTP has been detected. Trusted apps such as
companion device manager associations are exempt from these restrictions.
Screenshare Protection
- Notification content is hidden during screen sharing sessions to preserve
the user's privacy. If the app implements
setPublicVersion()
, Android shows the public version of the notification which serves as a replacement notification in insecure contexts. Otherwise, the notification content is redacted without any further context. - Sensitive content like password input is hidden from remote viewers to prevent revealing the user's sensitive information.
- Activities from apps that post notifications during screenshare where an OTP has been detected will be hidden. App content is hidden from the remote viewer when launched.
- Beyond Android's automatic identification of sensitive fields, developers
can manually mark parts of their app as sensitive using
setContentSensitivity
, which is hidden from remote viewers during screenshare. - Developers can choose to toggle the Disable screen share protections option under Developer Options to be exempted from the screenshare protections for demo or testing purposes. The default system screen recorder is exempted from these changes, since the recordings remain on-device.
Aparat i multimedia
Android 15 wprowadza te zmiany w działaniu aparatu i multimediów we wszystkich aplikacjach.
Bezpośrednie i przeniesione odtwarzanie dźwięku unieważnia wcześniej otwarte bezpośrednie lub przeniesione ścieżki audio po osiągnięciu limitów zasobów.
Przed Androidem 15, jeśli aplikacja poprosiła o bezpośrednie odtwarzanie lub odciążenie audio, gdy inna aplikacja odtwarzała dźwięk i zostały osiągnięte limity zasobów, nie można było otworzyć nowego AudioTrack
.
Od Androida 15, gdy aplikacja prosi o odtwarzanie bezpośrednie lub z wykorzystaniem offloadu i osiąga limity zasobów, system unieważnia wszystkie aktualnie otwarte obiekty AudioTrack
, które uniemożliwiają spełnienie żądania dotyczącego nowego utworu.
(Płyty audio z trekiem bezpośrednim i z trekiem z płyty są zwykle otwierane w celu odtwarzania skompresowanych formatów audio. Typowe przypadki odtwarzania dźwięku bezpośredniego obejmują przesyłanie strumieniowe zakodowanego dźwięku przez HDMI do telewizora. Płyty z przesłanymi ścieżkami są zwykle używane do odtwarzania skompresowanego dźwięku na urządzeniu mobilnym z akceleracją DSP sprzętową.
Interfejs użytkownika i systemu
Android 15 zawiera kilka zmian, które mają na celu zapewnienie bardziej spójnej i intuicyjnej obsługi.
Animacje przewidywanego przejścia wstecz włączone w przypadku aplikacji, które wyraziły na to zgodę
Od Androida 15 opcja dla programistów dotycząca animacji przewidywanego przejścia wstecz została usunięta. Systemowe animacje takie jak animacja powrotu do ekranu głównego, animacja przełączania zadań i animacja przełączania aktywności są teraz wyświetlane w aplikacjach, które włączyły przewidujący gest wsteczny w całości lub na poziomie aktywności. Jeśli Twoja aplikacja jest dotknięta, wykonaj te czynności:
- Upewnij się, że aplikacja została prawidłowo przeniesiona, aby można było używać przewidującego gestu wstecz.
- Upewnij się, że przejścia między fragmentami działają z przewidywaną nawigacją wstecz.
- Zrezygnuj z animacji i przejść w ramach, a zamiast nich używaj animatora i przejść androidx.
- Przejdź z poziomów podrzędnych, których
FragmentManager
nie zna. Używaj zamiast nich stosów powrotnych zarządzanych przezFragmentManager
lub komponent Nawigacja.
Widżety wyłączane, gdy użytkownik wymusi zatrzymanie aplikacji
If a user force-stops an app on a device running Android 15, the system temporarily disables all the app's widgets. The widgets are grayed out, and the user cannot interact with them. This is because beginning with Android 15, the system cancels all an app's pending intents when the app is force-stopped.
The system re-enables those widgets the next time the user launches the app.
For more information, see Changes to package stopped state.
Pasek stanu projekcji multimediów informuje użytkowników o udostępnianiu, przesyłaniu i nagrywaniu ekranu
Wykorzystanie funkcji udostępniania ekranu ujawnia prywatne dane użytkowników, takie jak informacje finansowe, ponieważ użytkownicy nie zdają sobie sprawy, że ich ekran jest udostępniany.
W przypadku aplikacji działających na urządzeniach z Androidem 15 QPR1 lub nowszym na pasku stanu wyświetla się duży i wyróżniony element, który informuje użytkowników o trwającej projekcji ekranu. Użytkownicy mogą kliknąć element, aby zatrzymać udostępnianie, przesyłanie lub nagrywanie ekranu. Projekcja ekranu jest też automatycznie zatrzymywana, gdy ekran urządzenia jest zablokowany.

Check if your app is impacted
By default, your app includes the status bar chip and automatically suspends screen projection when the lock screen activates.
To learn more about how to test your app for these use cases, see Status bar chip and auto stop.
Ograniczenia dostępu do sieci w tle
In Android 15, apps that start a network request outside of a valid process
lifecycle receive an exception. Typically, an
UnknownHostException
or other socket-related
IOException
. Network requests that happen outside of a valid lifecycle are
usually due to apps unknowingly continuing a network request even after the app
is no longer active.
To mitigate this exception, ensure your network requests are lifecycle aware and cancelled upon leaving a valid process lifecycle by using lifecycle aware components. If it is important that the network request should happen even when the user leaves the application, consider scheduling the network request using WorkManager or continue a user visible task using Foreground Service.
Wycofane
Z każdą kolejną wersją niektóre interfejsy API Androida mogą stać się przestarzałe lub wymagać refaktoryzacji, aby zapewnić deweloperom większy komfort pracy lub obsługiwać nowe funkcje platformy. W takich przypadkach oficjalnie wycofujemy przestarzałe interfejsy API i kierujemy deweloperów do alternatywnych interfejsów API, których mogą używać zamiast nich.
Wycofanie oznacza, że zakończyliśmy oficjalne wsparcie dla interfejsów API, ale nadal będą one dostępne dla deweloperów. Więcej informacji o ważnych wycofaniach w tej wersji Androida znajdziesz na stronie wycofań.