android-source

Build custom SDK with AOSP changes

随声附和 提交于 2020-01-22 03:07:29
问题 I am trying to build my app (uses many hidden api and properties) in android studio. I have modified the AOSP code to expose these hidden apis. In order to make the build successful I have added the classes.jar as the external lib to my project. But that doesn't resolve the issue. It was still showing errors : error: cannot find symbol method getService() error: cannot find symbol variable userSetLocale error: cannot find symbol method getInstance() error: cannot find symbol variable INJECT

In an AOSP Android.mk file, how do I execute a command and fail the build if the command fails?

梦想的初衷 提交于 2020-01-15 06:53:28
问题 In an Android.mk file, I have the following line which executes a bash script: $(info $(shell ($(LOCAL_PATH)/build.sh))) However, if the command fails the build continues rather than quitting. How do I make the whole build fail in this situation? 回答1: Dump stdout , test the exit status, and error out on failure: ifneq (0,$(shell >/dev/null command doesnotexist ; echo $$?)) $(error "not good") endif Here's what failure looks like: [user@host]$ make /bin/sh: doesnotexist: command not found

Pre-install some apps so they can be uninstalled without root by user

我的未来我决定 提交于 2020-01-14 10:15:51
问题 Can I (As an AOSP builder) pre install some apps so after burning on device, they can easily be uninstalled (like regular downloaded apps)? I am already familiar with system apps and priv-apps but as they lie in system partition they can not be removed! (only disabled in settings menu) P.S. I know huawei for example uses /system/delapp to install such apps. But I seek for a general way or for AMLogic platform specifically which I am working on! 回答1: You can do that by configuring your build

Where is the source code for Android's web browser?

不羁岁月 提交于 2020-01-13 09:07:08
问题 Since Android has such pathetic documentation, I'm looking for the source code for the browser so I can see what objects it provides to JavaScript. Where should I look? Is there an online source code browser? 回答1: It's in the Git repository: https://android.googlesource.com/platform/packages/apps/Browser https://android.googlesource.com/platform/external/webkit/+/android-3.2.4_r1/WebCore/xml/XMLHttpRequest.h Edit: The applications are now mirrored on github. You can find the browser here:

how to use 32bit native libraries on 64 bit Android-L platform

丶灬走出姿态 提交于 2020-01-09 03:19:23
问题 I have a Android application which i compiled with AOSP(Kitkat) as android system application and it was running fine. My application is dependent on native code compiled with Android-NDK as 32 bit libraries. I am copying native libraries inside my android applications libs/armeabi folder and then building my android application in AOSP(I have also modified device.mk to copy my libs in the /system/lib folder). Everything is working fine on Android Kitkat. When i ported my application on

Building AOSP and adding a system app with runtime permission

随声附和 提交于 2020-01-07 08:40:58
问题 I work on Android 6 AOSP. I am able to build add the application as a system app but now I want to add runtime permission by default on this system app. Like that the app can start without asking the user to validate the permission. Do you know how I can do that? Thanks for you help. 回答1: If your app is privileged, all Runtime permissions are granted if requested in manifest. To make your app privileged: in Android.mk LOCAL_CERTIFICATE := platform LOCAL_PRIVILEGED_MODULE := true If this does

Failed to build AOSP [run_soong_ui] Error 1

一世执手 提交于 2020-01-07 05:40:09
问题 I'm trying to compile android version 7.1.2 master branch. I already set up following the instructions from source.android.com. When I run make -j8 I got this error and also an error message from jack-server which I think maybe is related to the build error. The last messages of the verbose output: [ 41% 1715/4084] Ensuring Jack server is installed and started FAILED: setup-jack-server /bin/bash -c "(prebuilts/sdk/tools/jack-admin install-server prebuilts/sdk/tools/jack-launcher.jar prebuilts

How to update system time and time zone?

和自甴很熟 提交于 2020-01-06 07:55:50
问题 I am trying to update the system time and time zone. This is system application. So I gave system application permissions. My code is try { AlarmManager alarmManager = (AlarmManager) getActivity().getSystemService(Context.ALARM_SERVICE); Calendar calendar = Calendar.getInstance(); calendar.setTime(getSelectedDateFormat(mSelectedDateFormat) .parse(mEtDate.getText() +" "+ mEtTime.getText())); alarmManager.setTimeZone(mSpTimeZone.getSelectedItem().toString()); alarmManager.setTime(calendar

AOSP: How to restrict app accessing Camera, Location?

别来无恙 提交于 2020-01-05 12:29:29
问题 I'm trying to restrict apps in Android by modifying source code. I was able to get it working for Internet, but I was not able to restrict apps from using Camera or Location? Internet permission is enforced at linux process level with group-id. But I Camera/Location are not enforced the same way. So I want to know what is the best place to restrict the apps for these permissions. Are checkCallingPermission() enforceCallingPermission() methods the right ones? 回答1: Yes, you're right. In these

Signalling a root C++ executabke from a non-privileged Java Android app

独自空忆成欢 提交于 2020-01-05 06:55:14
问题 I am amending an Android C++ system executable (healthd), which runs as root. I want the amended healthd to be able to receive some form of signal from an unprivileged Android Java app. A few hundred ms of latency is fine, as is polling from healthd, rather than an actual "event". I only need to send an indication that something has happened - there's no requirement to transport data. What's the simplest form of communication I can use? 来源: https://stackoverflow.com/questions/57199825