android-source

Simulating power button press to display switch off dialog box

我是研究僧i 提交于 2019-12-17 15:28:57
问题 I am trying to invoke the switch off dialog box that appears when we press power button. But i want to accomplish this task from an android application or a Junit test case. I will choose the most feasible approach in this case. I have been trying to do this but was not able to succeed. I am trying to use the following five approaches: First approach: long eventTime = SystemClock.uptimeMillis(); boolean dispateched = launcherButtonWInst.dispatchKeyEvent(new KeyEvent(eventTime, eventTime,

How do I add APKs in an AOSP build?

半世苍凉 提交于 2019-12-17 08:09:10
问题 I need to add some 3rd party APKs to my AOSP build. What folder should I keep these APKs so that when I build the code and the image is created, it is installed in the emulator? It looks like the system apps are kept in the packages/app folder so I need to know where the third party APKs are kept. 回答1: Adding third party APKs to the build is definitely possible. Also APKs and APPs with source code go to the same place; the package/app folder. Adding a new APK to the build In the AOSP root add

What is the difference between system apps and privileged apps on Android?

为君一笑 提交于 2019-12-17 07:00:23
问题 So in 4.3 there was a concept of System applications. APKs that were placed in /system/app were given system privileges. As of 4.4, there is a new concept of "privileged app". Privileged apps are stored in /system/priv-app directory and seem to be treated differently. If you look in the AOSP Source code, under PackageManagerService , you will see new methods such as static boolean locationIsPrivileged(File path) { try { final String privilegedAppDir = new File(Environment.getRootDirectory(),

How do I build the Android SDK with hidden and internal APIs available?

岁酱吖の 提交于 2019-12-17 02:17:22
问题 I want to rebuild the Android SDK (or rather only the android.jar) to include hidden and internal APIs. I could not find any documentation or discussion doing on how to go about this. I have an Ubuntu CyanogenMod build environment already setup that is able to build cm7. Now, I read that make SDK will build the SDK but I want to build an SDK that includes methods and fields that are marked as hidden using @hide. Is this possible? What I want to do is make changes to an application that uses

How does AOSP 9.0 build system link the executable?

旧巷老猫 提交于 2019-12-14 03:12:48
问题 With AOSP 9.0.0_r30 source code, first use these commands to output a detailed build log during build: make clean make showcommands -j8 > ~/BuildAndroid.txt Then search in ~/BuildAndroid.txt for "lld" (whole word match). I can't find anything. Clang linker should have the lld keyword.Search "ld" there are 50 results but they are hardly be the link commands.One of them is "ld.mc" which is a candidate,though. And search for some cpp source file name like "TextDropShadowCache". I only get 2

What are the purpose of the bare git repositories in .repo/projects/ created by the Android repo script?

做~自己de王妃 提交于 2019-12-13 11:38:49
问题 The Android source is managed by repo. When syncing using repo, a directory called .repo/projects/ is created, which contains all the git repositories also checked out directly in the current working directory, just in bare git format. For what purpose does repo maintain the bare git repositories? And how are these bare repositories used by repo? (NB: Clarification: I am not talking about a git repository when I write "repo", I am talking specifically about the script called repo created by

How Can I Import android.util.Log from InetAddress.java (or any file in libcore/luni/src/main/java/java/net)? [Not a]

倖福魔咒の 提交于 2019-12-13 08:29:26
问题 I cannot directly use either of the following statements import android.util.Log; or import android.os.Environment; from InetAddress.java in libcore/luni/src/main/java/java/net, nor can I use any file which depends on it. A member of a group that I am working with has created a class which depends on android.os.Environment and has used it successfully in other places in AOSP such as packages/apps/PackageInstaller/src/com/android/packageinstaller/PackageInstallerActivity.java I'm not 100%

Downloading Android 5.1 Source

◇◆丶佛笑我妖孽 提交于 2019-12-13 07:56:45
问题 I'm using Ubuntu 14.04 and i just followed each and every step in this link. After installing jdk, Git, creating working directory, i want to download Android 5.1 latest revision of source . $ repo init -u https://android.googlesource.com/platform/manifest -b what is the correct command to download 5.1. Can you tell me how much size of the source code is? 回答1: The instructions say do this repo init -u https://android.googlesource.com/platform/manifest -b android-4.0.1_r1 But use the following

How can fix the error in Android Studio? AOSP image error 0x500

我是研究僧i 提交于 2019-12-13 04:35:01
问题 I have created successfully a virtual device to test system images of smartphones. In the Android Studio, I get an error message in the event log. 16:51 PM Emulator: /mnt/tmpfs/src/android/emu-master-dev/external/qemu/android/android-emugl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp:glBindBuffer:433 error 0x500 I have tried to change graphic settings without success. Have anyone advice how to fix this issue? Kind regards Georg 回答1: Create/Edit the emulator with following properties Emulated

Start native service at early-init before coldboot done

强颜欢笑 提交于 2019-12-13 03:11:14
问题 Boot sequence in Android is defined via system/core/rootdir/init.rc and other *.rc files. Such approach allows to bind any action to any boot stage ( early-init , init , etc). Also in system/core/init/init.cpp is defined the following sequence of the boot: - ... ; - early-init ; - wait_for_coldboot_done ; - ... ; - init ; - ... . It means that some action inside imported *.rc file binded to the early-init stage can be started before coldboot (and SELinux initialization) will be finished by