Skip to content

Instantly share code, notes, and snippets.

Avatar

Christopher Piekarski chris-piekarski

View GitHub Profile
@chris-piekarski
chris-piekarski / system_aosp_libs
Created Aug 4, 2014
Adding system shared lib to AOSP
View system_aosp_libs
See device/sample/frameworks/PlatformLibrary/README.txt
Platform Library Example
~~~~~~~~~~~~~~~~~~~~~~~~
This directory contains a full example of writing your own Android platform
shared library, without changing the Android framework. It also shows how to
write JNI code for incorporating native code into the library, and a client
application that uses the library.
View android-4.1.2_r1_to_8.0.0_r36.rst
ipython
import rglob

android-1.6_r1.4

rglob.lcount("/home/chris/aosp_android-1.6_r1.4/", "*.java")
2687649
rglob.lcount("/home/chris/aosp_android-1.6_r1.4/", "*.cpp")
1994029
@chris-piekarski
chris-piekarski / start_stop_services_via_adb
Last active Jul 30, 2021
android am force-stop and start services
View start_stop_services_via_adb
adb -d shell am force-stop com.android.Settings
adb -d shell am startservice com.android.Settings/com.android.Settings.ServiceName
#list intent receivers
adb shell dumpsys package com.ubnt.restapi | grep intent
adb shell pm list packages
#force factory reset
adb shell "am broadcast -n "com.android.server/com.android.server.MasterClearReceiver" -a android.intent.action.FACTORY_RESET"
View gist:852572c81e195b930f297dc79c3df10f
alias randman='dir="/bin"; man $(ls $dir |sed -n "$(echo $(( $RANDOM % $(ls $dir |wc -l | awk "{ print $1; }" ) + 1 )) )p")'
@chris-piekarski
chris-piekarski / adb_aosp_content
Last active Apr 12, 2021
ADB Content Command
View adb_aosp_content
adb shell content delete --uri content://settings/settings/pointer_speed
adb shell content query --uri content://settings/settings
adb shell content insert --uri content://settings/secure --bind name:s:my_number --bind value:i:24
See "package com.android.commands.content;" in /frameworks/base/cmds/content/
Usese "final class ContentProviderProxy implements IContentProvider" in ContentProviderProxy.java
@chris-piekarski
chris-piekarski / aosp_meminfo_commands
Last active Sep 18, 2020
AOSP Memory/Content Related ADB Commands/Call Logs
View aosp_meminfo_commands
adb shell dumpsys procstats --hours 3
adb shell dumpsys meminfo
adb shell dumpsys activity
#get com.android content providers
adb shell dumpsys | grep Provider{ | grep com.android
#call logs
adb shell content query --uri content://call_log/calls
@chris-piekarski
chris-piekarski / build_opencv_ARM_cross
Created Mar 23, 2020 — forked from hrshovon/build_opencv_ARM_cross
Cross compile opencv3.3.0 for your raspberry pi and similar ARM devices with python support
View build_opencv_ARM_cross
This is a note on how to cross compile opencv for pretty much any ARM device(HardFP supported in this case) and deploy. Native
compiling in ARM devices can be painfully slow and they seem to hang often during build(mine got stuck at 43%). So if you happen
to have a desktop/laptop/server running ubuntu or similar linux distro, u can build opencv in fractionth of the time taken for
native compiling without any issues.
Building opencv3 with TBB and NEON and VFP support can boost opencv performance. Thanks to Adrian at pyimagesearch for pointing
that out.
Both my PC and target machine aka orange pi zero are running ubuntu 16.04 with python2.7 and python 3.5.
Let us use the term "build machine" for your PC where you are building opencv and "target machine" for the ARM single board computer.
1.Run the following commands in both machines(I think installing these in target machine only would do) to install the necessary libraries etc.(mine worked with them,so they should be enough
@chris-piekarski
chris-piekarski / repo_forall_path_example
Last active May 28, 2019
List remote project and local paths using Android repo script.
View repo_forall_path_example
repo forall -c 'echo $REPO_PROJECT $REPO_PATH'
platform/abi/cpp abi/cpp
platform/bionic bionic
device/fsl/bootloader/uboot bootable/bootloader/uboot-imx
platform/bootable/recovery bootable/recovery
platform/build build
platform/cts cts
platform/dalvik dalvik
@chris-piekarski
chris-piekarski / git_pull_sub_repos
Last active May 28, 2019
Git Pull Multiple Subdirectory Repos
View git_pull_sub_repos
find . -maxdepth 1 -type d \( ! -name . \) -exec bash -c "cd '{}' && git pull" \;
@chris-piekarski
chris-piekarski / pre_commit_reject_wildcard_imports
Created Feb 27, 2019
Git pre-commit hook to check for wildcard imports
View pre_commit_reject_wildcard_imports
#!/bin/sh
#
# cp to .git/hooks
# chomd +x .git/hooks/pre_commit
#
# This hook checks for wildcard imports (other than kotlinx) when added to staging.
# TODO: add ktlint check
RED='\033[0;31m'
GREEN='\033[0;32m'