226 Commits

Author SHA1 Message Date
Jing Ji
7e76d37fdb Merge "Explicitly exit from the am instrument after test completes" 2021-11-03 17:07:30 +00:00
Jing Ji
209ddf9871 Explicitly exit from the am instrument after test completes
To speed up the test. For a trivial am instrument run:

[Before]
0m01.53s real     0m00.16s user     0m00.16s system

[After]
0m00.72s real     0m00.21s user     0m00.11s system

Bug: 204195830
Test: am instrument -w
Change-Id: I66196d1db9169681dabb2e5dacdd18e6105ad75a
2021-11-01 17:35:37 -07:00
hongzhu wang
4201a5ddbc Fix: crash when running am.jar without parameters
Issure:
When no args to run am.jar,mAm is not initialized before use
process will crash in NRE

Solution:
Initialize mAm in constructor

Bug: 202471754
Test: manual
Running follow sh on the device displays help messages correctly

base=/system
export CLASSPATH=$base/framework/am.jar
exec app_process $base/bin com.android.commands.am.Am

Change-Id: I088f4f5b4072d350c217655a291658d0bfd506e9
2021-10-09 05:04:03 +00:00
Jing Ji
fa42613b96 Fix the argument list to logcat from am instrument
Bug: 186570682
Test: am instrument
Change-Id: I3290022c865ca16150c3392657f1fe9d31834fc5
2021-05-07 21:11:24 -07:00
Bob Badour
8a6a2bce6c [LSC] Add LOCAL_LICENSE_KINDS to frameworks/base
Added SPDX-license-identifier-Apache-2.0 to:
  apct-tests/perftests/autofill/Android.bp
  apct-tests/perftests/blobstore/Android.bp
  apct-tests/perftests/core/Android.bp
  apct-tests/perftests/core/apps/overlay/Android.bp
  apct-tests/perftests/core/apps/reources_manager/Android.bp
  apct-tests/perftests/core/jni/Android.bp
  apct-tests/perftests/multiuser/Android.bp
  apct-tests/perftests/multiuser/apps/dummyapp/Android.bp
  apct-tests/perftests/packagemanager/Android.bp
  apct-tests/perftests/packagemanager/apps/query-all/Android.bp
  apct-tests/perftests/textclassifier/Android.bp
  apct-tests/perftests/utils/Android.bp
  apct-tests/perftests/windowmanager/Android.bp
  apex/Android.bp
  apex/blobstore/framework/Android.bp
  apex/blobstore/service/Android.bp
  apex/jobscheduler/framework/Android.bp
  apex/jobscheduler/service/Android.bp
  apex/media/Android.bp
  apex/media/aidl/Android.bp
  apex/media/framework/Android.bp
  cmds/am/Android.bp
  cmds/app_process/Android.bp
  cmds/appops/Android.bp
  cmds/appwidget/Android.bp
  cmds/backup/Android.bp
  cmds/bmgr/Android.bp
  cmds/bootanimation/Android.bp
  cmds/bu/Android.bp
  cmds/content/Android.bp
  cmds/dpm/Android.bp
  cmds/hid/Android.bp
  cmds/hid/jni/Android.bp
  cmds/idmap2/Android.bp
  cmds/ime/Android.bp
  cmds/incident/Android.bp
  cmds/incident_helper/Android.bp
  cmds/incidentd/Android.bp
  cmds/input/Android.bp
  cmds/interrupter/Android.bp
  cmds/locksettings/Android.bp
  cmds/pm/Android.bp
  cmds/requestsync/Android.bp
  cmds/screencap/Android.bp
  cmds/sm/Android.bp
  cmds/svc/Android.bp
  cmds/telecom/Android.bp
  cmds/uiautomator/Android.bp
  cmds/uiautomator/cmds/uiautomator/Android.bp
  cmds/uiautomator/instrumentation/Android.bp
  cmds/uiautomator/library/Android.bp
  cmds/vr/Android.bp
  cmds/wm/Android.bp
  config/Android.bp
  core/java/android/service/wallpaper/Android.bp
  core/jni/Android.bp
  core/sysprop/Android.bp
  core/tests/BroadcastRadioTests/Android.bp
  core/tests/ConnectivityManagerTest/Android.bp
  core/tests/PackageInstallerSessions/Android.bp
  core/tests/PlatformCompatFramework/Android.bp
  core/tests/bandwidthtests/Android.bp
  core/tests/benchmarks/Android.bp
  core/tests/bluetoothtests/Android.bp
  core/tests/bugreports/Android.bp
  core/tests/coretests/Android.bp
  core/tests/coretests/BinderDeathRecipientHelperApp/Android.bp
  core/tests/coretests/BinderProxyCountingTestApp/Android.bp
  core/tests/coretests/BinderProxyCountingTestService/Android.bp
  core/tests/coretests/BstatsTestApp/Android.bp
  core/tests/coretests/DisabledTestApp/Android.bp
  core/tests/coretests/EnabledTestApp/Android.bp
  core/tests/coretests/aidl/Android.bp
  core/tests/coretests/apks/Android.bp
  core/tests/coretests/apks/install/Android.bp
  core/tests/coretests/apks/install_bad_dex/Android.bp
  core/tests/coretests/apks/install_complete_package_info/Android.bp
  core/tests/coretests/apks/install_decl_perm/Android.bp
  core/tests/coretests/apks/install_jni_lib/Android.bp
  core/tests/coretests/apks/install_jni_lib_open_from_apk/Android.bp
  core/tests/coretests/apks/install_loc_auto/Android.bp
  core/tests/coretests/apks/install_loc_internal/Android.bp
  core/tests/coretests/apks/install_loc_sdcard/Android.bp
  core/tests/coretests/apks/install_loc_unspecified/Android.bp
  core/tests/coretests/apks/install_use_perm_good/Android.bp
  core/tests/coretests/apks/install_uses_feature/Android.bp
  core/tests/coretests/apks/install_verifier_bad/Android.bp
  core/tests/coretests/apks/install_verifier_good/Android.bp
  core/tests/coretests/apks/keyset/Android.bp
  core/tests/coretests/apks/locales/Android.bp
  core/tests/coretests/apks/overlay_config/Android.bp
  core/tests/coretests/apks/version/Android.bp
  core/tests/coretests/apks/version_nosys/Android.bp
  core/tests/featureflagtests/Android.bp
  core/tests/hdmitests/Android.bp
  core/tests/hosttests/test-apps/AutoLocTestApp/Android.bp
  core/tests/hosttests/test-apps/AutoLocVersionedTestApp_v1/Android.bp
  core/tests/hosttests/test-apps/AutoLocVersionedTestApp_v2/Android.bp
  core/tests/hosttests/test-apps/ExternalLocAllPermsTestApp/Android.bp
  core/tests/hosttests/test-apps/ExternalLocPermsFLTestApp/Android.bp
  core/tests/hosttests/test-apps/ExternalLocTestApp/Android.bp
  core/tests/hosttests/test-apps/ExternalLocVersionedTestApp_v1/Android.bp
  core/tests/hosttests/test-apps/ExternalLocVersionedTestApp_v2/Android.bp
  core/tests/hosttests/test-apps/ExternalSharedPerms/Android.bp
  core/tests/hosttests/test-apps/ExternalSharedPermsBT/Android.bp
  core/tests/hosttests/test-apps/ExternalSharedPermsDiffKey/Android.bp
  core/tests/hosttests/test-apps/ExternalSharedPermsFL/Android.bp
  core/tests/hosttests/test-apps/InternalLocTestApp/Android.bp
  core/tests/hosttests/test-apps/MultiDexLegacyTestServicesTests/Android.bp
  core/tests/hosttests/test-apps/NoLocTestApp/Android.bp
  core/tests/hosttests/test-apps/NoLocVersionedTestApp_v1/Android.bp
  core/tests/hosttests/test-apps/NoLocVersionedTestApp_v2/Android.bp
  core/tests/hosttests/test-apps/SharedUid/32/Android.bp
  core/tests/hosttests/test-apps/SharedUid/32/jni/Android.bp
  core/tests/hosttests/test-apps/SharedUid/64/Android.bp
  core/tests/hosttests/test-apps/SharedUid/64/jni/Android.bp
  core/tests/hosttests/test-apps/SharedUid/dual/Android.bp
  core/tests/hosttests/test-apps/SharedUid/dual/jni/Android.bp
  core/tests/hosttests/test-apps/SharedUid/java_only/Android.bp
  core/tests/hosttests/test-apps/SimpleTestApp/Android.bp
  core/tests/hosttests/test-apps/UpdateExtToIntLocTestApp_v1_ext/Android.bp
  core/tests/hosttests/test-apps/UpdateExtToIntLocTestApp_v2_int/Android.bp
  core/tests/hosttests/test-apps/UpdateExternalLocTestApp_v1_ext/Android.bp
  core/tests/hosttests/test-apps/UpdateExternalLocTestApp_v2_none/Android.bp
  core/tests/hosttests/test-apps/VersatileTestApp_Auto/Android.bp
  core/tests/hosttests/test-apps/VersatileTestApp_External/Android.bp
  core/tests/hosttests/test-apps/VersatileTestApp_Internal/Android.bp
  core/tests/hosttests/test-apps/VersatileTestApp_None/Android.bp
  core/tests/mockingcoretests/Android.bp
  core/tests/notificationtests/Android.bp
  core/tests/overlaytests/device/Android.bp
  core/tests/overlaytests/device/test-apps/AppOverlayOne/Android.bp
  core/tests/overlaytests/device/test-apps/AppOverlayTwo/Android.bp
  core/tests/overlaytests/device/test-apps/FrameworkOverlay/Android.bp
  core/tests/overlaytests/host/Android.bp
  core/tests/overlaytests/remount/Android.bp
  core/tests/overlaytests/remount/test-apps/Overlay/Android.bp
  core/tests/overlaytests/remount/test-apps/SharedLibrary/Android.bp
  core/tests/overlaytests/remount/test-apps/SharedLibraryOverlay/Android.bp
  core/tests/overlaytests/remount/test-apps/Target/Android.bp
  core/tests/packagemanagertests/Android.bp
  core/tests/privacytests/Android.bp
  core/tests/screenshothelpertests/Android.bp
  core/tests/systemproperties/Android.bp
  core/tests/utillib/Android.bp
  core/tests/utiltests/Android.bp
  core/tests/utiltests/jni/Android.bp
  core/tests/uwbtests/Android.bp
  core/xsd/Android.bp
  core/xsd/vts/Android.bp
  data/etc/Android.bp
  data/etc/car/Android.bp
  data/fonts/Android.bp
  data/keyboards/Android.mk
  drm/jni/Android.bp
  errorprone/Android.bp
  graphics/proto/Android.bp
  keystore/Android.bp
  keystore/tests/Android.bp
  libs/WindowManager/Jetpack/Android.bp
  libs/WindowManager/Shell/Android.bp
  libs/WindowManager/Shell/tests/Android.bp
  libs/androidfw/Android.bp
  libs/androidfw/fuzz/resourcefile_fuzzer/Android.bp
  libs/hostgraphics/Android.bp
  libs/incident/Android.bp
  libs/input/Android.bp
  libs/input/tests/Android.bp
  libs/protoutil/Android.bp
  libs/services/Android.bp
  libs/storage/Android.bp
  libs/usb/tests/AccessoryChat/Android.bp
  libs/usb/tests/AccessoryChat/accessorychat/Android.bp
  location/lib/Android.bp
  location/tests/Android.bp
  location/tests/locationtests/Android.bp
  lowpan/tests/Android.bp
  media/Android.bp
  media/java/Android.bp
  media/java/android/media/tv/tunerresourcemanager/Android.bp
  media/jni/Android.bp
  media/jni/audioeffect/Android.bp
  media/jni/soundpool/Android.bp
  media/jni/soundpool/tests/Android.bp
  media/lib/remotedisplay/Android.bp
  media/lib/signer/Android.bp
  media/lib/tvremote/Android.bp
  media/lib/tvremote/tests/Android.bp
  media/mca/filterfw/Android.bp
  media/mca/filterfw/native/Android.bp
  media/mca/filterpacks/Android.bp
  media/mca/samples/CameraEffectsRecordingSample/Android.bp
  media/mca/tests/Android.bp
  media/native/midi/Android.bp
  media/packages/BluetoothMidiService/Android.bp
  media/packages/BluetoothMidiService/tests/unit/Android.bp
  media/tests/AudioPolicyTest/Android.bp
  media/tests/CameraBrowser/Android.bp
  media/tests/EffectsTest/Android.bp
  media/tests/MediaDump/Android.bp
  media/tests/MediaFrameworkTest/Android.bp
  media/tests/MediaRouter/Android.bp
  media/tests/MtpTests/Android.bp
  media/tests/ScoAudioTest/Android.bp
  media/tests/SoundPoolTest/Android.bp
  media/tests/TunerTest/Android.bp
  media/tests/audiotests/Android.bp
  media/tests/players/Android.bp
  mime/Android.bp
  native/android/Android.bp
  native/graphics/jni/Android.bp
  native/webview/loader/Android.bp
  nfc-extras/Android.bp
  nfc-extras/tests/Android.bp
  packages/AppPredictionLib/Android.bp
  packages/BackupEncryption/Android.bp
  packages/BackupEncryption/test/robolectric-integration/Android.bp
  packages/BackupEncryption/test/robolectric/Android.bp
  packages/BackupEncryption/test/unittest/Android.bp
  packages/BackupRestoreConfirmation/Android.bp
  packages/CarSystemUI/Android.bp
  packages/CarrierDefaultApp/Android.bp
  packages/CarrierDefaultApp/tests/unit/Android.bp
  packages/CompanionDeviceManager/Android.bp
  packages/Connectivity/framework/Android.bp
  packages/Connectivity/service/Android.bp
  packages/CtsShim/Android.bp
  packages/CtsShim/build/Android.bp
  packages/CtsShim/build/jni/Android.bp
  packages/DynamicSystemInstallationService/Android.bp
  packages/DynamicSystemInstallationService/tests/Android.bp
  packages/EasterEgg/Android.bp
  packages/EncryptedLocalTransport/Android.bp
  packages/ExtShared/Android.bp
  packages/ExternalStorageProvider/Android.bp
  packages/ExternalStorageProvider/tests/Android.bp
  packages/FakeOemFeatures/Android.bp
  packages/FusedLocation/Android.bp
  packages/InputDevices/Android.bp
  packages/LocalTransport/Android.bp
  packages/PackageInstaller/Android.bp
  packages/PrintRecommendationService/Android.bp
  packages/PrintSpooler/Android.bp
  packages/PrintSpooler/jni/Android.bp
  packages/PrintSpooler/tests/outofprocess/Android.bp
  packages/SettingsLib/ActionBarShadow/Android.bp
  packages/SettingsLib/ActionButtonsPreference/Android.bp
  packages/SettingsLib/AdaptiveIcon/Android.bp
  packages/SettingsLib/Android.bp
  packages/SettingsLib/AppPreference/Android.bp
  packages/SettingsLib/BarChartPreference/Android.bp
  packages/SettingsLib/DisplayDensityUtils/Android.bp
  packages/SettingsLib/EntityHeaderWidgets/Android.bp
  packages/SettingsLib/HelpUtils/Android.bp
  packages/SettingsLib/LayoutPreference/Android.bp
  packages/SettingsLib/ProgressBar/Android.bp
  packages/SettingsLib/RadioButtonPreference/Android.bp
  packages/SettingsLib/RestrictedLockUtils/Android.bp
  packages/SettingsLib/SchedulesProvider/Android.bp
  packages/SettingsLib/SearchProvider/Android.bp
  packages/SettingsLib/SearchWidget/Android.bp
  packages/SettingsLib/SettingsSpinner/Android.bp
  packages/SettingsLib/SettingsTheme/Android.bp
  packages/SettingsLib/Tile/Android.bp
  packages/SettingsLib/Utils/Android.bp
  packages/SettingsLib/search/Android.bp
  packages/SettingsLib/tests/integ/Android.bp
  packages/SettingsLib/tests/robotests/Android.bp
  packages/SettingsProvider/Android.bp
  packages/SharedStorageBackup/Android.bp
  packages/Shell/Android.bp
  packages/Shell/tests/Android.bp
  packages/SimAppDialog/Android.bp
  packages/SoundPicker/Android.bp
  packages/StatementService/Android.bp
  packages/SystemUI/Android.bp
  packages/SystemUI/plugin/Android.bp
  packages/SystemUI/plugin/ExamplePlugin/Android.bp
  packages/SystemUI/plugin_core/Android.bp
  packages/SystemUI/shared/Android.bp
  packages/VpnDialogs/Android.bp
  packages/WAPPushManager/Android.bp
  packages/WAPPushManager/tests/Android.bp
  packages/WallpaperBackup/Android.bp
  packages/WallpaperCropper/Android.bp
  packages/overlays/Android.mk
  packages/overlays/tests/Android.bp
  packages/services/PacProcessor/Android.bp
  packages/services/PacProcessor/jni/Android.bp
  packages/services/Proxy/Android.bp
  proto/Android.bp
  rs/jni/Android.mk
  samples/demo/haptic-assessment/Android.bp
  sax/tests/saxtests/Android.bp
  services/Android.bp
  services/accessibility/Android.bp
  services/appprediction/Android.bp
  services/appwidget/Android.bp
  services/autofill/Android.bp
  services/backup/Android.bp
  services/backup/backuplib/Android.bp
  services/companion/Android.bp
  services/contentcapture/Android.bp
  services/contentsuggestions/Android.bp
  services/core/Android.bp
  services/core/java/com/android/server/vcn/Android.bp
  services/core/jni/Android.bp
  services/core/xsd/Android.bp
  services/core/xsd/vts/Android.bp
  services/coverage/Android.bp
  services/devicepolicy/Android.bp
  services/incremental/Android.bp
  services/midi/Android.bp
  services/net/Android.bp
  services/people/Android.bp
  services/print/Android.bp
  services/profcollect/Android.bp
  services/restrictions/Android.bp
  services/robotests/Android.bp
  services/robotests/backup/Android.bp
  services/systemcaptions/Android.bp
  services/tests/PackageManagerComponentOverrideTests/Android.bp
  services/tests/PackageManagerServiceTests/host/Android.bp
  services/tests/PackageManagerServiceTests/host/test-apps/Android.bp
  services/tests/mockingservicestests/Android.bp
  services/tests/rescueparty/Android.bp
  services/tests/servicestests/Android.bp
  services/tests/servicestests/aidl/Android.bp
  services/tests/servicestests/apks/Android.bp
  services/tests/servicestests/apks/install-split-base/Android.bp
  services/tests/servicestests/apks/install-split-feature-a/Android.bp
  services/tests/servicestests/apks/install_intent_filters/Android.bp
  services/tests/servicestests/apks/install_uses_sdk/Android.bp
  services/tests/servicestests/test-apps/ConnTestApp/Android.bp
  services/tests/servicestests/test-apps/JobTestApp/Android.bp
  services/tests/servicestests/test-apps/PackageParserApp/Android.bp
  services/tests/servicestests/test-apps/PackageParsingTestManifests/Android.bp
  services/tests/servicestests/test-apps/SimpleServiceTestApp/Android.bp
  services/tests/servicestests/test-apps/SuspendTestApp/Android.bp
  services/tests/shortcutmanagerutils/Android.bp
  services/tests/uiservicestests/Android.bp
  services/tests/wmtests/Android.bp
  services/usage/Android.bp
  services/usb/Android.bp
  services/voiceinteraction/Android.bp
  services/wifi/Android.bp
  startop/apps/test/Android.bp
  startop/iorap/Android.bp
  startop/iorap/functional_tests/Android.bp
  startop/iorap/stress/Android.bp
  startop/iorap/tests/Android.bp
  startop/view_compiler/Android.bp
  startop/view_compiler/dex_builder_test/Android.bp
  test-base/hiddenapi/Android.bp
  test-mock/Android.bp
  test-runner/tests/Android.bp
  tests/AccessibilityEventsLogger/Android.bp
  tests/AccessoryDisplay/common/Android.bp
  tests/AccessoryDisplay/sink/Android.bp
  tests/AccessoryDisplay/source/Android.bp
  tests/ActivityManagerPerfTests/stub-app/Android.bp
  tests/ActivityManagerPerfTests/test-app/Android.bp
  tests/ActivityManagerPerfTests/tests/Android.bp
  tests/ActivityManagerPerfTests/utils/Android.bp
  tests/ActivityTests/Android.bp
  tests/ActivityViewTest/Android.bp
  tests/AmSlam/Android.bp
  tests/ApkVerityTest/Android.bp
  tests/ApkVerityTest/ApkVerityTestApp/Android.bp
  tests/ApkVerityTest/block_device_writer/Android.bp
  tests/AppLaunch/Android.bp
  tests/AppLaunchWear/Android.bp
  tests/AppResourcesLoaders/Android.bp
  tests/AppResourcesLoaders/Overlay/Android.bp
  tests/Assist/Android.bp
  tests/AutoVerify/app1/Android.bp
  tests/AutoVerify/app2/Android.bp
  tests/AutoVerify/app3/Android.bp
  tests/AutoVerify/app4/Android.bp
  tests/BackgroundDexOptServiceIntegrationTests/Android.bp
  tests/BandwidthTests/Android.bp
  tests/BatteryWaster/Android.bp
  tests/BiDiTests/Android.bp
  tests/BlobStoreTestUtils/Android.bp
  tests/BootImageProfileTest/Android.bp
  tests/BrowserPowerTest/Android.bp
  tests/Camera2Tests/SmartCamera/SimpleCamera/jni/Android.bp
  tests/CameraPrewarmTest/Android.bp
  tests/Codegen/Android.bp
  tests/Compatibility/Android.bp
  tests/CoreTests/android/Android.bp
  tests/DataIdleTest/Android.bp
  tests/DozeTest/Android.bp
  tests/DpiTest/Android.bp
  tests/DynamicCodeLoggerIntegrationTests/Android.mk
  tests/FeatureSplit/base/Android.bp
  tests/FeatureSplit/feature1/Android.bp
  tests/FeatureSplit/feature2/Android.bp
  tests/FixVibrateSetting/Android.bp
  tests/FlickerTests/Android.bp
  tests/FlickerTests/test-apps/Android.bp
  tests/FlickerTests/test-apps/flickerapp/Android.bp
  tests/FrameworkPerf/Android.bp
  tests/GamePerformance/Android.bp
  tests/GridLayoutTest/Android.bp
  tests/HierarchyViewerTest/Android.bp
  tests/HugeBackup/Android.bp
  tests/HwAccelerationTest/Android.bp
  tests/Internal/Android.bp
  tests/JankBench/Android.bp
  tests/JobSchedulerPerfTests/Android.bp
  tests/JobSchedulerTestApp/Android.bp
  tests/LargeAssetTest/Android.bp
  tests/LegacyAssistant/Android.bp
  tests/LocalizationTest/Android.bp
  tests/LocationTracker/Android.bp
  tests/LotsOfApps/Android.bp
  tests/LowStorageTest/Android.bp
  tests/ManagedProfileLifecycleStressTest/Android.bp
  tests/ManagedProfileLifecycleStressTest/app/DummyDPC/Android.bp
  tests/MemoryUsage/Android.bp
  tests/MirrorSurfaceTest/Android.bp
  tests/NativeProcessesMemoryTest/Android.bp
  tests/NetworkSecurityConfigTest/Android.bp
  tests/NullHomeTest/Android.bp
  tests/OdmApps/Android.bp
  tests/OdmApps/app/Android.bp
  tests/OdmApps/priv-app/Android.bp
  tests/OneMedia/Android.bp
  tests/PackageWatchdog/Android.bp
  tests/PlatformCompatGating/Android.bp
  tests/PlatformCompatGating/test-rules/Android.bp
  tests/ProtoInputStreamTests/Android.bp
  tests/RemoteDisplayProvider/Android.bp
  tests/RenderThreadTest/Android.bp
  tests/RollbackTest/Android.bp
  tests/SerialChat/Android.bp
  tests/ServiceCrashTest/Android.bp
  tests/SharedLibrary/client/Android.bp
  tests/SharedLibrary/lib/Android.bp
  tests/ShowWhenLockedApp/Android.bp
  tests/SmokeTest/Android.bp
  tests/SmokeTest/tests/Android.bp
  tests/SmokeTestApps/Android.bp
  tests/SoundTriggerTestApp/Android.bp
  tests/Split/Android.bp
  tests/StagedInstallTest/Android.bp
  tests/StatusBar/Android.bp
  tests/SurfaceComposition/Android.bp
  tests/SurfaceControlViewHostTest/Android.bp
  tests/SystemMemoryTest/device/Android.bp
  tests/SystemMemoryTest/host/Android.bp
  tests/SystemUIDemoModeController/Android.bp
  tests/TaskOrganizerTest/Android.bp
  tests/TelephonyCommonTests/Android.bp
  tests/TouchLatency/Android.bp
  tests/TransformTest/Android.bp
  tests/TtsTests/Android.bp
  tests/UiBench/Android.bp
  tests/UsageReportingTest/Android.bp
  tests/UsageStatsPerfTests/Android.bp
  tests/UsageStatsTest/Android.bp
  tests/UsbHostExternalManagmentTest/AoapTestDevice/Android.bp
  tests/UsbHostExternalManagmentTest/AoapTestHost/Android.bp
  tests/UsbHostExternalManagmentTest/UsbHostExternalManagmentTestApp/Android.bp
  tests/UsbManagerTests/Android.bp
  tests/UsbManagerTests/lib/Android.bp
  tests/UsbTests/Android.bp
  tests/UsesFeature2Test/Android.bp
  tests/VectorDrawableTest/Android.bp
  tests/VoiceEnrollment/Android.bp
  tests/VoiceInteraction/Android.bp
  tests/WallpaperTest/Android.bp
  tests/WindowAnimationJank/Android.bp
  tests/WindowInsetsTests/Android.bp
  tests/appwidgets/AppWidgetHostTest/Android.bp
  tests/appwidgets/AppWidgetProviderTest/Android.bp
  tests/backup/Android.mk
  tests/benchmarks/Android.bp
  tests/libs-permissions/Android.bp
  tests/net/Android.bp
  tests/net/common/Android.bp
  tests/net/deflake/Android.bp
  tests/net/integration/Android.bp
  tests/net/jni/Android.bp
  tests/net/smoketest/Android.bp
  tests/notification/Android.bp
  tests/permission/Android.bp
  tests/privapp-permissions/Android.bp
  tests/testables/Android.bp
  tests/testables/tests/Android.bp
  tests/utils/StubIME/Android.bp
  tests/utils/hostutils/Android.bp
  tests/utils/testutils/Android.bp
  tests/vcn/Android.bp
  tools/aapt/Android.bp
  tools/aapt2/Android.bp
  tools/aapt2/integration-tests/AutoVersionTest/Android.bp
  tools/aapt2/integration-tests/BasicTest/Android.bp
  tools/aapt2/integration-tests/MergeOnlyTest/LeafLib/Android.mk
  tools/aapt2/integration-tests/MergeOnlyTest/LocalLib/Android.mk
  tools/aapt2/integration-tests/NamespaceTest/LibOne/Android.mk
  tools/aapt2/integration-tests/NamespaceTest/LibTwo/Android.mk
  tools/aapt2/integration-tests/StaticLibTest/App/Android.bp
  tools/aapt2/integration-tests/StaticLibTest/LibOne/Android.bp
  tools/aapt2/integration-tests/StaticLibTest/LibTwo/Android.bp
  tools/aapt2/integration-tests/SymlinkTest/Android.bp
  tools/bit/Android.bp
  tools/codegen/Android.bp
  tools/dump-coverage/Android.bp
  tools/incident_report/Android.bp
  tools/incident_section_gen/Android.bp
  tools/lock_agent/Android.bp
  tools/locked_region_code_injection/Android.bp
  tools/obbtool/Android.bp
  tools/powermodel/Android.bp
  tools/preload-check/Android.bp
  tools/preload-check/device/Android.bp
  tools/preload/loadclass/Android.bp
  tools/processors/staledataclass/Android.bp
  tools/processors/view_inspector/Android.bp
  tools/protologtool/Android.bp
  tools/sdkparcelables/Android.bp
  tools/split-select/Android.bp
  tools/streaming_proto/Android.bp
  tools/validatekeymaps/Android.bp
  wifi/java/Android.bp
  wifi/tests/Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD to:
  libs/hwui/Android.bp
  native/webview/plat_support/Android.bp
  obex/Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD
    SPDX-license-identifier-CC-BY SPDX-license-identifier-CPL-1.0
    SPDX-license-identifier-GPL SPDX-license-identifier-GPL-2.0
    SPDX-license-identifier-MIT SPDX-license-identifier-Unicode-DFS
    SPDX-license-identifier-W3C legacy_unencumbered
