summaryrefslogtreecommitdiff
path: root/core/java/android/app/NativeActivity.java
Commit message (Collapse)AuthorAgeFilesLines
* Add maxTargetSdk restriction to unused APIs.Mathew Inwood2020-10-291-6/+6
| | | | | | | | | | | | | | | | | | | These are APIs that have @UnsupportedAppUsage but for which we don't have any evidence of them currently being used, so should be safe to remove from the unsupported list. This is a resubmit of ag/12929664 with some APIs excluded that caused test failures; see bugs 171886397, 171888296, 171864568. APIs excluded: Landroid/bluetooth/le/ScanRecord;->parseFromBytes([B)Landroid/bluetooth/le/ScanRecord; Landroid/os/Process;->myPpid()I Landroid/os/SharedMemory;->getFd()I Landroid/hardware/input/InputManager;->INJECT_INPUT_EVENT_MODE_WAIT_FOR_FINISH:I Bug: 170729553 Test: Treehugger Change-Id: I8285daa8530260251ecad6f3f38f98e263629ca7
* Revert "Add maxTargetSdk restriction to unused APIs."Hongwei Wang2020-10-281-6/+6
| | | | | | | | | This reverts commit 72f07d6a8a32db4a0dedd7682a0b3385be2b9cd6. Reason for revert: Droidcop-triggered revert due to breakage https://android-build.googleplex.com/builds/quarterdeck?testMethod=testAppZygotePreload&testClass=android.app.cts.ServiceTest&atpConfigName=suite%2Ftest-mapping-presubmit-retry_cloud-tf&testModule=CtsAppTestCases&fkbb=6936597&lkbb=6936969&lkgb=6936551&testResults=true&branch=git_master&target=cf_x86_phone-userdebug>, bug b/171886397 Bug: 171886397 Change-Id: Ibe0f0430a3451477c1ee8ef56a596e91ea1e7672
* Add maxTargetSdk restriction to unused APIs.Mathew Inwood2020-10-271-6/+6
| | | | | | | | | | These are APIs that have @UnsupportedAppUsage but for which we don't have any evidence of them currently being used, so should be safe to remove from the unsupported list. Bug: 170729553 Test: Treehugger Change-Id: I4c8fd0006f950de9955242e93968fb0996ceb372
* Use new UnsupportedAppUsage annotation.Artur Satayev2019-12-181-1/+1
| | | | | | | | Existing annotations in libcore/ and frameworks/ will deleted after the migration. This also means that any java library that compiles @UnsupportedAppUsage requires a direct dependency on "unsupportedappusage" java_library. Bug: 145132366 Test: m && diff unsupportedappusage_index.csv Change-Id: I8789f8499d4dca08580672e9e45ed9a7026dd686
* Add @UnsupportedAppUsage annotationsMathew Inwood2018-08-141-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | For packages: android.app.usage android.app.trust android.app.timezonedetector android.app.timezone android.app.timedetector android.app.job android.app.backup android.app.assist android.app.admin android.app This is an automatically generated CL. See go/UnsupportedAppUsage for more details. Exempted-From-Owner-Approval: Mechanical changes to the codebase which have been approved by Android API council and announced on android-eng@ Bug: 110868826 Test: m Change-Id: I618c5dc4462ae990d9df45c3e9ed3f092cc5138c
* Merge "Create linker-namespace for the classloader" into nyc-devDimitry Ivanov2016-02-261-4/+2
|\ | | | | | | | | | | | | am: 1a2cb453fa * commit '1a2cb453fa8204db84d92fd2de92b0ed1e546a03': Create linker-namespace for the classloader
| * Create linker-namespace for the classloaderDimitry Ivanov2016-02-251-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With this change ApplicationLoaders.getClassLoader() creates linker-namespace for the classloader at the construction time. Before this change the namespace was created on first load of a jni library. With this change we ensure that every classloader has initialized namespace associated with it. As an additional advantage we now can avoid storing namespace-specific fields in the classloaders. Bug: http://b/27189432 Bug: http://b/22548808 Change-Id: I3b160bd478a55171008682c40b2ebc13bdbd9882
* | Merge "Construct classloader for apps with no java code" into nyc-devDimitry Ivanov2016-02-221-1/+2
|\| | | | | | | | | | | | | am: 05ba2b724c * commit '05ba2b724c5049c3bd14717f1abf76ca71287de4': Construct classloader for apps with no java code
| * Construct classloader for apps with no java codeDimitry Ivanov2016-02-191-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The commit 6f06ad7df1362e9e5b252689f452bdeee2e5af46 fixed a way to load native library for NativeActivity by using classloader logic to find the library; which also fixed the problem of native activity not working when library is supposed to be opened directly from the apk. As a side effect it introduced regression - apps without java code did not have correctly initialized classloader. This change fixes this by constructing classloader with empty dexpath but valid nativeLibrarySearchPath. Bug: http://b/26015561 Bug: http://b/27250344 Change-Id: I50f1119f0976a95edd75d88efb9fcdedc57efbc3
* | Merge "The NDK samples moved a while back."Elliott Hughes2016-02-101-10/+2
|\ \ | |/ |/| | | | | | | | | am: 9653790de2 * commit '9653790de25dfa77076701c3c2932ea93b7f9968': The NDK samples moved a while back.
| * The NDK samples moved a while back.Elliott Hughes2016-02-091-10/+2
| | | | | | | | Change-Id: I10f419b0ad58f9c5417a3f06775e298c74f284dc
| * Use nativeloader to load NativeActivityDmitriy Ivanov2015-12-111-12/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | System apps are the exception and they can access internal platform libraries (this is needed for bundled apps to work correctly). Also fix the way NativeActivity loads the native library to correspond to the way BaseDexClassloader does it. Bug: http://b/22548808 Bub: http://b/25777936 Change-Id: Idc94cdded182ea2cb1cbebc76c336cc3394c7ebe
* | Use nativeloader to load NativeActivityDmitriy Ivanov2015-12-111-12/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | System apps are the exception and they can access internal platform libraries (this is needed for bundled apps to work correctly). Also fix the way NativeActivity loads the native library to correspond to the way BaseDexClassloader does it. Bug: http://b/22548808 Bub: http://b/25777936 Change-Id: Idc94cdded182ea2cb1cbebc76c336cc3394c7ebe (cherry picked from commit 6f06ad7df1362e9e5b252689f452bdeee2e5af46)
* | Use Context.getSystemService(Class<T>) for InputMethodManager.Yohei Yukawa2015-11-261-2/+2
|/ | | | | | | | | This is a mechanical replacement of Context.getSystemService(String) with Context.getSystemService(Class<T>) when retrieving InputMethodManager. Note those are bundled code. Hence we don't need to make sure Build.VERSION.SDK_INT >= 23. Change-Id: Icc64942ad8f11e44bf84f8d4fe476b2fdd1257f3
* AArch64: Use long for pointers in App/BackupAshok Bhat2014-01-081-19/+18
| | | | | | | | | | | | | | For storing pointers, long is used, as native pointers can be 64-bit. In addition, some minor changes have been done to conform with standard JNI practice (e.g. use of jint instead of int in JNI function prototypes) Change-Id: I7aee49dc26cf6c86af8f1d882e9cd1cc145a1977 Signed-off-by: Ashok Bhat <ashok.bhat@arm.com> Signed-off-by: Marcus Oakland <marcus.oakland@arm.com> Signed-off-by: Kévin PETIT <kevin.petit@arm.com>
* Gracefully handle missing directories.Jeff Sharkey2013-08-151-4/+8
| | | | | Bug: 10295932 Change-Id: I9d18682d0ba57bf7f77d043ee8dab286ee80ba2a
* APIs for multiple external storage devices.Jeff Sharkey2013-08-111-5/+4
| | | | | | | | | | | | | Provide developer APIs to discover application-specific paths on secondary external storage devices. Covers files, cache, and OBB directories. Apps will not have write access outside their package- specific directories on secondary devices, so only primary storage is exposed through Environment. Creation of .nomedia files will be handled by FUSE daemon in future change. Change-Id: Ifcce6201a686d80269d7285adb597c008cf8fa7c
* Rewrite input handling for native applicationsMichael Wright2013-04-221-40/+6
| | | | | Bug: 8473020 Change-Id: Ic4353d8924ab877bec21aff8c2dba9fe725bf906
* Queues, queues, queues and input.Jeff Brown2013-04-081-22/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Redesigned how ViewRootImpl delivers input events to views, the IME and to native activities to fix several issues. The prior change to make IME input event delegation use InputChannels failed to take into account that InputMethodManager is a singleton attached to the main looper whereas UI may be attached to any looper. Consequently interactions with the InputChannel might occur on the wrong thread. Fixed this problem by checking the current thread and posting input events or callbacks to the correct looper when necessary. NativeActivity has also been broken for a while because the default event handling logic for joysticks and touch navigation was unable to dispatch events back into the native activity. In particular, this meant that DPad synthesis from touch navigation would not work in any native activity. The plan is to fix this problem by passing all events through ViewRootImpl as usual then forwarding them to native activity as needed. This should greatly simplify IME pre-dispatch and system key handling and make everything more robust overall. Fixed issues related to when input events are synthesized. In particular, added a more robust mechanism to ensure that synthetic events are canceled appropriately when we discover that events are no longer being resynthesized (because the application or IME is handling or dropping them). The new design is structured as a pipeline with a chain of responsibility consisting of InputStage objects. Each InputStage is responsible for some part of handling each input event such as dispatching to the view hierarchy or to the IME. As a stage processes an input event, it has the option of finishing the event, forwarding the event to the next stage or handling the event asynchronously. Some queueing logic takes care to ensure that events are forwarded downstream in the correct order even if they are handled out of order by a given stage. Cleaned up the InputMethodManager singleton initialization logic to make it clearer that it must be attached to the main looper. We don't actually need to pass this looper around. Deleted the LatencyTimer class since no one uses it and we have better ways of measuring latency these days using systrace. Added a hidden helper to Looper to determine whether the current thread is the indicated Looper thread. Note: NativeActivity's IME dispatch is broken by this patch. This will be fixed later in another patch. Bug: 8473020 Change-Id: Iac2a1277545195a7a0137bbbdf04514c29165c60
* Use input transport for communications between app and IME.Jeff Brown2013-03-261-2/+1
| | | | | | | | | | | | | | | | | | | The input method manager service now supplies an input channel for communication while creating an IME session on behalf of the application. This change significanly reduces the overhead of IME event dispatch by using a standard input channel to send input events rather than using binder. This results in fewer thread context switches and fewer object allocations. What's more, the IME may perform additional batching of the motion events that it receives which may help it catch up if it is getting behind while processing them. Bug: 7984576 Bug: 8473020 Change-Id: Ibe26311edd0060cdcae80194f1753482e635786f
* Allow applications to recover from IME related ANRs.Jeff Brown2012-06-141-7/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Timeout after 2.5 seconds. Because communication with an IME occurs asynchronously using oneway binder calls, it's possible for an input event that was delegated to the IME to be dropped on the floor. When this happens, the app (not the IME!) will get blamed for the problem and will ANR forever. Even if an event is not dropped on the floor, we should eventually time out event dispatch to the IME if it's being too slow. This patch implements a timeout on all events delegated to the IME. When the timeout expires, the event is marked as having not been handled by the IME and the application gets a crack at it. We also write a message to the log when this occurs. Ensure that we do not invoke the event finished callback while holding the InputMethodManager's lock to avoid potential deadlocks. Fixed a minor bug where the InputMethodManager would not remember the id of the current input method. This caused the log messages and dumpsys state to print "null" as the current input method id. Bug: 6662465 Change-Id: Ibb3ddeb087ee6998996b0b845134e16a18aa3057
* Add API to get path to OBBs.Dianne Hackborn2011-01-161-2/+2
| | | | | | | | | Also hide the bitmap thumbnail stuff, we can't support it in its current form. And fix some bugs with propagating paths to native code. Yikes! Change-Id: I13ab37ddbdba5c073489cba5eab035117d3c1574
* Tell system server whether the app handled input events.Jeff Brown2010-11-081-2/+4
| | | | | | | | | | Refactored ViewRoot, NativeActivity and related classes to tell the dispatcher whether an input event was actually handled by the application. This will be used to move more of the global default key processing into the system server instead of the application. Change-Id: If06b98b6f45c543e5ac5b1eae2b3baf9371fba28
* Fix issue #3126018: No way to specify NativeActivity's native methodDianne Hackborn2010-10-241-4/+19
| | | | Change-Id: I59de6a543e7f7f45d963a905829a3f56f32bf8cf
* Fix issue #3113219: NativeActivity using wrong lib path with Java codeDianne Hackborn2010-10-201-9/+4
| | | | | | Use the same path whether the .apk has dalvik code or not. Change-Id: I66397d7f7e328d5580565ceb17a941afac0e0f8b
* Use new nativeLibraryPath field for NativeActivityKenny Root2010-09-071-9/+4
| | | | | | | | Instead of being naughty and guessing the native library path from dataDir, use the new nativeLibraryPath field because it can be on SD card now. Change-Id: I284bde42e0b0114366e412eb7212af22b47208d8
* More native work.Dianne Hackborn2010-08-111-5/+36
| | | | | | | Implement save/restore of state, and add native APIs for configuration information. Change-Id: I2a3ddc2ba605db58d7c8b2b31b9215fb323f90b5
* Implement native key pre-dispatching to IMEs.Dianne Hackborn2010-07-151-0/+33
| | | | | | | | | | | | | | | | This significantly re-works the native key dispatching code to allow events to be pre-dispatched to the current IME before being processed by native code. It introduces one new public API, which must be called after retrieving an event if the app wishes for it to be pre-dispatched. Currently the native code will only do pre-dispatching of system keys, to avoid significant overhead for gaming input. This should be improved to be smarted, filtering for only keys that the IME is interested in. Unfortunately IMEs don't currently provide this information. :p Change-Id: Ic1c7aeec8b348164957f2cd88119eb5bd85c2a9f
* Add native C APIs for working with the Asset ManagerChristopher Tate2010-07-151-2/+4
| | | | Change-Id: I493b142c4b35e5cc1a1e85283bb5dfb306a6d261
* IME events are now dispatched to native applications.Dianne Hackborn2010-07-131-5/+96
| | | | | | | | | | | | | | | And also: - APIs to show and hide the IME, and control its interaction with the app. - APIs to tell the app when its window resizes and needs to be redrawn. - API to tell the app the content rectangle of its window (to layout around the IME or status bar). There is still a problem with IME interaction -- we need a way for the app to deliver events to the IME before it handles them, so that for example the back key will close the IME instead of finishing the app. Change-Id: I37b75fc2ec533750ef36ca3aedd2f0cc0b5813cd
* Add new native Looper API.Dianne Hackborn2010-07-021-2/+9
| | | | | | | | | | | This allows us to avoid exposing the file descriptor of the event queue; instead, you attach an event queue to a looper. This will also should allow native apps to be written without the need for a separate thread, by attaching the event queue to the main thread's looper and scheduling their own messages there. Change-Id: I38489282635895ae2cbfacb88599c1b1cad9b239
* Make real API for native code to get its window.Dianne Hackborn2010-07-011-7/+18
| | | | | | | Added implementation to use ANativeWindow and provide it to a NativeActivity. Change-Id: I890d71b6e15d4af71e6cf81b327961d7061ec1c2
* Implement default key handling for native code.Dianne Hackborn2010-06-301-9/+53
| | | | | | | | | The native code now maintains a list of all keys that may use default handling. If the app finishes one of these keys without handling it, the key will be passed back off to Java for default treatment. Change-Id: I6a842a0d728eeafa4de7142fae573f8c11099e18
* Remove InputConsumer, replacing with InputQueue.Dianne Hackborn2010-06-231-7/+7
| | | | Change-Id: Ib06907278457aaee842b123adc072840ca3602d8
* First stab at attaching native event dispatching.Dianne Hackborn2010-06-221-1/+15
| | | | | | | | | | | | Provides the basic infrastructure for a NativeActivity's native code to get an object representing its event stream that can be used to read input events. Still work to do, probably some API changes, and reasonable default key handling (so that for example back will still work). Change-Id: I6db891bc35dc9683181d7708eaed552b955a077e
* Update NativeActivity to allow direct surface access.Dianne Hackborn2010-05-181-7/+26
| | | | | | No actual native API for using a surface, but it's a step. Change-Id: I627f26b705abc7a05edf9117411abfacf0fae64a
* First pass at NativeActivity.Dianne Hackborn2010-05-051-0/+122
This is a rough sketch of the new pure-native API, which you can use through a NativeActivity in your manifest (no Java code in the .apk needed!). Intentionally no docs yet, the API is still being seriously messed with. But it works. Change-Id: I0e916d58a0d159ecaf3689e41834eb8dc681c0c0