{"id":340165,"date":"2022-10-24T15:00:27","date_gmt":"2022-10-24T15:00:27","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=340165"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=340165","title":{"rendered":"<span>\u041e\u0442\u043a\u0443\u0434\u0430 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 TransactionTooLargeException, \u0435\u0441\u043b\u0438 \u044f \u043d\u0438\u0447\u0435\u0433\u043e \u0442\u0430\u043a\u043e\u0433\u043e \u043d\u0435 \u0434\u0435\u043b\u0430\u043b?<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/0be\/a90\/4cc\/0bea904cc85ded92f613c5572ef2ec3b.png\" width=\"1120\" height=\"630\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/0be\/a90\/4cc\/0bea904cc85ded92f613c5572ef2ec3b.png\"\/><figcaption><\/figcaption><\/figure>\n<p>Android-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u0447\u0430\u0441\u0442\u043e \u0441\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u044e\u0442 \u043d\u0430 \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0441\u043e\u0431\u0435\u0441\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f\u0445, \u043a\u0430\u043a \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u044b, \u043a\u0430\u043a \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0442\u0443\u0434\u0430 \u0434\u0430\u043d\u043d\u044b\u0435, \u043f\u043e\u0447\u0435\u043c\u0443 \u043d\u0435\u043b\u044c\u0437\u044f \u043a\u043b\u0430\u0441\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u0432 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b, \u0430 \u043c\u043d\u043e\u0433\u043e \u2014 \u044d\u0442\u043e \u0441\u043a\u043e\u043b\u044c\u043a\u043e, \u0430 \u0447\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0439\u0442\u0438 \u043d\u0435 \u0442\u0430\u043a \u0438 \u0442.\u0434. \u041c\u044b \u0432 Dodo \u0442\u043e\u0436\u0435 \u0438\u043d\u043e\u0433\u0434\u0430 \u0442\u0430\u043a\u0438\u0435 \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u0437\u0430\u0434\u0430\u0451\u043c. \u042f \u0434\u0443\u043c\u0430\u043b, \u0447\u0442\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u043b \u0432\u0441\u0451 \u044d\u0442\u043e, \u043d\u043e \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u043e\u0432\u0435\u0440\u0445\u043d\u043e\u0441\u0442\u043d\u043e. \u0412\u0441\u0451 \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u043e\u0441\u044c, \u043a\u043e\u0433\u0434\u0430 \u044f \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f \u0441 \u0447\u0430\u0441\u0442\u044b\u043c\u0438 \u043a\u0440\u0430\u0448\u0430\u043c\u0438 TransactionTooLargeException \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0414\u0440\u0438\u043d\u043a\u0438\u0442.<\/p>\n<p>TransactionTooLargeException \u2014 \u044d\u0442\u043e \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0438\u0437 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 IPC-\u0432\u044b\u0437\u043e\u0432\u043e\u0432 (interprocess communication) \u0438 Android Binder. \u041d\u043e \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0432 \u0431\u0435\u0437\u043e\u0431\u0438\u0434\u043d\u043e\u0439 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438, \u043a\u043e\u0433\u0434\u0430, \u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0431\u044b, \u043c\u044b \u043d\u0438\u0447\u0435\u0433\u043e \u0442\u0430\u043a\u043e\u0433\u043e \u043d\u0435 \u0434\u0435\u043b\u0430\u043b\u0438 \u0438 \u043d\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438\u0441\u044c IPC.<\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0441 \u044d\u0442\u0438\u043c \u043a\u0440\u0430\u0448\u0435\u043c \u0438 \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c \u043f\u0440\u043e IPC-\u0432\u044b\u0437\u043e\u0432\u044b \u0438 Binder.<\/p>\n<h3>\u041f\u0440\u0438\u0447\u0451\u043c \u0442\u0443\u0442 IPC \u0438 Binder<\/h3>\n<p>\u0420\u0430\u043d\u044c\u0448\u0435, \u043a\u043e\u0433\u0434\u0430 \u044f \u0441\u043b\u044b\u0448\u0430\u043b \u0441\u043b\u043e\u0432\u0430 IPC \u0438 Binder, \u044f \u043f\u043e\u043d\u0438\u043c\u0430\u043b, \u0447\u0442\u043e \u044d\u0442\u043e \u043c\u0435\u0436\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043d\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435, \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u043e\u0441\u043e\u0431\u044b\u0435 \u0441\u043b\u0443\u0447\u0430\u0438, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u0447\u0430\u0441\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432\u044b\u043d\u043e\u0441\u0438\u043c \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0438 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u043c \u0441 \u043d\u0438\u043c \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0431\u0438\u043d\u0434\u0438\u0442\u044c Activity \u0438\u0437 \u043e\u0434\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u043a Service \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0438 \u043e\u0431\u043c\u0435\u043d\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u0430\u043d\u043d\u044b\u043c\u0438. \u0418 \u044d\u0442\u0438 \u0441\u043b\u043e\u0432\u0430 (IPC \u0438 Binder) \u043c\u0435\u043d\u044f \u043d\u0435 \u043a\u0430\u0441\u0430\u044e\u0442\u0441\u044f, \u043f\u043e\u043a\u0430 \u044f \u043d\u0435 \u043d\u0430\u0447\u043d\u0443 \u0434\u0435\u043b\u0430\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u0432 \u044d\u0442\u043e\u043c \u0434\u0443\u0445\u0435. \u041d\u043e \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u044d\u0442\u043e \u043d\u0435 \u0442\u0430\u043a. \u0425\u043e\u0440\u043e\u0448\u043e, \u0435\u0441\u043b\u0438 \u0432\u044b \u0443\u0436\u0435 \u043e\u0431 \u044d\u0442\u043e\u043c \u0437\u043d\u0430\u0435\u0442\u0435. \u0410 \u0435\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a\u043e\u0435 \u0436\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u043a\u0430\u043a\u043e\u0435 \u0431\u044b\u043b\u043e \u0443 \u043c\u0435\u043d\u044f \u0440\u0430\u043d\u044c\u0448\u0435, \u0442\u043e \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0432\u0441\u0451-\u0442\u0430\u043a\u0438 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f, \u043f\u043e\u0447\u0435\u043c\u0443 IPC \u0438 Binder \u0441 \u043d\u0430\u043c\u0438 \u043f\u043e\u0432\u0441\u044e\u0434\u0443 \u0438 \u043a\u0430\u0436\u0434\u044b\u0439 \u0434\u0435\u043d\u044c.<\/p>\n<p>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0447\u0442\u043e \u043f\u0438\u0448\u0443\u0442 \u0432 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 Android \u043e TransactionTooLargeException. \u0412 \u0441\u0442\u0430\u0442\u044c\u0435 <a href=\"https:\/\/developer.android.com\/guide\/components\/activities\/parcelables-and-bundles\">Parcelables and Bundles<\/a> \u043a\u0440\u0430\u0442\u043a\u043e \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0432 Binder-\u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u044f\u0445 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 Parcelables \u0438 Bundle, \u043d\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0435\u0441\u0442\u044c \u0431\u0443\u0444\u0435\u0440 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c 1 \u041c\u0431 \u043d\u0430 \u0432\u0441\u0435 \u0442\u0435\u043a\u0443\u0449\u0438\u0435 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0435 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438. \u0415\u0441\u043b\u0438 \u0432 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043c\u043e\u043c\u0435\u043d\u0442 \u043f\u0440\u0435\u0432\u044b\u0441\u0438\u0442\u044c 1 \u041c\u0431, \u0442\u043e \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c TransactionTooLargeException.<\/p>\n<p>\u041d\u043e \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u043d\u0435\u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u043f\u043e\u0447\u0435\u043c\u0443 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c TransactionTooLargeException, \u0435\u0441\u043b\u0438 \u0443 \u043d\u0430\u0441 \u043f\u0440\u043e\u0441\u0442\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u043e\u0434\u0438\u043d \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0438 \u043c\u044b \u043d\u0435 \u0431\u0438\u043d\u0434\u0438\u043c \u0441\u0432\u043e\u0438 \u0430\u043a\u0442\u0438\u0432\u0438\u0442\u0438 \u043a \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c \u0438 \u043d\u0435 \u043e\u0431\u043c\u0435\u043d\u0438\u0432\u0430\u0435\u043c\u0441\u044f \u0434\u0430\u043d\u043d\u044b\u043c\u0438.<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f, \u043d\u0443\u0436\u043d\u043e \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0443\u0433\u043b\u0443\u0431\u0438\u0442\u044c\u0441\u044f \u0432 \u0442\u0435\u043e\u0440\u0438\u044e.<\/p>\n<h3>\u041d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0447\u0430\u0441\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f Binder<\/h3>\n<p>\u041c\u044b \u043a\u0430\u043a \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u043d\u0435 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430\u043c\u0438 Android-\u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 (Activity, Service, Broadcast Reviever, Content Provider), \u0438\u043c\u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u0438\u0441\u0442\u0435\u043c\u0430. \u041a\u0430\u043a \u043e\u043d\u0430 \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442?<\/p>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043e\u0434\u043d\u043e \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u0432 Android \u2014 \u0437\u0430\u043f\u0443\u0441\u043a Activity.<\/p>\n<p>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0437\u043d\u0430\u043a\u043e\u043c\u043e\u0433\u043e \u0432\u0441\u0435\u043c \u043c\u0435\u0442\u043e\u0434\u0430 <code>startActivity<\/code> \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432 \u043a\u043b\u0430\u0441\u0441\u0430\u0445 <code>ContextImpl<\/code> \u0438 <code>Instrumentation<\/code>.<\/p>\n<pre><code class=\"java\">\/\/ContextImpl.java @Override public void startActivity(Intent intent, Bundle options) {     ...       mMainThread.getInstrumentation().execStartActivity(             getOuterContext(), mMainThread.getApplicationThread(), null,             (Activity) null, intent, -1, options); }<\/code><\/pre>\n<pre><code class=\"java\">\/\/Instrumentation.java public ActivityResult execStartActivity(         Context who, IBinder contextThread, IBinder token, Activity target,         Intent intent, int requestCode, Bundle options) {     ...     try {     ...         \/\/ \u0412\u044b\u0437\u044b\u0432\u0430\u0435\u043c startActivity         int result = ActivityManagerNative.getDefault()             .startActivity(whoThread, who.getBasePackageName(), intent,                     intent.resolveTypeIfNeeded(who.getContentResolver()),                     token, target != null ? target.mEmbeddedID : null,                     requestCode, 0, null, null, options);         checkStartActivityResult(result, intent);     } catch (RemoteException e) {     }     return null; } <\/code><\/pre>\n<p>\u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043b\u0430\u0441\u0441\u0430 <code>Instrumentation<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043d\u043e\u0433\u0438\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u0437\u043d\u0430\u043a\u043e\u043c \u043f\u043e \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0442\u0435\u0441\u0442\u0430\u043c\u0438, \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u0432\u044b\u0437\u043e\u0432 <code>startActivity<\/code> \u0443 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 <code>ActivityManagerNative.getDefault()<\/code>. \u0410 \u044d\u0442\u043e \u043d\u0435 \u0447\u0442\u043e \u0438\u043d\u043e\u0435, \u043a\u0430\u043a <code>ActivityManager<\/code> \u0441\u0435\u0440\u0432\u0438\u0441. \u041c\u044b \u0435\u0433\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0447\u0435\u0440\u0435\u0437 \u0441\u0438\u043d\u0433\u043b\u0442\u043e\u043d <code>gDefault<\/code>.<\/p>\n<pre><code class=\"java\">\/\/ActivityManagerNative.java private static final Singleton&lt;IActivityManager> gDefault = new Singleton&lt;IActivityManager>() {     protected IActivityManager create() {             IBinder b = ServiceManager.getService(\"activity\");             ...             \/\/ \u0442\u043e \u0435\u0441\u0442\u044c gDefault - \u044d\u0442\u043e \u0438 \u0435\u0441\u0442\u044c IActivityManager               IActivityManager am = asInterface(b);             ...             return am;         } };   static public IActivityManager asInterface(IBinder obj) {     ...     return new ActivityManagerProxy(obj); }   class ActivityManagerProxy implements IActivityManager {     ...     public int startActivity(...) throws RemoteException {         Parcel data = Parcel.obtain();         Parcel reply = Parcel.obtain();         \/\/ \u043c\u043d\u043e\u0433\u043e \u0432\u0441\u0435\u0433\u043e \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 data     ...         \/\/ \u0412\u044b\u0437\u044b\u0432\u0430\u0435\u043c transact \u0431\u0438\u043d\u0434\u0435\u0440\u0430 (mRemote - \u0442\u0443\u0442 \u0438 \u0435\u0441\u0442\u044c IBinder)         mRemote.transact(START_ACTIVITY_TRANSACTION, data, reply, 0);         reply.readException();         int result = reply.readInt();         reply.recycle();         data.recycle();         return result;     }     ... } <\/code><\/pre>\n<p>\u0412 \u0438\u0442\u043e\u0433\u0435 \u0434\u0435\u043b\u0430\u0435\u043c \u0432\u044b\u0437\u043e\u0432 <code>transact<\/code> \u0443 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 <code>mRemote<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439, \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u0438 \u0435\u0441\u0442\u044c <code>IBinder<\/code>.<\/p>\n<p>\u0421\u0445\u0435\u043c\u0430\u0442\u0438\u0447\u043d\u043e \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0438\u0437\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c \u0442\u0430\u043a:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/2ef\/0db\/f11\/2ef0dbf117b38a9104e3aa6cac994715.jpg\" width=\"1834\" height=\"2180\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/2ef\/0db\/f11\/2ef0dbf117b38a9104e3aa6cac994715.jpg\" data-blurred=\"true\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0417\u0435\u043b\u0451\u043d\u044b\u043c\u0438 \u0446\u0432\u0435\u0442\u0430\u043c\u0438 \u044f \u0432\u044b\u0434\u0435\u043b\u0438\u043b \u0432\u0441\u0451, \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435. \u0421\u0438\u043d\u0438\u043c \u2014 \u0441\u0430\u043c Binder \u043a\u0430\u043a \u0441\u0432\u044f\u0437\u0443\u044e\u0449\u0435\u0435 \u0437\u0432\u0435\u043d\u043e. Activity Manager Service \u2014 \u044d\u0442\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043e\u0431\u0449\u0430\u0435\u0442\u0441\u044f \u043d\u0430\u0448 \u043f\u0440\u043e\u0446\u0435\u0441\u0441.<\/p>\n<p>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u0435 \u043d\u043e\u0432\u043e\u0439 Activity \u2014 \u044d\u0442\u043e Binder-\u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u044f.<\/p>\n<p>\u0410 \u043a\u0430\u043a\u0438\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0435\u0449\u0451 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f Binder-\u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u044f\u043c\u0438? \u0414\u0430 \u043c\u043d\u043e\u0433\u043e \u043a\u0430\u043a\u0438\u0445. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0441 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u043c \u0447\u0435\u0440\u0435\u0437 Messenger, \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 Content Provider \u0438 \u0432\u0441\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u044b: ActivityManagerService, WindowManagerService, AlarmManagerService, NotificationManagerService, ConnectivityManagerService \u0438 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 (\u044f \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0438\u043b \u0442\u0435, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u043a\u0430\u0436\u0434\u044b\u0439 \u0438\u0437 \u043d\u0430\u0441 \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u043b\u0441\u044f \u043c\u043d\u043e\u0433\u043e \u0440\u0430\u0437). \u042d\u0442\u043e \u0432\u0441\u0451 \u0441\u0435\u0440\u0432\u0438\u0441\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0447\u0435\u0440\u0435\u0437 <code>Context::getSystemService<\/code>.<\/p>\n<p>\u042d\u0442\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u044b \u2014 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b, \u0438 \u043d\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u0435\u0442 \u0441 \u043d\u0438\u043c\u0438 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0447\u0435\u0440\u0435\u0437 Binder-\u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438.<\/p>\n<h3>Binder \u2014 \u0447\u0442\u043e \u044d\u0442\u043e \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e?<\/h3>\n<figure class=\"float full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/2fc\/4ea\/3ec\/2fc4ea3ec6a9abfcfd3e502189512ba8.jpg\" alt=\"\u0413\u0434\u0435 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f Binder \u0432 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0435 \u0410\u043d\u0434\u0440\u043e\u0438\u0434\u0430. \u0412\u0437\u044f\u0442\u043e \u0438\u0437 https:\/\/developer.android.com\/guide\/platform\" title=\"\u0413\u0434\u0435 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f Binder \u0432 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0435 \u0410\u043d\u0434\u0440\u043e\u0438\u0434\u0430. \u0412\u0437\u044f\u0442\u043e \u0438\u0437 https:\/\/developer.android.com\/guide\/platform\" width=\"1691\" height=\"2364\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/2fc\/4ea\/3ec\/2fc4ea3ec6a9abfcfd3e502189512ba8.jpg\" data-blurred=\"true\"\/><figcaption>\u0413\u0434\u0435 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f Binder \u0432 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0435 \u0410\u043d\u0434\u0440\u043e\u0438\u0434\u0430. \u0412\u0437\u044f\u0442\u043e \u0438\u0437 https:\/\/developer.android.com\/guide\/platform<\/figcaption><\/figure>\n<p>Binder \u2014 \u044d\u0442\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u043d\u0430 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435 Android, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0438 \u0431\u044b\u0441\u0442\u0440\u043e\u0433\u043e \u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043c\u0435\u0436\u0434\u0443 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430\u043c\u0438. \u0412 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 <a href=\"https:\/\/developer.android.com\/guide\/platform\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438<\/a> \u0435\u0441\u0442\u044c \u043a\u043b\u0430\u0441\u0441\u043d\u0430\u044f \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0430 \u043d\u0430 \u044d\u0442\u043e\u0442 \u0441\u0447\u0451\u0442. <\/p>\n<p>Binder \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 Kernel Linux \u0438 \u0432\u0441\u0451 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0442\u0430\u043c. \u0415\u0441\u043b\u0438 \u043a\u0440\u0430\u0442\u043a\u043e, \u0442\u043e Binder \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0447\u0435\u0440\u0435\u0437 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438, \u043e\u043d \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e \u0443\u043f\u0430\u043a\u043e\u0432\u044b\u0432\u0430\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442 \u0438\u0445 \u043c\u0435\u0436\u0434\u0443 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430\u043c\u0438 \u0447\u0435\u0440\u0435\u0437 <a href=\"https:\/\/en.wikipedia.org\/wiki\/Ioctl\">ioctl<\/a>. \u041a\u0430\u043a \u0440\u0430\u0437 \u043f\u0440\u043e \u044d\u0442\u0438 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438 \u0438 \u0448\u043b\u0430 \u0440\u0435\u0447\u044c, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u0433\u043e\u0432\u043e\u0440\u0438\u043b\u0438 \u043f\u0440\u043e \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u0431\u0443\u0444\u0435\u0440\u0430 \u0432 1 \u041c\u0431.<\/p>\n<p>\u0412\u044b\u0445\u043e\u0434\u0438\u0442, \u0447\u0442\u043e \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c Binder \u043e\u0447\u0435\u043d\u044c \u0447\u0430\u0441\u0442\u043e, \u043d\u043e \u043d\u0435 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e. \u041e\u0431\u044b\u0447\u043d\u043e \u044d\u0442\u043e \u0441\u043a\u0440\u044b\u0442\u043e \u043e\u0442 \u043d\u0430\u0441 \u0447\u0435\u0440\u0435\u0437 API Android Framework. \u0417\u043d\u0430\u0447\u0438\u0442, \u043c\u044b \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u043d\u0430\u0448 TransactionTooLargeException \u043e\u0442 \u043d\u0435\u044f\u0432\u043d\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f Binder-\u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0439.<\/p>\n<h2>\u0420\u0430\u0441\u043a\u0440\u043e\u0435\u043c \u0437\u0430\u0433\u0430\u0434\u043a\u0443 TransactionTooLargeException<\/h2>\n<p>\u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c \u0431\u0430\u0433 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0414\u0440\u0438\u043d\u043a\u0438\u0442. \u0412 \u043d\u0451\u043c \u0433\u043b\u0430\u0432\u043d\u044b\u0439 \u044d\u043a\u0440\u0430\u043d \u2014 \u044d\u0442\u043e \u043c\u0435\u043d\u044e \u043a\u043e\u0444\u0435\u0439\u043d\u0438. \u041c\u0435\u043d\u044e \u2014 \u044d\u0442\u043e Pager \u0441 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430\u043c\u0438. \u041a\u0430\u0436\u0434\u044b\u0439 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u2014 \u044d\u0442\u043e \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044f \u0432 \u043c\u0435\u043d\u044e \u0441 \u043a\u0443\u0447\u0435\u0439 \u0441\u0432\u043e\u0438\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432. \u041c\u044b \u043b\u0438\u0441\u0442\u0430\u0435\u043c \u043c\u0435\u043d\u044e \u0442\u0443\u0434\u0430-\u0441\u044e\u0434\u0430, \u0441\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u0438\u2026 \u043a\u0440\u0430\u0448.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/2c3\/570\/87b\/2c357087b40633cd9964cd3d3e42d818.jpg\" width=\"2970\" height=\"1346\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/2c3\/570\/87b\/2c357087b40633cd9964cd3d3e42d818.jpg\" data-blurred=\"true\"\/><figcaption><\/figcaption><\/figure>\n<p>\u041a\u0440\u0430\u0448 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432 \u0431\u044d\u043a\u0433\u0440\u0430\u0443\u043d\u0434\u0435. <\/p>\n<figure class=\"bordered full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/9a8\/48f\/cb1\/9a848fcb148c7ae05d881ca485d796d8.png\" alt=\" \" title=\" \" width=\"898\" height=\"458\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/9a8\/48f\/cb1\/9a848fcb148c7ae05d881ca485d796d8.png\"\/><figcaption> <\/figcaption><\/figure>\n<p>\u0414\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043f\u0440\u0438 \u0441\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u0438 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f Activity, \u0438 \u043f\u0440\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043e\u043d\u043e \u0447\u0435\u0440\u0435\u0437 Binder-\u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438.<\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u0435\u0435. \u0412\u0441\u0451 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 Activity:<\/p>\n<pre><code class=\"java\">\/\/ActivityThread.java @Override public void handleStopActivity(ActivityClientRecord r, int configChanges,         PendingTransactionActions pendingActions, boolean finalStateRequest, String reason) {     ...     final StopInfo stopInfo = new StopInfo();      \/\/ \u0417\u0434\u0435\u0441\u044c \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u043b\u043e\u0433\u0438\u043a\u0430 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0430\u043a\u0442\u0438\u0432\u0438\u0442\u0438     performStopActivityInner(r, stopInfo, true \/* saveState *\/, finalStateRequest,             reason);     ...     stopInfo.setActivity(r);     stopInfo.setState(r.state);     stopInfo.setPersistentState(r.persistentState);      \/\/ \u0417\u0434\u0435\u0441\u044c \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435     pendingActions.setStopInfo(stopInfo);     mSomeActivitiesChanged = true; }  private void performStopActivityInner(...) { ...     callActivityOnStop(r, saveState, reason); }  private void callActivityOnStop(ActivityClientRecord r, boolean saveState, String reason) {     ...     \/\/ \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c onSaveInstanceState \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0432\u0435\u0440\u0441\u0438\u0438 API (isPreP)     if (shouldSaveState &amp;&amp; isPreP) {         callActivityOnSaveInstanceState(r);     }     ...     r.activity.performStop(r.mPreserveWindow, reason);     ...     if (shouldSaveState &amp;&amp; !isPreP) {         callActivityOnSaveInstanceState(r);     } }<\/code><\/pre>\n<p>\u0427\u0435\u0440\u0435\u0437 <code>ActivityThread<\/code> \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432\u044b\u0437\u043e\u0432\u00a0 <code>handleStopActivity<\/code> \u0438 \u0442\u0430\u043c \u0432\u0430\u0436\u043d\u043e \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u0434\u0432\u0430 \u043c\u0435\u0441\u0442\u0430: <code>performStopActivityInner<\/code> \u0438 <code>pendingActions.setStopInfo<\/code>.<\/p>\n<ul>\n<li>\n<p><code>performStopActivityInner<\/code> \u2014 \u0437\u0434\u0435\u0441\u044c \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432\u044b\u0437\u043e\u0432 <code>onSaveInstanceState<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u043c \u0445\u043e\u0440\u043e\u0448\u043e \u0437\u043d\u0430\u043a\u043e\u043c \u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c. \u041a\u0441\u0442\u0430\u0442\u0438, \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0438\u043c\u0435\u043d\u043d\u043e \u0437\u0434\u0435\u0441\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f, \u043a\u043e\u0433\u0434\u0430 \u043e\u043d \u0432\u044b\u0437\u043e\u0432\u0435\u0442\u0441\u044f: \u0434\u043e \u0438\u043b\u0438 \u043f\u043e\u0441\u043b\u0435 <code>onStop()<\/code>, \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0432\u0435\u0440\u0441\u0438\u0438 Android.<\/p>\n<\/li>\n<li>\n<p><code>pendingActions.setStopInfo<\/code> \u2014 \u0437\u0434\u0435\u0441\u044c \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0432 \u043e\u0442\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043e\u0431\u044a\u0435\u043a\u0442 <code>stopInfo<\/code>. <code>stopInfo<\/code> \u2014 \u044d\u0442\u043e \u043e\u0431\u044a\u0435\u043a\u0442, \u043a\u0443\u0434\u0430 \u043c\u044b \u043d\u0430\u0441\u043e\u0431\u0438\u0440\u0430\u043b\u0438 \u0432\u0441\u0451, \u0447\u0442\u043e \u0445\u043e\u0442\u0438\u043c \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c. \u041f\u043e\u043c\u0438\u043c\u043e \u043f\u0440\u043e\u0447\u0435\u0433\u043e, <code>StopInfo<\/code> \u2014 \u044d\u0442\u043e <code>Runnable<\/code>, \u0438 \u043a\u0442\u043e-\u0442\u043e \u0435\u0433\u043e \u0434\u043e\u043b\u0436\u0435\u043d \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c.<\/p>\n<\/li>\n<\/ul>\n<p>\u0421\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 <code>pendingActions<\/code> \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u043e\u0437\u0436\u0435, \u043a\u043e\u0433\u0434\u0430 <code>ActivityThread<\/code> \u0432\u044b\u0437\u043e\u0432\u0435\u0442 <code>reportStop<\/code>, \u0438 \u0443\u0436\u0435 \u0442\u0430\u043c \u043c\u044b \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f <code>StopInfo<\/code> \u043a\u0430\u043a <code>Runnable<\/code> \u0447\u0435\u0440\u0435\u0437 <code>Handler<\/code>.<\/p>\n<pre><code class=\"java\">\/\/ ActivityThread.java   \/**    * Schedule the call to tell the activity manager we have stopped.  We don't do this    * immediately, because we want to have a chance for any other pending work (in particular    * memory trim requests) to complete before you tell the activity manager to proceed and allow    * us to go fully into the background.    *\/   @Override   public void reportStop(PendingTransactionActions pendingActions) {       mH.post(pendingActions.getStopInfo());   }<\/code><\/pre>\n<p>\u041f\u0440\u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0438 <code>StopInfo<\/code> \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<pre><code class=\"java\">\/\/ PendingTransactionActions.java public class PendingTransactionActions {   ...   public static class StopInfo implements Runnable {       @Override       public void run() {           ...           try {               ...               \/\/ \u042d\u0442\u043e \u0438 \u0435\u0441\u0442\u044c \u0432\u044b\u0437\u043e\u0432 Binder \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438                \/\/ \u0447\u0435\u0440\u0435\u0437 \u0441\u0435\u0440\u0432\u0438\u0441 ActivityManagerService               ActivityClient.getInstance().activityStopped(                       mActivity.token, mState, mPersistentState, mDescription);           } catch (RuntimeException ex) {               ...               if (ex.getCause() instanceof TransactionTooLargeException                       &amp;&amp; mActivity.packageInfo.getTargetSdkVersion() &lt; Build.VERSION_CODES.N) {                   Log.e(TAG, \"App sent too much data in instance state, so it was ignored\", ex);                   return;               }               throw ex;           }       }   } }<\/code><\/pre>\n<p><code>ActivityClient.getInstance().activityStopped<\/code> \u2014 \u044d\u0442\u043e \u0432\u044b\u0437\u043e\u0432 <code>Binder<\/code> \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438 \u0447\u0435\u0440\u0435\u0437 \u0441\u0435\u0440\u0432\u0438\u0441 <code>ActivityManagerService<\/code>, \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0439 \u0437\u0430\u043f\u0443\u0441\u043a\u0443 Activity. \u0417\u0434\u0435\u0441\u044c \u0435\u0441\u0442\u044c \u043b\u044e\u0431\u043e\u043f\u044b\u0442\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442, \u0447\u0442\u043e \u0434\u043b\u044f \u0432\u0435\u0440\u0441\u0438\u0438 \u043d\u0438\u0436\u0435 N \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f <code>TransactionTooLargeException<\/code> \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u043e\u0432\u0430\u043b\u0438\u0441\u044c (\u044d\u0445, \u0431\u0435\u0437\u0437\u0430\u0431\u043e\u0442\u043d\u0430\u044f \u0431\u044b\u043b\u0430 \u043f\u043e\u0440\u0430).<\/p>\n<p>\u0412\u0435\u0440\u043d\u0451\u043c\u0441\u044f \u043a \u043d\u0430\u0448\u0435\u043c\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044e. \u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043c, \u0447\u0442\u043e \u0432 \u043d\u0451\u043c \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442\u0441\u044f \u0432 <code>onSaveInstanceState<\/code>. \u0422\u043e\u0433\u0434\u0430 \u043e\u0442\u043a\u0443\u0434\u0430 \u0442\u0430\u043c \u043f\u0435\u0440\u0435\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0431\u0443\u0444\u0435\u0440\u0430?<\/p>\n<p>\u041d\u0443\u0436\u043d\u043e \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c, \u0447\u0442\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442\u0441\u044f.<\/p>\n<pre><code class=\"java\">\/\/Activity.java protected void onSaveInstanceState(@NonNull Bundle outState) {     outState.putBundle(WINDOW_HIERARCHY_TAG, mWindow.saveHierarchyState());      \/\/ \u041e\u0431\u0440\u0430\u0442\u0438\u043c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u044d\u0442\u043e - \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439 \u0432\u0441\u0435\u0445 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u043e\u0432     Parcelable p = mFragments.saveAllState();     if (p != null) {         outState.putParcelable(FRAGMENTS_TAG, p);     }     getAutofillClientController().onSaveInstanceState(outState);     dispatchActivitySaveInstanceState(outState); }<\/code><\/pre>\n<p>\u0421\u043e\u0445\u0440\u0430\u043d\u044f\u044e\u0442\u0441\u044f \u0432\u0441\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0432\u0441\u0435\u0445 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u043e\u0432. \u041e\u0431\u044a\u0435\u043a\u0442 <code>mFragments<\/code> \u2014 \u044d\u0442\u043e <code>FragmentController<\/code>, \u0438 \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0440\u043e\u043a\u0441\u0438\u0440\u0443\u0435\u0442 \u0432\u044b\u0437\u043e\u0432 \u043d\u0430 <code>FragmentManager<\/code>. \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 <code>saveAllState<\/code>:<\/p>\n<pre><code class=\"java\">\/\/FragmentManager.java Parcelable saveAllState() {     ...     int N = mActive.size();     FragmentState[] active = new FragmentState[N];      for (int i=0; i&lt;N; i++) {         ...         \/\/saving all states in active array         ...     }          ...          FragmentManagerState fms = new FragmentManagerState();     fms.mActive = active;     ...     return fms; }<\/code><\/pre>\n<p>\u041c\u044b \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u043c\u0441\u044f \u043f\u043e \u0432\u0441\u0435\u043c \u0430\u043a\u0442\u0438\u0432\u043d\u044b\u043c \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430\u043c \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0438\u0445 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0432 \u043c\u0430\u0441\u0441\u0438\u0432 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439 <code>active<\/code>. \u0410 \u043a\u0430\u0436\u0434\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435, \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0432 \u0441\u0435\u0431\u044f \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b.<\/p>\n<pre><code class=\"java\">\/\/FragmentState.java final class FragmentState implements Parcelable {     ...     many parameters     ...     final Bundle mArguments;     ... }<\/code><\/pre>\n<p>\u0412\u043e\u0442 \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u0431\u044b\u043b Pager \u0441 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430\u043c\u0438. \u041c\u044b \u043b\u0438\u0441\u0442\u0430\u043b\u0438 Pager, \u0441\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u043b\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0438 \u0432\u0441\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u0432\u0441\u0435\u0445 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u043e\u0432 \u043f\u044b\u0442\u0430\u043b\u0438\u0441\u044c \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c\u0441\u044f, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f Binder-\u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0438\u044e.<\/p>\n<p>\u0415\u0441\u0442\u044c \u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442, \u0447\u0442\u043e\u0431\u044b \u0442\u0440\u0435\u043a\u0430\u0442\u044c \u0442\u043e, \u0447\u0442\u043e \u0432 Binder-\u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u044f\u0445 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442:\u00a0<\/p>\n<p><a href=\"https:\/\/github.com\/guardian\/toolargetool\"><strong>toolargetool<\/strong><\/a><strong>.<\/strong><\/p>\n<p>\u041c\u044b \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043b\u0438 \u0435\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043d\u044f\u0442\u044c, \u0447\u0442\u043e \u0442\u0430\u043c \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442\u0441\u044f. \u0418 \u0443\u0432\u0438\u0434\u0435\u043b\u0438 \u0442\u0430\u043a\u043e\u0439 \u043b\u043e\u0433:<\/p>\n<pre><code>D\/TooLargeTool: NavHostFragment.onSaveInstanceState wrote: Bundle211562248 contains 7 keys and measures 510.5 KB when serialized as a Parcel     * android:support:fragments = 508.7 KB     * androidx.lifecycle.BundlableSavedStateRegistry.key = 0.1 KB     * android-support-nav:fragment:defaultHost = 0.1 KB     * android:view_registry_state = 0.2 KB     * android-support-nav:fragment:graphId = 0.1 KB     * android-support-nav:fragment:navController<\/code><\/pre>\n<p>\u0418 \u0437\u0434\u0435\u0441\u044c \u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e 500\u041a\u0431 \u0441\u044a\u0435\u0434\u0430\u044e\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u044b.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u043f\u043e\u0447\u0435\u043c\u0443 \u043d\u0443\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u043d\u0435 \u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0432 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b, \u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0435, \u043e\u0431\u044b\u0447\u043d\u043e id-\u0448\u043d\u0438\u043a\u0438. \u0418 \u0434\u0430\u043b\u044c\u0448\u0435 \u043a\u0430\u0436\u0434\u044b\u0439 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u0441\u0430\u043c \u0431\u0435\u0440\u0451\u0442 \u0434\u0430\u043d\u043d\u044b\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0435\u043c\u0443 \u043d\u0443\u0436\u043d\u044b.<\/p>\n<blockquote>\n<p>\u0412\u043e\u0442 \u0438 \u043e\u0442\u0432\u0435\u0442 \u043d\u0430 \u0432\u043e\u043f\u0440\u043e\u0441 \u0432 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0435 \u0441\u0442\u0430\u0442\u044c\u0438. \u041e\u0431\u044b\u0447\u043d\u043e \u043c\u044b, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438, \u0437\u043d\u0430\u0435\u043c \u043f\u0440\u043e \u044d\u0442\u043e\u0442 \u043f\u043e\u0434\u0445\u043e\u0434, \u0443\u0432\u0435\u0440\u0435\u043d\u043d\u043e \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u043c \u043d\u0430 \u0432\u043e\u043f\u0440\u043e\u0441 \u043d\u0430 \u0441\u043e\u0431\u0435\u0441\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f\u0445, \u043d\u043e \u0434\u0430\u043b\u0435\u043a\u043e \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u0437\u043d\u0430\u0435\u043c \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0443\u044e \u043f\u0440\u0438\u0447\u0438\u043d\u0443, \u043f\u043e\u0447\u0435\u043c\u0443 \u0442\u0430\u043a \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442.<\/p>\n<\/blockquote>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0431\u044b\u0441\u0442\u0440\u043e\u0433\u043e \u0440\u0435\u0444\u0430\u043a\u0442\u043e\u0440\u0438\u043d\u0433\u0430 \u043c\u044b \u0437\u0430\u043c\u0435\u0440\u0438\u043b\u0438 \u0435\u0449\u0451 \u0440\u0430\u0437, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0430\u043c\u044f\u0442\u0438 \u0437\u0430\u043d\u0438\u043c\u0430\u044e\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438:<\/p>\n<pre><code>D\/TooLargeTool: NavHostFragment.onSaveInstanceState wrote: Bundle78254359 contains 7 keys and measures 67.8 KB when serialized as a Parcel     * android:support:fragments = 65.9 KB     * androidx.lifecycle.BundlableSavedStateRegistry.key = 0.1 KB     * android-support-nav:fragment:defaultHost = 0.1 KB     * android:view_registry_state = 0.2 KB     * android-support-nav:fragment:graphId = 0.1 KB     * android-support-nav:fragment:navControllerState = 1.2 KB     * android:view_state = 0.1 KB<\/code><\/pre>\n<p>\u0420\u0430\u0437\u043c\u0435\u0440 \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u043b\u0441\u044f \u0434\u043e 67.8 KB.<\/p>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>\u0418\u043d\u043e\u0433\u0434\u0430, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u0442\u043e\u0440\u043e\u043f\u0438\u043c\u0441\u044f, \u0441\u043e\u0437\u0434\u0430\u0451\u043c \u0441\u0435\u0431\u0435 \u0442\u0435\u0445\u0434\u043e\u043b\u0433, \u0437\u0430\u0431\u044b\u0432\u0430\u0435\u043c \u0435\u0433\u043e \u043f\u043e\u0442\u043e\u043c \u0432\u043e\u0432\u0440\u0435\u043c\u044f \u043e\u0442\u0434\u0430\u0442\u044c.<\/p>\n<p>\u0422\u0430\u043a \u0443 \u043d\u0430\u0441 \u0431\u044b\u043b\u043e \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0414\u0440\u0438\u043d\u043a\u0438\u0442 \u0441 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0431\u0430\u043d\u0430\u043b\u044c\u043d\u043e\u0439 \u043e\u0448\u0438\u0431\u043a\u043e\u0439. \u0414\u043b\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043c\u0435\u043d\u044e \u043c\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u043b\u0438 \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0432 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u043e\u0432. \u042f \u0437\u0430\u0445\u043e\u0442\u0435\u043b \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u044d\u0442\u0438\u043c \u043e\u043f\u044b\u0442\u043e\u043c, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e, \u0441 \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b, \u044d\u0442\u043e\u0442 \u0431\u0430\u0433 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u043a \u043f\u0440\u043e\u0441\u0442\u044b\u043c, \u043d\u043e \u0441 \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b, \u0438\u043c\u0435\u0435\u0442 \u0431\u043e\u043b\u0435\u0435 \u0433\u043b\u0443\u0431\u043e\u043a\u0438\u0435 \u0438 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0435 \u0432 \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u0438 \u043a\u043e\u0440\u043d\u0438. \u041d\u0430\u0442\u043a\u043d\u0443\u0432\u0448\u0438\u0441\u044c \u043d\u0430 \u043d\u0435\u0433\u043e, \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0433\u0440\u0443\u0437\u0438\u0442\u044c\u0441\u044f \u0432 \u043c\u0438\u0440 IPC-\u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0438 Binder \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0439.<\/p>\n<p>\u041f\u043e\u0434\u0435\u043b\u0438\u0442\u0435\u0441\u044c \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445, \u0441\u043b\u0443\u0447\u0430\u043b\u0438\u0441\u044c \u043b\u0438 \u0443 \u0432\u0430\u0441 \u0432\u043d\u0435\u0437\u0430\u043f\u043d\u044b\u0435 TransactionTooLargeException \u043a\u0440\u0430\u0448\u0438 \u0438 \u0441 \u0447\u0435\u043c \u043e\u043d\u0438 \u0431\u044b\u043b\u0438 \u0441\u0432\u044f\u0437\u0430\u043d\u044b?<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"v-portal\" style=\"display:none;\"><\/div>\n<\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/company\/dododev\/blog\/694746\/\"> https:\/\/habr.com\/ru\/company\/dododev\/blog\/694746\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>Android-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u0447\u0430\u0441\u0442\u043e \u0441\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u044e\u0442 \u043d\u0430 \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0441\u043e\u0431\u0435\u0441\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f\u0445, \u043a\u0430\u043a \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u044b, \u043a\u0430\u043a \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0442\u0443\u0434\u0430 \u0434\u0430\u043d\u043d\u044b\u0435, \u043f\u043e\u0447\u0435\u043c\u0443 \u043d\u0435\u043b\u044c\u0437\u044f \u043a\u043b\u0430\u0441\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u0432 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b, \u0430 \u043c\u043d\u043e\u0433\u043e \u2014 \u044d\u0442\u043e \u0441\u043a\u043e\u043b\u044c\u043a\u043e, \u0430 \u0447\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0439\u0442\u0438 \u043d\u0435 \u0442\u0430\u043a \u0438 \u0442.\u0434. \u041c\u044b \u0432 Dodo \u0442\u043e\u0436\u0435 \u0438\u043d\u043e\u0433\u0434\u0430 \u0442\u0430\u043a\u0438\u0435 \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u0437\u0430\u0434\u0430\u0451\u043c. \u042f \u0434\u0443\u043c\u0430\u043b, \u0447\u0442\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u043b \u0432\u0441\u0451 \u044d\u0442\u043e, \u043d\u043e \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u043e\u0432\u0435\u0440\u0445\u043d\u043e\u0441\u0442\u043d\u043e. \u0412\u0441\u0451 \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u043e\u0441\u044c, \u043a\u043e\u0433\u0434\u0430 \u044f \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f \u0441 \u0447\u0430\u0441\u0442\u044b\u043c\u0438 \u043a\u0440\u0430\u0448\u0430\u043c\u0438 TransactionTooLargeException \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0414\u0440\u0438\u043d\u043a\u0438\u0442.<\/p>\n<p>TransactionTooLargeException \u2014 \u044d\u0442\u043e \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0438\u0437 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 IPC-\u0432\u044b\u0437\u043e\u0432\u043e\u0432 (interprocess communication) \u0438 Android Binder. \u041d\u043e \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0432 \u0431\u0435\u0437\u043e\u0431\u0438\u0434\u043d\u043e\u0439 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438, \u043a\u043e\u0433\u0434\u0430, \u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0431\u044b, \u043c\u044b \u043d\u0438\u0447\u0435\u0433\u043e \u0442\u0430\u043a\u043e\u0433\u043e \u043d\u0435 \u0434\u0435\u043b\u0430\u043b\u0438 \u0438 \u043d\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438\u0441\u044c IPC.<\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0441 \u044d\u0442\u0438\u043c \u043a\u0440\u0430\u0448\u0435\u043c \u0438 \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c \u043f\u0440\u043e IPC-\u0432\u044b\u0437\u043e\u0432\u044b \u0438 Binder.<\/p>\n<h3>\u041f\u0440\u0438\u0447\u0451\u043c \u0442\u0443\u0442 IPC \u0438 Binder<\/h3>\n<p>\u0420\u0430\u043d\u044c\u0448\u0435, \u043a\u043e\u0433\u0434\u0430 \u044f \u0441\u043b\u044b\u0448\u0430\u043b \u0441\u043b\u043e\u0432\u0430 IPC \u0438 Binder, \u044f \u043f\u043e\u043d\u0438\u043c\u0430\u043b, \u0447\u0442\u043e \u044d\u0442\u043e \u043c\u0435\u0436\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043d\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435, \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u043e\u0441\u043e\u0431\u044b\u0435 \u0441\u043b\u0443\u0447\u0430\u0438, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u0447\u0430\u0441\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432\u044b\u043d\u043e\u0441\u0438\u043c \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0438 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u043c \u0441 \u043d\u0438\u043c \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0431\u0438\u043d\u0434\u0438\u0442\u044c Activity \u0438\u0437 \u043e\u0434\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u043a Service \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0438 \u043e\u0431\u043c\u0435\u043d\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u0430\u043d\u043d\u044b\u043c\u0438. \u0418 \u044d\u0442\u0438 \u0441\u043b\u043e\u0432\u0430 (IPC \u0438 Binder) \u043c\u0435\u043d\u044f \u043d\u0435 \u043a\u0430\u0441\u0430\u044e\u0442\u0441\u044f, \u043f\u043e\u043a\u0430 \u044f \u043d\u0435 \u043d\u0430\u0447\u043d\u0443 \u0434\u0435\u043b\u0430\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u0432 \u044d\u0442\u043e\u043c \u0434\u0443\u0445\u0435. \u041d\u043e \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u044d\u0442\u043e \u043d\u0435 \u0442\u0430\u043a. \u0425\u043e\u0440\u043e\u0448\u043e, \u0435\u0441\u043b\u0438 \u0432\u044b \u0443\u0436\u0435 \u043e\u0431 \u044d\u0442\u043e\u043c \u0437\u043d\u0430\u0435\u0442\u0435. \u0410 \u0435\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a\u043e\u0435 \u0436\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u043a\u0430\u043a\u043e\u0435 \u0431\u044b\u043b\u043e \u0443 \u043c\u0435\u043d\u044f \u0440\u0430\u043d\u044c\u0448\u0435, \u0442\u043e \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0432\u0441\u0451-\u0442\u0430\u043a\u0438 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f, \u043f\u043e\u0447\u0435\u043c\u0443 IPC \u0438 Binder \u0441 \u043d\u0430\u043c\u0438 \u043f\u043e\u0432\u0441\u044e\u0434\u0443 \u0438 \u043a\u0430\u0436\u0434\u044b\u0439 \u0434\u0435\u043d\u044c.<\/p>\n<p>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0447\u0442\u043e \u043f\u0438\u0448\u0443\u0442 \u0432 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 Android \u043e TransactionTooLargeException. \u0412 \u0441\u0442\u0430\u0442\u044c\u0435 <a href=\"https:\/\/developer.android.com\/guide\/components\/activities\/parcelables-and-bundles\">Parcelables and Bundles<\/a> \u043a\u0440\u0430\u0442\u043a\u043e \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0432 Binder-\u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u044f\u0445 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 Parcelables \u0438 Bundle, \u043d\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0435\u0441\u0442\u044c \u0431\u0443\u0444\u0435\u0440 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c 1 \u041c\u0431 \u043d\u0430 \u0432\u0441\u0435 \u0442\u0435\u043a\u0443\u0449\u0438\u0435 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0435 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438. \u0415\u0441\u043b\u0438 \u0432 \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043c\u043e\u043c\u0435\u043d\u0442 \u043f\u0440\u0435\u0432\u044b\u0441\u0438\u0442\u044c 1 \u041c\u0431, \u0442\u043e \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c TransactionTooLargeException.<\/p>\n<p>\u041d\u043e \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u043d\u0435\u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u043f\u043e\u0447\u0435\u043c\u0443 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c TransactionTooLargeException, \u0435\u0441\u043b\u0438 \u0443 \u043d\u0430\u0441 \u043f\u0440\u043e\u0441\u0442\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u043e\u0434\u0438\u043d \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0438 \u043c\u044b \u043d\u0435 \u0431\u0438\u043d\u0434\u0438\u043c \u0441\u0432\u043e\u0438 \u0430\u043a\u0442\u0438\u0432\u0438\u0442\u0438 \u043a \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c \u0438 \u043d\u0435 \u043e\u0431\u043c\u0435\u043d\u0438\u0432\u0430\u0435\u043c\u0441\u044f \u0434\u0430\u043d\u043d\u044b\u043c\u0438.<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f, \u043d\u0443\u0436\u043d\u043e \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0443\u0433\u043b\u0443\u0431\u0438\u0442\u044c\u0441\u044f \u0432 \u0442\u0435\u043e\u0440\u0438\u044e.<\/p>\n<h3>\u041d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0447\u0430\u0441\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f Binder<\/h3>\n<p>\u041c\u044b \u043a\u0430\u043a \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u043d\u0435 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430\u043c\u0438 Android-\u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 (Activity, Service, Broadcast Reviever, Content Provider), \u0438\u043c\u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u0438\u0441\u0442\u0435\u043c\u0430. \u041a\u0430\u043a \u043e\u043d\u0430 \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442?<\/p>\n<p>\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043e\u0434\u043d\u043e \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439 \u0432 Android \u2014 \u0437\u0430\u043f\u0443\u0441\u043a Activity.<\/p>\n<p>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0437\u043d\u0430\u043a\u043e\u043c\u043e\u0433\u043e \u0432\u0441\u0435\u043c \u043c\u0435\u0442\u043e\u0434\u0430 <code>startActivity<\/code> \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432 \u043a\u043b\u0430\u0441\u0441\u0430\u0445 <code>ContextImpl<\/code> \u0438 <code>Instrumentation<\/code>.<\/p>\n<pre><code class=\"java\">\/\/ContextImpl.java @Override public void startActivity(Intent intent, Bundle options) {     ...       mMainThread.getInstrumentation().execStartActivity(             getOuterContext(), mMainThread.getApplicationThread(), null,             (Activity) null, intent, -1, options); }<\/code><\/pre>\n<pre><code class=\"java\">\/\/Instrumentation.java public ActivityResult execStartActivity(         Context who, IBinder contextThread, IBinder token, Activity target,         Intent intent, int requestCode, Bundle options) {     ...     try {     ...         \/\/ \u0412\u044b\u0437\u044b\u0432\u0430\u0435\u043c startActivity         int result = ActivityManagerNative.getDefault()             .startActivity(whoThread, who.getBasePackageName(), intent,                     intent.resolveTypeIfNeeded(who.getContentResolver()),                     token, target != null ? target.mEmbeddedID : null,                     requestCode, 0, null, null, options);         checkStartActivityResult(result, intent);     } catch (RemoteException e) {     }     return null; } <\/code><\/pre>\n<p>\u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043b\u0430\u0441\u0441\u0430 <code>Instrumentation<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043d\u043e\u0433\u0438\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u0437\u043d\u0430\u043a\u043e\u043c \u043f\u043e \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0442\u0435\u0441\u0442\u0430\u043c\u0438, \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u0432\u044b\u0437\u043e\u0432 <code>startActivity<\/code> \u0443 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 <code>ActivityManagerNative.getDefault()<\/code>. \u0410 \u044d\u0442\u043e \u043d\u0435 \u0447\u0442\u043e \u0438\u043d\u043e\u0435, \u043a\u0430\u043a <code>ActivityManager<\/code> \u0441\u0435\u0440\u0432\u0438\u0441. \u041c\u044b \u0435\u0433\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0447\u0435\u0440\u0435\u0437 \u0441\u0438\u043d\u0433\u043b\u0442\u043e\u043d <code>gDefault<\/code>.<\/p>\n<pre><code class=\"java\">\/\/ActivityManagerNative.java private static final Singleton&lt;IActivityManager> gDefault = new Singleton&lt;IActivityManager>() {     protected IActivityManager create() {             IBinder b = ServiceManager.getService(\"activity\");             ...             \/\/ \u0442\u043e \u0435\u0441\u0442\u044c gDefault - \u044d\u0442\u043e \u0438 \u0435\u0441\u0442\u044c IActivityManager               IActivityManager am = asInterface(b);             ...             return am;         } };   static public IActivityManager asInterface(IBinder obj) {     ...     return new ActivityManagerProxy(obj); }   class ActivityManagerProxy implements IActivityManager {     ...     public int startActivity(...) throws RemoteException {         Parcel data = Parcel.obtain();         Parcel reply = Parcel.obtain();         \/\/ \u043c\u043d\u043e\u0433\u043e \u0432\u0441\u0435\u0433\u043e \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 data     ...         \/\/ \u0412\u044b\u0437\u044b\u0432\u0430\u0435\u043c transact \u0431\u0438\u043d\u0434\u0435\u0440\u0430 (mRemote - \u0442\u0443\u0442 \u0438 \u0435\u0441\u0442\u044c IBinder)         mRemote.transact(START_ACTIVITY_TRANSACTION, data, reply, 0);         reply.readException();         int result = reply.readInt();         reply.recycle();         data.recycle();         return result;     }     ... } <\/code><\/pre>\n<p>\u0412 \u0438\u0442\u043e\u0433\u0435 \u0434\u0435\u043b\u0430\u0435\u043c \u0432\u044b\u0437\u043e\u0432 <code>transact<\/code> \u0443 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 <code>mRemote<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439, \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u0438 \u0435\u0441\u0442\u044c <code>IBinder<\/code>.<\/p>\n<p>\u0421\u0445\u0435\u043c\u0430\u0442\u0438\u0447\u043d\u043e \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0438\u0437\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c \u0442\u0430\u043a:<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0417\u0435\u043b\u0451\u043d\u044b\u043c\u0438 \u0446\u0432\u0435\u0442\u0430\u043c\u0438 \u044f \u0432\u044b\u0434\u0435\u043b\u0438\u043b \u0432\u0441\u0451, \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435. \u0421\u0438\u043d\u0438\u043c \u2014 \u0441\u0430\u043c Binder \u043a\u0430\u043a \u0441\u0432\u044f\u0437\u0443\u044e\u0449\u0435\u0435 \u0437\u0432\u0435\u043d\u043e. Activity Manager Service \u2014 \u044d\u0442\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043e\u0431\u0449\u0430\u0435\u0442\u0441\u044f \u043d\u0430\u0448 \u043f\u0440\u043e\u0446\u0435\u0441\u0441.<\/p>\n<p>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u0435 \u043d\u043e\u0432\u043e\u0439 Activity \u2014 \u044d\u0442\u043e Binder-\u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u044f.<\/p>\n<p>\u0410 \u043a\u0430\u043a\u0438\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0435\u0449\u0451 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f Binder-\u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u044f\u043c\u0438? \u0414\u0430 \u043c\u043d\u043e\u0433\u043e \u043a\u0430\u043a\u0438\u0445. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0441 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u043c \u0447\u0435\u0440\u0435\u0437 Messenger, \u0440\u0430\u0431\u043e\u0442\u0430 \u0441 Content Provider \u0438 \u0432\u0441\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u044b: ActivityManagerService, WindowManagerService, AlarmManagerService, NotificationManagerService, ConnectivityManagerService \u0438 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0435 (\u044f \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0438\u043b \u0442\u0435, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u043a\u0430\u0436\u0434\u044b\u0439 \u0438\u0437 \u043d\u0430\u0441 \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u043b\u0441\u044f \u043c\u043d\u043e\u0433\u043e \u0440\u0430\u0437). \u042d\u0442\u043e \u0432\u0441\u0451 \u0441\u0435\u0440\u0432\u0438\u0441\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0447\u0435\u0440\u0435\u0437 <code>Context::getSystemService<\/code>.<\/p>\n<p>\u042d\u0442\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u044b \u2014 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b, \u0438 \u043d\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u0435\u0442 \u0441 \u043d\u0438\u043c\u0438 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0447\u0435\u0440\u0435\u0437 Binder-\u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438.<\/p>\n<h3>Binder \u2014 \u0447\u0442\u043e \u044d\u0442\u043e \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e?<\/h3>\n<figure class=\"float full-width\"><figcaption>\u0413\u0434\u0435 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f Binder \u0432 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0435 \u0410\u043d\u0434\u0440\u043e\u0438\u0434\u0430. \u0412\u0437\u044f\u0442\u043e \u0438\u0437 https:\/\/developer.android.com\/guide\/platform<\/figcaption><\/figure>\n<p>Binder \u2014 \u044d\u0442\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u043d\u0430 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435 Android, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0438 \u0431\u044b\u0441\u0442\u0440\u043e\u0433\u043e \u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043c\u0435\u0436\u0434\u0443 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430\u043c\u0438. \u0412 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 <a href=\"https:\/\/developer.android.com\/guide\/platform\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438<\/a> \u0435\u0441\u0442\u044c \u043a\u043b\u0430\u0441\u0441\u043d\u0430\u044f \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0430 \u043d\u0430 \u044d\u0442\u043e\u0442 \u0441\u0447\u0451\u0442. <\/p>\n<p>Binder \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 Kernel Linux \u0438 \u0432\u0441\u0451 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0442\u0430\u043c. \u0415\u0441\u043b\u0438 \u043a\u0440\u0430\u0442\u043a\u043e, \u0442\u043e Binder \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0447\u0435\u0440\u0435\u0437 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438, \u043e\u043d \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e \u0443\u043f\u0430\u043a\u043e\u0432\u044b\u0432\u0430\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442 \u0438\u0445 \u043c\u0435\u0436\u0434\u0443 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430\u043c\u0438 \u0447\u0435\u0440\u0435\u0437 <a href=\"https:\/\/en.wikipedia.org\/wiki\/Ioctl\">ioctl<\/a>. \u041a\u0430\u043a \u0440\u0430\u0437 \u043f\u0440\u043e \u044d\u0442\u0438 \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438 \u0438 \u0448\u043b\u0430 \u0440\u0435\u0447\u044c, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u0433\u043e\u0432\u043e\u0440\u0438\u043b\u0438 \u043f\u0440\u043e \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u0431\u0443\u0444\u0435\u0440\u0430 \u0432 1 \u041c\u0431.<\/p>\n<p>\u0412\u044b\u0445\u043e\u0434\u0438\u0442, \u0447\u0442\u043e \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c Binder \u043e\u0447\u0435\u043d\u044c \u0447\u0430\u0441\u0442\u043e, \u043d\u043e \u043d\u0435 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e. \u041e\u0431\u044b\u0447\u043d\u043e \u044d\u0442\u043e \u0441\u043a\u0440\u044b\u0442\u043e \u043e\u0442 \u043d\u0430\u0441 \u0447\u0435\u0440\u0435\u0437 API Android Framework. \u0417\u043d\u0430\u0447\u0438\u0442, \u043c\u044b \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u043d\u0430\u0448 TransactionTooLargeException \u043e\u0442 \u043d\u0435\u044f\u0432\u043d\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f Binder-\u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0439.<\/p>\n<h2>\u0420\u0430\u0441\u043a\u0440\u043e\u0435\u043c \u0437\u0430\u0433\u0430\u0434\u043a\u0443 TransactionTooLargeException<\/h2>\n<p>\u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u043f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u044c \u0431\u0430\u0433 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0414\u0440\u0438\u043d\u043a\u0438\u0442. \u0412 \u043d\u0451\u043c \u0433\u043b\u0430\u0432\u043d\u044b\u0439 \u044d\u043a\u0440\u0430\u043d \u2014 \u044d\u0442\u043e \u043c\u0435\u043d\u044e \u043a\u043e\u0444\u0435\u0439\u043d\u0438. \u041c\u0435\u043d\u044e \u2014 \u044d\u0442\u043e Pager \u0441 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430\u043c\u0438. \u041a\u0430\u0436\u0434\u044b\u0439 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u2014 \u044d\u0442\u043e \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044f \u0432 \u043c\u0435\u043d\u044e \u0441 \u043a\u0443\u0447\u0435\u0439 \u0441\u0432\u043e\u0438\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432. \u041c\u044b \u043b\u0438\u0441\u0442\u0430\u0435\u043c \u043c\u0435\u043d\u044e \u0442\u0443\u0434\u0430-\u0441\u044e\u0434\u0430, \u0441\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u0438\u2026 \u043a\u0440\u0430\u0448.<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u041a\u0440\u0430\u0448 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432 \u0431\u044d\u043a\u0433\u0440\u0430\u0443\u043d\u0434\u0435. <\/p>\n<figure class=\"bordered full-width\"><figcaption> <\/figcaption><\/figure>\n<p>\u0414\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043f\u0440\u0438 \u0441\u0432\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u0438 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f Activity, \u0438 \u043f\u0440\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043e\u043d\u043e \u0447\u0435\u0440\u0435\u0437 Binder-\u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438.<\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u0435\u0435. \u0412\u0441\u0451 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 Activity:<\/p>\n<pre><code class=\"java\">\/\/ActivityThread.java @Override public void handleStopActivity(ActivityClientRecord r, int configChanges,         PendingTransactionActions pendingActions, boolean finalStateRequest, String reason) {     ...     final StopInfo stopInfo = new StopInfo();      \/\/ \u0417\u0434\u0435\u0441\u044c \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u043b\u043e\u0433\u0438\u043a\u0430 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0430\u043a\u0442\u0438\u0432\u0438\u0442\u0438     performStopActivityInner(r, stopInfo, true \/* saveState *\/, finalStateRequest,             reason);     ...     stopInfo.setActivity(r);     stopInfo.setState(r.state);     stopInfo.setPersistentState(r.persistentState);      \/\/ \u0417\u0434\u0435\u0441\u044c \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435     pendingActions.setStopInfo(stopInfo);     mSomeActivitiesChanged = true; }  private void performStopActivityInner(...) { ...     callActivityOnStop(r, saveState, reason); }  private void callActivityOnStop(ActivityClientRecord r, boolean saveState, String reason) {     ...     \/\/ \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c onSaveInstanceState \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0432\u0435\u0440\u0441\u0438\u0438 API (isPreP)     if (shouldSaveState &amp;&amp; isPreP) {         callActivityOnSaveInstanceState(r);     }     ...     r.activity.performStop(r.mPreserveWindow, reason);     ...     if (shouldSaveState &amp;&amp; !isPreP) {         callActivityOnSaveInstanceState(r);     } }<\/code><\/pre>\n<p>\u0427\u0435\u0440\u0435\u0437 <code>ActivityThread<\/code> \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432\u044b\u0437\u043e\u0432\u00a0 <code>handleStopActivity<\/code> \u0438 \u0442\u0430\u043c \u0432\u0430\u0436\u043d\u043e \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u0434\u0432\u0430 \u043c\u0435\u0441\u0442\u0430: <code>performStopActivityInner<\/code> \u0438 <code>pendingActions.setStopInfo<\/code>.<\/p>\n<ul>\n<li>\n<p><code>performStopActivityInner<\/code> \u2014 \u0437\u0434\u0435\u0441\u044c \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432\u044b\u0437\u043e\u0432 <code>onSaveInstanceState<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u043c \u0445\u043e\u0440\u043e\u0448\u043e \u0437\u043d\u0430\u043a\u043e\u043c \u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c. \u041a\u0441\u0442\u0430\u0442\u0438, \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0438\u043c\u0435\u043d\u043d\u043e \u0437\u0434\u0435\u0441\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f, \u043a\u043e\u0433\u0434\u0430 \u043e\u043d \u0432\u044b\u0437\u043e\u0432\u0435\u0442\u0441\u044f: \u0434\u043e \u0438\u043b\u0438 \u043f\u043e\u0441\u043b\u0435 <code>onStop()<\/code>, \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0432\u0435\u0440\u0441\u0438\u0438 Android.<\/p>\n<\/li>\n<li>\n<p><code>pendingActions.setStopInfo<\/code> \u2014 \u0437\u0434\u0435\u0441\u044c \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0432 \u043e\u0442\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043e\u0431\u044a\u0435\u043a\u0442 <code>stopInfo<\/code>. <code>stopInfo<\/code> \u2014 \u044d\u0442\u043e \u043e\u0431\u044a\u0435\u043a\u0442, \u043a\u0443\u0434\u0430 \u043c\u044b \u043d\u0430\u0441\u043e\u0431\u0438\u0440\u0430\u043b\u0438 \u0432\u0441\u0451, \u0447\u0442\u043e \u0445\u043e\u0442\u0438\u043c \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c. \u041f\u043e\u043c\u0438\u043c\u043e \u043f\u0440\u043e\u0447\u0435\u0433\u043e, <code>StopInfo<\/code> \u2014 \u044d\u0442\u043e <code>Runnable<\/code>, \u0438 \u043a\u0442\u043e-\u0442\u043e \u0435\u0433\u043e \u0434\u043e\u043b\u0436\u0435\u043d \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c.<\/p>\n<\/li>\n<\/ul>\n<p>\u0421\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 <code>pendingActions<\/code> \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u043e\u0437\u0436\u0435, \u043a\u043e\u0433\u0434\u0430 <code>ActivityThread<\/code> \u0432\u044b\u0437\u043e\u0432\u0435\u0442 <code>reportStop<\/code>, \u0438 \u0443\u0436\u0435 \u0442\u0430\u043c \u043c\u044b \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f <code>StopInfo<\/code> \u043a\u0430\u043a <code>Runnable<\/code> \u0447\u0435\u0440\u0435\u0437 <code>Handler<\/code>.<\/p>\n<pre><code class=\"java\">\/\/ ActivityThread.java   \/**    * Schedule the call to tell the activity manager we have stopped.  We don't do this    * immediately, because we want to have a chance for any other pending work (in particular    * memory trim requests) to complete before you tell the activity manager to proceed and allow    * us to go fully into the background.    *\/   @Override   public void reportStop(PendingTransactionActions pendingActions) {       mH.post(pendingActions.getStopInfo());   }<\/code><\/pre>\n<p>\u041f\u0440\u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0438 <code>StopInfo<\/code> \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<pre><code class=\"java\">\/\/ PendingTransactionActions.java public class PendingTransactionActions {   ...   public static class StopInfo implements Runnable {       @Override       public void run() {           ...           try {               ...               \/\/ \u042d\u0442\u043e \u0438 \u0435\u0441\u0442\u044c \u0432\u044b\u0437\u043e\u0432 Binder \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438                \/\/ \u0447\u0435\u0440\u0435\u0437 \u0441\u0435\u0440\u0432\u0438\u0441 ActivityManagerService               ActivityClient.getInstance().activityStopped(                       mActivity.token, mState, mPersistentState, mDescription);           } catch<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-340165","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/340165","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=340165"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/340165\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=340165"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=340165"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=340165"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}