to:
  Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD
    legacy_unencumbered
to:
  core/java/Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-CPL-1.0
to:
  test-base/Android.bp
  test-runner/Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-GPL
to:
  core/res/Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-GPL-2.0
to:
  libs/usb/Android.bp
  libs/usb/tests/accessorytest/Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-MIT
to:
  tools/preload/Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-MIT
    SPDX-license-identifier-Unicode-DFS
to:
  api/Android.bp
  boot/Android.bp
  cmds/device_config/Android.bp
  cmds/settings/Android.bp
  core/api/Android.bp
  core/tests/coretests/certs/Android.bp
  core/tests/overlaytests/remount/test-apps/certs/Android.bp
  core/tests/overlaytests/remount/test-apps/overlaid_apex/Android.bp
  core/tests/overlaytests/remount/test-apps/overlay_apex/Android.bp
  libs/tracingproxy/Android.bp
  services/startop/Android.bp
  test-legacy/Android.mk
  tests/ApkVerityTest/testdata/Android.bp
  tests/TransitionTests/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all

Exempt-From-Owner-Approval: janitorial work
Change-Id: Ib9737d8fb5ef5b90a2c14fe71f1a571079edcf02
Merged-In: Ib9737d8fb5ef5b90a2c14fe71f1a571079edcf02
2021-02-21 20:12:24 +00:00
Artur Satayev
6609105eb5 Enable @TestApi access for instrumentation.
Since introduction of ALLOW_TEST_API_ACCESS, it is now possible to
grant access to test apis for the whole UID, instead of just a starting
process.

