o property
O.
Released publicly as Android 8.0 in August 2017.
Applications targeting this or a later release will get these new changes in behavior. For more information about this release, see the Android Oreo overview.
-
Background execution limits are applied to the application.
-
The behavior of
AccountManager's AccountManager.getAccountsByType(String)
,AccountManager.getAccountsByTypeAndFeatures(String, String, AccountManagerCallback, Handler)
, andAccountManager.hasFeatures(Account, String, AccountManagerCallback, Handler)
has changed as documented there. -
ActivityManager.RunningAppProcessInfo.IMPORTANCE_PERCEPTIBLE_PRE_26
is now returned asActivityManager.RunningAppProcessInfo.IMPORTANCE_PERCEPTIBLE
. -
The
NotificationManager
now requires the use of notification channels. -
Changes to the strict mode that are set in
Application.onCreate
will no longer be clobbered after that function returns. -
A shared library apk with native code will have that native code included in the library path of its clients.
-
Context.getSharedPreferences
in credential encrypted storage will throw an exception before the user is unlocked. -
Attempting to retrieve a
Context#FINGERPRINT_SERVICE
on a device that does not support that feature will now throw a runtime exception. -
Fragment
will stop any active view animations when the fragment is stopped. -
Some compatibility code in Resources that attempts to use the default Theme the app may be using will be turned off, requiring the app to explicitly request resources with the right theme.
-
ContentResolver.notifyChange
andContentResolver.registerContentObserver
will throw a SecurityException if the caller does not have permission to access the provider (or the provider doesn't exit); otherwise the call will be silently ignored. -
CameraDevice.createCaptureRequest
will enableCaptureRequest.CONTROL_ENABLE_ZSL
by default for still image capture. -
WallpaperManager's
WallpaperManager.getWallpaperFile(int)
,WallpaperManager.getDrawable()
,WallpaperManager.getFastDrawable()
,WallpaperManager.peekDrawable()
, andWallpaperManager.peekFastDrawable()
will throw an exception if you can not access the wallpaper. -
The behavior of
UsbDeviceConnection.requestWait
is modified as per the documentation there. -
StrictMode.VmPolicy.Builder.detectAll
will also enableStrictMode.VmPolicy.Builder#detectContentUriWithoutPermission
andStrictMode.VmPolicy.Builder#detectUntaggedSockets
. -
StrictMode.ThreadPolicy.Builder.detectAll
will also enableStrictMode.ThreadPolicy.Builder#detectUnbufferedIo
. -
DocumentsContract
's various methods will throw failure exceptions back to the caller instead of returning null. -
View.hasFocusable
now includes auto-focusable views. -
SurfaceView
will no longer always change the underlying Surface object when something about it changes; apps need to look at the current state of the object to determine which things they are interested in have changed. -
WindowManager.LayoutParams.TYPE_APPLICATION_OVERLAY
must be used for overlay windows, other system overlay window types are not allowed. -
ViewTreeObserver.addOnDrawListener
will throw an exception if called from within onDraw. -
Canvas.setBitmap
will no longer preserve the current matrix and clip stack of the canvas. -
ListPopupWindow.setHeight
will throw an exception if a negative height is supplied. -
TextView
will use internationalized input for numbers, dates, and times. -
Toast
must be used for showing toast windows; the toast window type can not be directly used. -
WifiManager.getConnectionInfo
requires that the caller hold the location permission to return BSSID/SSID -
WifiP2pManager.requestPeers
requires the caller hold the location permission. -
R.attr.maxAspectRatio
defaults to 0, meaning there is no restriction on the app's maximum aspect ratio (so it can be stretched to fill larger screens). -
R.attr.focusable
defaults to a new state (auto) where it will inherit the value ofR.attr.clickable
unless explicitly overridden. -
A default theme-appropriate focus-state highlight will be supplied to all Views which don't provide a focus-state drawable themselves. This can be disabled by setting
R.attr.defaultFocusHighlightEnabled
to false.
Constant Value: 26 (0x0000001a)
Added in API level 26
Implementation
static int get o => Build_VERSION_CODES.O;