This resolves the issue, where a forked test process cannot access @TestApi's.

Bug: 147113465
Test: atest CameraEvictionTest#testBasicCamera2ActivityEviction
Change-Id: I8dd3bbacdb263a3e30539f43d8081f6d78e80155
2021-01-20 18:58:36 +00:00
Jeff Sharkey
0ab7007631 resolve merge conflicts of 358f0d4fc8c248498cf113c41e043877a14e89a1 to master
Bug: 174932174
Test: I solemnly swear I tested this conflict resolution.
Exempt-From-Owner-Approval: refactoring with team leads buy-in
Change-Id: I9262a08ffc1ccede8e519d0eed90ed2bfcf0232c
2020-12-08 11:01:05 -07:00
Jeff Sharkey
52b9862f87 Improve OWNERS coverage across frameworks/base/.
As general background, OWNERS files expedite code reviews by helping
code authors quickly find relevant reviewers, and they also ensure
that stakeholders are involved in code changes in their areas.

Some teams under frameworks/base/ have been using OWNERS files
successfully for many years, and we're ready to expand them to cover
more areas.  Here's the historical coverage statistics for the last
two years of changes before these new OWNERS changes land:

-- 56% of changes are fully covered by OWNERS
-- 17% of changes are partially covered by OWNERS
-- 25% of changes have no OWNERS coverage

Working closely with team leads, we've now identified clear OWNERS on
a per-package basis, and we're using "include" directives whenever
possible to to simplify future maintenance.  With this extensive
effort, we've now improved our coverage as follows:

-- 98% of changes are fully covered by OWNERS
-- 1% of changes are partially covered by OWNERS
-- 1% of changes have no OWNERS coverage

This specific change is automatically generated by a script that
identifies relevant "include" directives.

Bug: 174932174
Test: manual
Exempt-From-Owner-Approval: refactoring with team leads buy-in
Merged-In: I3480ddf2fe7ba3dfb922b459d4da01fa17a2c813
Change-Id: I3480ddf2fe7ba3dfb922b459d4da01fa17a2c813
2020-12-08 08:36:28 -07:00
Oli Lan
26ff5508df Enable instrumentation of system server on debuggable devices.
This makes two changes to enable the instrumentation of system server
and other system processes:

- A new option '--no-restart' has been added to 'am instrument', that
causes the test apk to be loaded without restarting the target app.

- On debuggable devices, the check that the test apk has the same
signature as the target app is not performed.

With these changes, a test apk with instrumentation configured
with targetPackage="android" can run a test from within the system
server process, on debuggable devices. These options may also allow
other system processes to be tested.

See go/internal-api-testing for more information.

Test: atest FrameworksInProcessTests
Change-Id: I8829bcbe7f3373170bcf1e7fa869d5d31f40576d
2020-11-05 16:57:43 +00:00
Nikita Ioffe
ac095e5a1d Start OP_NO_ISOLATED_STORAGE on am instrument --no-isolated-storage
This provides a signal for MediaProvider to whitelist access for full
external storage access.

Here is an overview of how the flow looks like:

1. When app is started within instrumentation with --no-isolated-storage
flag, ActivityManagerService will grant OP_NO_ISOLATED_STORAGE to that
package.
2. MediaProvider will note the OP_NO_ISOLATED_STORAGE app op as fallback
in case app doesn't have MANAGE_EXTERNAL_STORAGE permissions.
3. When instrumentation finishes, ActivityManagerService will change
mode of OP_NO_ISOLATED_STORAGE app op to MODE_ERRORED.

Test: atest ExternalStorageHostTest
Bug: 149894531
Change-Id: I51cd87e5e887b887fd8ac7a1a7ffff208266ffa8
2020-06-11 19:51:54 +01:00
Artur Satayev
fdc9fe8dc0 Swap default for disableTestApiChecks.
There are more runners than those updated in tradefed/testtype/, which donot/cannot push --no-test-api-checks arg to `am instrument`. Instead reverse the default, so that by default `am instrument` disables test api enforcement policy.

Test: atest CtsHiddenApiBlacklistApi27TestCases \
        CtsHiddenApiBlacklistApi28TestCases \
        CtsHiddenApiBlacklistCurrentApiTestCases \
        CtsHiddenApiBlacklistDebugClassTestCases \
        CtsHiddenApiBlacklistTestApiTestCases \
        CtsAppSecurityHostTestCases:android.appsecurity.cts.ExternalStorageHostTest#testMediaEscalation \
        CtsAppSecurityHostTestCases:android.appsecurity.cts.StorageHostTest#testVerify \
        CtsAppSecurityHostTestCases:android.appsecurity.cts.DirectBootHostTest#testDirectBootNative
Exempt-From-Owner-Approval: small fix
Bug: 133832325
Change-Id: Id1870cdd4bb0a51bddede24afd7f87d6e5ec766c
2019-12-04 14:31:07 +00:00
Artur Satayev
e2ebc1be4b Add --no-test-api-acces to am instrument.
By default instrumented processed have access to @TestApis; however for certain CTS tests we want to disable access to test APIs, where this flag would be used.

Test: manual
Bug: 133832325
Change-Id: Id56ce3079bcea2632d4002edcf120d9d5c9e0a26
Merged-In: Id56ce3079bcea2632d4002edcf120d9d5c9e0a26
2019-11-12 12:52:19 +00:00
Colin Cross
37d4c0054d Convert frameworks/base/cmds/* to Android.bp
See build/soong/README.md for more information.

Also converts the rest of frameworks/base/tools/streaming_proto.

Bug: 122332340
Test: m checkbuild
Change-Id: I87c500c5464fb1722b4b518d89065f5e1ee29a97
(cherry picked from commit 45c0d71e774c84ec81392393a0fafad398d2838d)
2019-06-06 09:02:46 -07:00
Joe Onorato
50307d9792 Make am instrument capture logcat during test run, and return it to the host.
Also makes bit print that logcat, if available, instead of just the
stack trace.

This means that when you run a test you don't also have to run logcat in
some other window, and then scroll around forever looking for the one
test in question.

Test: bit -t GtsIncidentManagerTestCases:com.google.android.incident.gts.IncidentManagerTests\#testFail
Test: bit -t GtsIncidentManagerTestCases:com.google.android.incident.gts.IncidentManagerTests\#testDoesntExist
Bug: 129875642
Change-Id: I8940ff379c919482f4a545cb90d25bdbaa2b4f15
2019-05-01 13:02:25 -07:00
Sudheer Shanka
8f99bff2e4 Add instrumentation flag to get access to full exteranl storage.
When starting a process under instrumentation using this new
"--no-isolated-storage" flag, the process would be able to see the
full external storage.

Bug: 117229024
Test: adb shell am instrument --no-isolated-storage \
      -e class android.media.cts.EncodeDecodeTest#testEncodeDecodeVideoFromBufferToBuffer720p \
      -w android.media.cts/android.test.InstrumentationTestRunner
Change-Id: I7973b123cf4fc08e8ce2b05bd4c23fa41b1cdcdf
2018-10-21 16:30:52 -07:00
David Brazdil
d5d4217ece Add flag to AMS.startInstrumentation() to disable hidden API checks
Some tests need to use hidden APIs to check the internal state of
the framework. For those special use cases, we add a new flag to
ActivityManagerService.startInstrumentation that enables to start
instrumented processes without hidden API enforcement. Individual
test harnesses can change their Am command to request the exemption.

Bug: 64382372
Test: adb shell am instrument --no-hidden-api-checks <component>
      adb logcat | grep 'Accessing hidden'
Change-Id: I1d734a95423fae90dae63ff09d5f606495830905
2018-02-14 19:45:11 +00:00
Mike Ma
da3a2955cc Add instrumentation data to host proto lib
Add instrumentation data proto to host proto lib and add a few comment
to am instrument.
Test: no test needed

Change-Id: Ibbb0394dcf0ad27b53d5c97104456798863ce82c
2017-11-13 12:16:22 -08:00
Mike Ma
d2239828d6 Record proto to file in am instrument
Add an option -f to record instrumentdata proto produced by am instrument
to a file in addition to printing to stdout. Default path is
/sdcard/instrument-logs/log-yyyyMMdd-hhmmss-SSS.instrumentation_data_proto.
If the file exits, it will be deleted before writing. Path can be changed
via optional <FILE> argument after -f.
If -f and -m are both present, proto will be written to a file and print
to stdout.

Test: build, flash and run:
bit -bi FrameworksCoreTests
adb shell am instrument -w -r -f tmp/tmp.log \
-e class com.android.internal.os.BatteryStatsNoteTest \
com.android.frameworks.coretests/android.support.test.runner.AndroidJUnitRunner

Change-Id: Iabc320c066d5995eee842c26416623eeb3d403f4
2017-11-01 14:20:31 -07:00
Dianne Hackborn
ca3872ce36 Fully implement "install" and "install-write" in PackageManagerShellCommand.
We can use the new mechanism to ask the calling shell to open
a file in order to implement the rest of these commands, allowing
you to give the path to an apk to install.  That API is thus
extended to allow you to open readable files, not just opening
file for writing.

Doing this however means we no longer can pass a file path to
AssetManager for the apk to parse, we only have an already open
fd for that.  Extending AssetManager to allow adding apks from
fds is not that hard, however, since the underlying zip library
already supports this.

This main thing this changes is in AssetManager.cpp where we
retrieve the open zip file for a particular apk that has been
added.  This used to look up the zip file by path every time
it was needed, but that won't work anymore now that we can have
things added by fd.  Instead, we keep track of each opened zip
in the AssetManager, so we can just directly retrieve it from
the asset_path representing the item that was added.  As a
side-effect, this means for normal paths we no longer need to
look up by name, but just have the opened zip file directly
accessible.  (This is probably good, but it does mean that we
no longer run the logic of seeing if the zip file's timestamp
has changed and re-opening it if it has.  We probably shouldn't
be relying on that for an active AssetManager anyway, and maybe
it is even good that we don't allow the zip file to change
under it?)

A follow-up change will finally remove the Pm.java implementation
and turn the pm "command" into a simple shell script that runs
cmd package.

Test: manual

Change-Id: Ie103e3bdaa5b706796cc329254f2638151a3924f
2017-10-31 10:54:31 -07:00
Chih-hung Hsieh
decc397b26 Merge "Use -Werror in frameworks/base" am: 16fbd3a1d8 am: 0bfb717a37
am: 9f004b1752

Change-Id: I6517ee1689b0247caf830a6c3528bfa9bcf91f75
2017-10-16 19:50:38 +00:00
Chih-Hung Hsieh
c7edf078f9 Use -Werror in frameworks/base
* Fix unused variable and return value warnings.

Bug: 66996870
Test: build with WITH_TIDY=1
Change-Id: I890e65a20848d00559ba5a4f9691be1347b456af
2017-10-13 16:25:16 -07:00
Dan Willemsen
2e9ec5f0de Merge changes I93cf24d4,I32e438ef am: 30798ad13a am: c28d591b36
am: 59225490b8

Change-Id: I6cf57e951900b3df816070feee0d3bf92a6a5a7d
2017-09-10 02:05:05 +00:00
Dan Willemsen
d3eac266b0 Convert host tools to Android.bp
See build/soong/README.md for more information.

Test: m libinstrumentation interrupter accessorychat accessorytest bit obbtool pbkdf2gen libsplit-select_tests split-select protoc-gen-javastream validatekeymaps libaapt_tests aapt
Test: mmma frameworks/base
Test: out/host/linux-x86/nativetest64/libaapt_tests/libaapt_tests
Test: out/host/linux-x86/nativetest64/libsplit-select_tests/libsplit-select_tests
Change-Id: I93cf24d4b232353a52d53be8ed85781b8f4a3877
2017-09-09 06:18:48 +00:00
Makoto Onuki
6fb2c9718c Bit: Don't ignore errors and crashes
Bit used to only see success results and failures (== assertion failures?),
and didn't see "errors" (other exceptions) and test process crashes.

Fixed it.

Now it also returns an error status code if there was a test failure.

Bug 64292779
Test: manual

Change-Id: Iaba93910d32abfc615ae595746a0e9be1108583a
2017-08-02 14:49:30 -07:00
Andrii Kulian
94e82d9b0e DO NOT MERGE ActivityView be gone!
This hidden functionality is no longer support/needed since
we now have multi-window/display. A new view group class
will be added later that uses multi-window to support remaining
functionality of this class.

Test: go/wm-smoke
Change-Id: Ie2fa2de92841d33199da9988741905060dd1ddf4
2017-07-21 13:14:19 -07:00
Makoto Onuki
f6d6e9ecd7 Sort INSTRUMENTATION_STATUS keys on am instrument output
Previously the output from perftests was printed in a random order:
INSTRUMENTATION_STATUS: timeGetDataCapacity_standardDeviation=5
INSTRUMENTATION_STATUS: timeGetDataCapacity_median=486
INSTRUMENTATION_STATUS: timeGetDataCapacity_mean=489
INSTRUMENTATION_STATUS: timeGetDataCapacity_min=484
INSTRUMENTATION_STATUS_CODE: -1

Now it's always printed in the same (sorted) order.
INSTRUMENTATION_STATUS: timeGetDataCapacity_mean=489
INSTRUMENTATION_STATUS: timeGetDataCapacity_median=486
INSTRUMENTATION_STATUS: timeGetDataCapacity_min=484
INSTRUMENTATION_STATUS: timeGetDataCapacity_standardDeviation=5
INSTRUMENTATION_STATUS_CODE: -1

Test: manual test
Change-Id: I807aa05e6523b70a132ab97fc099156bb3dc1f96
2017-06-28 20:23:46 +00:00
Chet Haase
e5b44043f7 Make --no-window-animation flag apply to animators, too
There is a flag for 'adb shell am instrument' that disables animations, which
is useful for testing (if you want to, for example, disable animations to speed
up tests or remove animation-caused side-effects as a factor). But only the
pre-honeycomb animations (window transitions and window animations) were listening
to this flag. This change makes animators listen as well, so all three duration scale
settings are affected.

Bug: 32072407  --no_window_animation ADB arg should set all animation scales to 0.0f
Test: manual. Ran frameworks APCT tests with --no_window_animation and verified
that all three types of animations had their duration scales set to 0 for the
duration of the tests.

Change-Id: I5ae4a60faa714c9534dfae58d1efcd54f577d82b
2017-06-14 18:55:19 -07:00
Sudheer Shanka
dc589ac82b Update usage of ActivityManagerNative.
- Remove references to ActivityManagerProxy.
- Add isSystemReady to ActivityManager.

Bug: 30977067
Test: cts/hostsidetests/services/activityandwindowmanager/util/run-test android.server.cts
      adb shell am instrument -e class com.android.server.am.ActivityManagerTest,com.android.server.am.TaskStackChangedListenerTest \
          -w com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner
Change-Id: I07390b6124fb1515821f5c0b37baf6ae74adc8fa
2016-11-14 11:27:12 -08:00
Dianne Hackborn
2882406de3 Switch am command to go through "cmd activity".
For almost everything...  except instrument, which still needs
to be run as the shell user so its UiAutomator callbacks
will work correctly (and not create security holes).

Test: manual

Change-Id: I2e62714a2d5b52501aa261b7e4d6b282b54a0027
2016-11-01 11:00:41 -07:00
Joe Onorato
f0c719821d am instrument gets protobuf
Refactor the am instrument command and add a version that
outputs protobuf in addition to the old one that prints
loosely formatted text.

Change-Id: I34079d8af2b7b6c6c59837d54719806109ba286c
Test: bit tool
2016-10-20 11:57:57 -07:00
Dianne Hackborn
665378081b Work around issue #32096507: 'am send broadcast' fails the second...
...time it's called from dumpstate

Bring back the shell-side implementation of this, until we can
figure out why the raw shell command transaction is failing.

Test: bugreport works

Change-Id: Ia9422a653feffb0236613d43e022458c101b9583
2016-10-13 14:11:54 -07:00
Dianne Hackborn
331084dca6 Move the remaining am commands to ActivityManagerShellCommand.
The only thing not removed is the "instrument" command, which
really needs to run Java code in the shell.  We'll deal with
that later.

Test: manual
Change-Id: I9df0cdf831ac280cb0eb85c857d27166bc00604d
2016-10-10 16:58:12 -07:00
Dianne Hackborn
354736e196 New infrastructure to switch remaining commands to "cmd" calls.
This introduces a new feature of the IBinder command protocol
to allow the shell command implementation to call back into
its caller to ask it to open files in the calling context.  This
is needed so that commands that have arguments specifying files
can open those files as the calling shell, not the system (or
whatever) process.

To test this all out, move the "am start" implementation over
to ActivityManagerShellCommand, in particular along with its
option to specify a file in which to write profiling data.

Test: Manual

Change-Id: I0c1e3857defefbd19a2ac29413aafbb34b1e48a3
2016-09-29 10:58:44 -07:00
John Reck
d31f3467d9 Add error messages to send-trim-memory
Fixes: 23006305
Test: manual, adb shell am send-trim-memory
Change-Id: Iae5607ea9abf0ffa5b5276a6540afb0dc6aa31f5
2016-09-23 13:00:01 -07:00
Chong Zhang
2fde939272 Fix off-by-one in am start -R (repeat)
bug: 26028552
Change-Id: I075b378b6f126d124d867282d76a78d865b54178
2016-06-28 18:08:13 -07:00
Christopher Tate
27d92e4e39 Move the 'pretend idle jobs can run now' broadcast into AMS
It's a protected broadcast, so sending it directly from 'am' is
no longer an option.  This is needed for CTS as well as being
generally useful during app development.

Bug 28406044

Change-Id: I101915a8c6f19454330a8db2079a75023c112582
2016-05-06 11:25:11 -07:00
Andrii Kulian
435ce5ff1c Allow setting fullscreen stack as target via adb shell
Bug: 27906038
Change-Id: Ie6feede3f7c412bc51550626a008cb0729e5e0e0
2016-04-26 00:00:01 -07:00
Narayan Kamath
a09b4d2a61 Remove unnecessary allocation+unboxing of objects.
Transforming String->int can be done with 0 allocations
using Integer.parseInt.

bug: 28078871
Change-Id: I8d9f322d7154728849dde61ef282046032858d60
2016-04-18 09:55:59 +01:00
Philip P. Moltmann
01ee1b7eb6 Allow to provide only a component name prefix to 'am instrument'
Bug: 27831862
Change-Id: I1d57e416c47fc7d9ea212f0002986932663081b8
2016-04-04 16:37:37 -07:00
Jeff Sharkey
bd91e2f3f6 Update PRE_BOOT_COMPLETED for FBE.
Now that CE data isn't available until after a user is unlocked, we
need to delay the PRE_BOOT_COMPLETED broadcasts.  This is done by
adding a new RUNNING_UNLOCKING user state to the UserController
lifecycle.

We now track the last fingerprint a user was logged in under, and we
dispatch PRE_BOOT receivers when that fingerprint changes.  To work
around battery pull issues, we only persist the updated fingerprint
once all PRE_BOOT receivers have finished.  This is less granular
than the original solution, but it's still correct.  We only consider
a user as "logged in" once it transitions into the RUNNING_UNLOCKED
state.

When starting a process, track if the user was "unlocked" when
started, so that we only spin up unaware providers in processes
started before user unlock.

Add generic IProgressListener to communicate PRE_BOOT progress and
strings up to lock screen.  For now, LockSettingsService just blocks
until finished, but it could display these strings in the future.

Bug: 27220885
Change-Id: I349439776b885acd32f6a578d8951ffd95640be2
2016-03-27 10:56:48 -06:00
Wale Ogunwale
e75a9adfbd Added support to specify animation duration when resizing stack
Needed for sys-ui to control the duration of various Pip transitions.

Bug: 27674339
Change-Id: I7bad27aaa19755a73c594e88b88b56db033e1a45
2016-03-21 11:17:19 -07:00
Jeff Sharkey
d5896630f6 Move more PM calls to ParceledListSlice.
Since the data returned by these calls can grow unbounded based on
various GET flags, we need to switch 'em over.

Bug: 27391893
Change-Id: Ie849ca30dbaaa91158da4c83675657715629a0ee
2016-03-04 16:31:34 -07:00
Nick Kralevich
bb8b4814df Am.java: Use write-only file descriptors
Use write only file descriptors for am commands. Having read-write
file descriptors isn't needed, and not all SELinux app domains have
read access to /data/local/tmp file descriptors.

Addresses the following denial:

  avc: denied { read } for path="/data/local/tmp/foo" dev="dm-2"
  ino=654084 scontext=u:r:system_app:s0
  tcontext=u:object_r:shell_data_file:s0 tclass=file permissive=0

Steps to reproduce:

  adb shell ps | grep settings
  adb shell am dumpheap PID_FROM_ABOVE /data/local/tmp/settings.hat

Expected:
1) command works

Actual:
1) SELinux denial and no settings.hat output.

Bug: 27472701
Change-Id: Id8df0c5a41046b405444e14c70075c986d9936c3
2016-03-03 15:24:29 -08:00
Dianne Hackborn
4a18c26609 Fix issue #27385109: control activity behavior without triggering...
...isUserAMonkey for testing purpose

Add an argument for the caller to specify if they are a poo flinging
monkey.

Change-Id: I0e149a8d78776abaf07517bd4ae886047b7f4252
2016-02-29 12:37:11 -08:00
Wale Ogunwale
06e8ee0c8a Added AM API to remove a stack
Use the new API when closing Pip.

Bug: 26982752
Change-Id: I074d23b5535a4534626183ab77142d3932a803f0
2016-02-16 10:09:51 -08:00
Paul Crowley
faeb3eb0ba Password security for FBE disk encryption keys
Add the means to protect FBE keys with a combination of an auth token
from Gatekeeper, and a hash of the password. Both of these must be
passed to unlock_user_key. Keys are created unprotected, and
change_user_key changes the way they are protected.

Bug: 22950892
Change-Id: Ie13bc6f82059ce941b0e664a5b60355e52b45f30
2016-02-08 15:58:29 +00:00
Tamas Berghammer
25222f55f2 Merge "Add flag to "am start" to enable native debugging" 2016-02-06 13:18:58 +00:00
Filip Gruszczynski
c17d8b79af Infrastructure for animating of maximizing pip activity.
Bug: 25672053
Change-Id: Ie8a83c626680e01ff7115f40731ab9e6c13769c0
2016-02-04 09:01:05 -08:00
Filip Gruszczynski
debd9a5ed5 Allow specifying stack when starting activity in AM command.
Change-Id: I42032bdebf16b6cd2c0c87fd9aa5c261bc9fe25d
2016-02-02 16:27:18 -08:00
Tamas Berghammer
df6cb28293 Add flag to "am start" to enable native debugging
Specifying the new flag will enable several features in the runtime
required by the native debugger to debug Java and C++ code at the same
time.

The enabled features:
* Force JIT (never use the interpreter)
* Debug info generation
* Disbale some optimizations

Change-Id: Iaf5ab649715a0c274bd1b0fc64e483705da53cd0
2016-02-01 13:49:32 +00:00