yashsingh1/xdaforums huggingface dataset:
[Galaxy S II Original Android Development] D4rKn3sSyS:
Afaik system apps signed with firmware keys, cant write on external storage, and as you can see on Manifest from packages/apps/Settings,

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android.settings"
coreApp="true"
android:sharedUserId="android.uid.system">

<original-package android:name="com.android.settings" />

sharedUserId is system. If you're not trying to write something, then it should work.
[Galaxy S II Original Android Development] isimobile:
Thanks,

I need to write to disk so I will have to look at it more. Just I am still learning stuff so trying to figure it out.

I just have another question, then why does the exact same code work on my Galaxy Tablet. If as you say if it does not allow it to write to disk then why will it work on the tablet, it should not correct. I am probably just missing something...
[Galaxy S II Original Android Development] arashi:
About sensors

Hi. Noticed, that cm3663 light sensor with latest builds on clean install shows inadequate measurements. Instead of 0-3000 lux in programs like "sensor list" or CM backlight advansed settings i see numbers 100-1000-10000 with only three this steps...

With that light sensor readings precision advanced backlight levels settings is unusable.

p.s.: flashing siyah kernel 3.2rc1 didn't solved this problem

upd.

using method from http://stackoverflow.com/questions/8545686/light-sensor-code-returning-limited-range-of-values

wrote

#cat "/sys/devices/virtual/lightsensor/switch_cmd/lightsensor_file_state"

in terminal emulator

and got semifair values. From 0 in dark room to 155 with dusk light, 440 with ambient light and 18620 on faced to sun.

Seems that it is not driver problem
[Galaxy S II Original Android Development] Entropy512:
You should probably follow the thread more - this is a known issue. Unfortunately, fixing this requires moving to a fully opensource hardware HAL, and that breaks compass (and gyro too I think).

So it's a choice of semi-broken (this behavior) or totally broken compass/gyro
[Galaxy S II Original Android Development] daef:
I've just drawn an graph over your rocking raw data:

(did only apply some horizontal scale to roughly match the same timeframe)

sourcemonk dot com/on/rockin_graph.jpg

after the knowledge gained from that graph I've picked my data out of the middle (avoiding the peaks at the beginning, the fall at the end, ...) to get data only for the rocking movement. after scaling the data ( normalized value ) it's quite obvious in the direct comparison:

sourcemonk dot com/on/rockin_graph_scaled.jpg

since samsung only grabs values on a much longer timeframe they average out (or they do it on their own, and only expose every n'th calculated value)

so the most straightforward way would be a lowpass-filter (there are not many variables to tinker with to archieve the same data)

i won't give a lecture on how to implement one since there's quite a lot code around exatly on that issue (low-pass filter on (sensor) data)

a quite elegant implementation can be found here:

blog dot thomnichols dot org/2011/08/smoothing-sensor-data-with-a-low-pass-filter

as already mentioned: the only variable in this filter that effects its behaviour is "ALPHA"

so i think the next steps would be fetching the libsensors source (or whereever one wants to implement the filter, but AFAIR libsensors was the last thingie to be in the chain, and the end of the chain seems like the most straightforward way to do it (following my patented "try to cripple your data as late as possible - you might someday be happy about raw-data access"-principle))

aaaand (f*ck that's a long sentence) implement a low-pass filter which can be configured, tinker with the variables until the result is acceptable, hardcode that values as defaultvalues (still always keep a possibility to configure/overwrite the values by the end-user) and push a patch into the libsensors-repo

tl;dr

* use low-pass filter on the open-source variant

* ???

* profit
[Galaxy S II Original Android Development] Aetos7:
In want to report this bug that it is important for me.. in settings of mms.apk/extra setting/display sent time it dont work, i see already the received time!

Someone can help me?
[Galaxy S II Original Android Development] espenfjo:
I am not sure a lowpass filter is enough for this (altough I have really no idea).

The distortion is so great that the compass needle spins around it self just by pitching the device a couple of degrees.

Noise should not do that :/

Altough compass is based on accel + magneto.

AccZ*MagX - AccX*MagZ;

And then some other math and magic inlcuding sqaures and balls :)

Magic, and I dont really see how noise could influence it that bad.
[Galaxy S II Original Android Development] D4rKn3sSyS:
You're trying to write files on SDcard right?. Im not sure why it works on Galaxy Tablet, are you sure it is also a system-signed application (as settings)?. The same piece of code, running on another non-system app application, may work, but if you have system signatures, it wont work. For other side, you could use Runtime, for running root commands, and writing files from system signed apps. Look here for more info

Look at here this fixes it
[Galaxy S II Original Android Development] arashi:
Thanks! Very useful info! Trying to find someone who rewrite oss hal cuz autobrightnes was always be a weak part of cyanogen for devices a had(:
[Galaxy S II Original Android Development] Aetos7:
That doesn'tt fix the problem
[Galaxy S II Original Android Development] Phistachio:
And you are one of the noobs of XDA-developers.
[Galaxy S II Original Android Development] trell959:
I agree! :D
[Galaxy S II Original Android Development] Mixy:
I'm probably way off here, but going for it nevertheless:

These data are a product of two other datasets? accell and magneto?

Maybe if you could isolate the sets on their own, one would prove to be the one causing the problem, and instead of having to look for errors in two codes, you could just check one? :)
[Galaxy S II Original Android Development] espenfjo:
That is what we have been trying to do, looking at Magetometers X values.

(I hoped that I have not overlooked any faults in the Accelerometer).
[Galaxy S II Original Android Development] daef:
simply try something like this

and play around with the "damp"-var (between 0f and 1f)...

might do unimaginable wonders ;-)
[Galaxy S II Original Android Development] Doopliss:
I've uploaded a patch to CyanogenMod/android_frameworks_base (here). Is there anyone in particular I should add as a reviewer?

I'm using it in conjuction with this guide to remap the menu button to the app switcher, and I have long-press on home as a backup to open the menu for non ICS-optimised apps. I really like having the instant access to recent apps, the old way feel sluggish in comparison.
[Galaxy S II Original Android Development] peterperfect:
Steve Kondik

Ricardo Cerqueira

Markus Guidry
[Galaxy S II Original Android Development] rodries:
Fix setPreferredNetworkType

Everytime setPreferredNetworkType is executed with data on I get and error in logcat so I've tryed to fix it.

I'm not sure if this is the best solution, I'm not an expert on android code, I only analyze the problem and found a solution, but probably an expert can improve it.

The bug is in Smdk4210RIL.java

Because I don't know how to make a propper diff I've uploaded the java file.

Please review it.

I'm trying to send the patch using gerrit instructions but I'm having problems. Anyway I'll try to upload the patch as soon as possible. Downloading repo again.

This patch will fix the problem with toggle 2G/3G buttons in AOKP roms

Edit:

Ok, finally I've uploaded the patch to CyanogenMod/android_frameworks_base: patch

Sorry for tabulations and extra spaces, I have to reconfigure my text editor.

Edit2: I've improved the previous patch: patch2 , logs removed
[Galaxy S II Original Android Development] Doopliss:
I've made a device setting that can bind the recent app switcher to the menu button, but by default it doesn't have permission to write to the relevant file (/system/usr/keylayout/sec_touchkey.kl -rw-r--r-- root root). Can anyone say what the default permissions or ownership of the file should be changed to, and how I'd go about setting that up in the source code?

Edit: Now submitted for review on Gerrit - http://review.cyanogenmod.com/16049
[Galaxy S II Original Android Development] Entropy512:
Hmm, that's a useful idea. GPS Status does show the raw magnetometer data. It would be interesting if there are any significant differences in raw data between the two HALs.

This is, of course, the disadvantage of a triple-axis magnetometer:

A single-axis magnetometer can give you compass on its own, BUT it can't be tilted.

A triple-axis magnetometer can give you heading in any physical orientation, BUT it needs orientation to be properly known in order to work

Some useful reference data on tilt compensation:

http://www.google.com/url?sa=t&rct=...ieDUAg&usg=AFQjCNGN57cEF3D_zKjAB7wcxBIFcpxuMw

http://diydrones.com/profiles/blogs/tiltcompensated-heading - Interesting, it says that Honeywell's reference tilt compensation code (which is the basis for many tutorials on tilt compensation) is wrong

http://hackaday.com/2011/10/25/tilt-compensation-when-reading-a-digital-compass/
[Galaxy S II Original Android Development] sociojeje:
I'm a noob developer. However, I am willing to spend my time in order to fix this bug since it literally bugs me. Though I'm a noob developer, I have been playing with linux on my desktop and familiar with those lines...

I can confirm that desk dock audio output is not working while car dock audio output is working. Since car dock mode directs you to steering wheel notification while deskdock directs you to clock, I assume that cm9 recognizes them as different docks.

Which file is related to car dock and desk dock? I'm trying to let cm9 recognize a desk dock as a car dock for a temporary solution. If anyone could bring me to the starting point, such as files and lines, I'll really appreciate it.
[Galaxy S II Original Android Development] espenfjo:
Do this commit merged this night fix it?

http://review.cyanogenmod.com/#/c/15540/
[Galaxy S II Original Android Development] sociojeje:
first of all, i'm on the latest nightly. I saw it's onbootcompleted event. I tried to reboot my phone with different settings. No it doesn't work. mine is samsung desktop dock with model number ECR-D1D3BE. Docking sound and docking clock work well. Sounds output works very well with LP9 based roms with this device. I confirmed that sound output works on car docks. Hopefully I can solve this issue just faking my deskdock as a cardock. I'm checking some lines but expert devs' helps are much appreciated.

edited : just read comments between Emilio López and StevenHarperUK	and realized that it is not an easy work. I'm glad that now i know that this has been a recognized issue. while expert devs are working on it, hopefully i can find a temporary solution for samsung deskdock users. I won't be complaining any more whatsoever. Thanks.
[Galaxy S II Original Android Development] Entropy512:
Well, if our current dock audio setup were clean and stable code, it would be easy. It's as simple as:

/sys/class/switch/dock/state

is 1 for desk dock and 2 for car docks. We handle 2 but not 1. Fixing this would be easy except that due to the constant "break exchange" (fixing one device breaks others) it'll get likely stuck in gerrit review for eternity. But maybe we can get it in as a short-term fix until the dock audio subsystem is reworked a bit.

Nope, that fixes dock audio routing on other devices but breaks us (see my comment, and that was not merged this night, it was almost two weeks ago but recently had comments in the past day or two from myself and Steven). I talked with the guy on IRC last night.

Properly fixing this PROPERLY is gonna be a pain.

I think what needs to be done is to implement something like this for Samsung docks: https://github.com/cyanogenmod/android_packages_apps_DockAudio/ (The guy who wrote that is who I talked to last night) - That package will hopefully be properly renamed to be Motorola-specific when it gets forward-ported to CM9.

Other devices have the ability to separately report whether an audio cable is plugged into a dock from the ability to report that a dock is connected - they use /sys/class/switch/usb_audio/state for that. But in our case, we ONLY have the dock file because there's no way for the device to detect an audio cable connection to the dock. So they're able to sanely auto-route audio only when a cable is plugged in.

In our case, a user has to decide whether to route audio when a dock is connected. On official Samsung firmwares, this is not done by the system - it's actually done by the Samsung Car Home alternate launcher with intents - see http://xdaforums.com/showthread.php?t=980937

I think the proper solution is:

Rip out most of our Samsung hacks

Put most of the Samsung-specific logic in a separate APK similar to the Motorola dock audio package linked above

Set up that APK to handle the dock audio control intents

Set up Settings to somehow also generate those intents for users who don't have Samsung Car Home or a similar car home launcher

Unfortunately much of this is Java which makes me want to self-facestab, there's a reason I'm a kernel guy. :)
[Galaxy S II Original Android Development] Doopliss:
I updated my patch that gives the option of putting the app switcher on the menu key (http://review.cyanogenmod.com/16049). It now features no more foolishness of trying to write to a file in /system, and actually works like it's supposed to!

If anyone wants to try it out you can PM me for a test build.
[Galaxy S II Original Android Development] isimobile:
Original Question

RE: Help needed in understanding why I cannot get access to getExternalCacheDir() on the SGS2 in cm9, in Settings and in DeviceSettings when calling getExternalCacheDir(). It always returns null.

Today I decided to move my code that I need to test to DeviceSettings which is locate in device/samsung/galaxas2/DeviceSettings. I added permission to write to external in AndroidManifest.xml and I added the code to getExternalCacheDir() like below.

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

private Uri getLockscreenExternalUri() {
if (isSDMounted()) {
File dir = getActivity().getApplicationContext().getExternalCacheDir();
if (dir == null) { // ?????
Log.w(TAG, "No external directory accessible, using main storage");
dir = getActivity().getCacheDir();
if (!dir.mkdirs()) {
Log.w(TAG, "Unable to create temp file, WTF!");
return null;
}
}
File wallpaper = new File(dir, WALLPAPER_NAME);
return Uri.fromFile(wallpaper);
} else
return null;
}

When I just call this code above dir is null, why is it always returning null :o.

This exact code is working fine on my Tablet.

What I have seen is that my permission on my phone for folder /sdcard/data/Android is different . On my Tab it is root user and on my Phone it is system. So in that I believe that it is a permission issue.

What I am trying todo is implement a different wallpaper for the lock screen than you normal wallpaper.
[Galaxy S II Original Android Development] StevenHarperUK:
Hi Sociojeje,

I have put a patch together to deal with the DeskDock plug event .

I don't own a Desk dock so its untested.

Are you able to build with this patch - or would you like me to upload my build somewhere?

I have test it with Car Dock - and it still works as expected.

The patch is at

http://review.cyanogenmod.com/#/c/16221/

I wont be marking it as merge-able until tested and confirmed.
[Galaxy S II Original Android Development] sociojeje:
I don't have my linux computer with me right now. I would take a few more days to get it. In the meantime, if possible, could you please make it as flashable zip file for the sake of testing? If it takes too much time from you, please ignore. I'm trying to install linux on my old netbook so that i can use this as temporary developing computer as an alternative for now. Hopefully I can confirm it asap. So far, it looks good but we will never know without actual testing.
[Galaxy S II Original Android Development] StevenHarperUK:
No worries.

The Build is available at http://www.mediafire.com/file/72joz1j3xnvxxi3/update-cm-9.0.0-RC0-galaxys2-UNOFFICIAL-signed.zip

b811ba462cde2245acb5138431bf8752 update-cm-9.0.0-RC0-galaxys2-UNOFFICIAL-signed.zip

Please send me a logcat of a plug event - and also if it works or not.

ta
[Galaxy S II Original Android Development] sociojeje:
In short, it works. However, there should be something to be corrected a bit. Checking usb output mutes docking sound regardless of checking the option. Once disable usb output, docking sounds works again. I can confirm that it works.

I'll post the logcat tomorrow. I got blamed enough at 5:20 am.

Thanks for your work. I am truly impressed.
[Galaxy S II Original Android Development] StevenHarperUK:
Great - the docking sound needs a delay - the problem is that it hits during the switch so depending on how that thread is getting processed it either:

Plays via the speaker,

Gets cut off

Plays via the dock output.

I have seen this - so I am treating it as an existing bug.

However I will push the OK to go button in CM9 and raise a new change to address the hot plug noise bug.

Steven

P.s. I also get hit by the early morning - still coding bug - some of my commits are 4-5am.
[Galaxy S II Original Android Development] D4rKn3sSyS:
Hi guys, I'm having problems with Apollo music player. Today I repo sync'd, and It got added to build environment. Compilation goes all fine, but when I open it, it just crashes, something about missing resources (Also file size is much lesser than the seeingpixels one). The weird thing is that the one compiled from seeingpixels works just fine, no crashes at all. I will try to get the files directly from author's git and report back.

EDIT:

Didn't actually work, this is my logcat

http://pastebin.com/v7z7m2kt

Seems like it's missing resources. Im clueless about this, anyone else having this issue?
[Galaxy S II Original Android Development] Paradoxxx:
Hi guys, I'm having this problem while compiling AOKP, as some users accros i777 forums too...

build/core/product_config.mk:193: *** _nic.PRODUCTS.[[device/samsung/galaxys2/full_galaxys2.mk]]: "hardware/samsung/exynos4/Android.mk" does not exist. Arrêt.

Anyway workaround? I tried in a dirty way, it goes a lil bit further, then stops.

and my manifest does point to CyanogenMod/android_hardware_samsung so I'm pretty clueless.
[Galaxy S II Original Android Development] thracemerin:
AOKP isn't CM9, wrong place to ask this question, try asking in an AOKP thread.
[Galaxy S II Original Android Development] codeworkx:
Like the error msg says. It doesn't exist anymore. Look at your sources and the latest cm patches.
[Galaxy S II Original Android Development] SeanHacker:
same problem. going to figure it out though and i'll fill you in when i do. ;)
[Galaxy S II Original Android Development] StevenHarperUK:
It just got merged - so the next nightly should now support Samsung deskdocks.
[Galaxy S II Original Android Development] D4rKn3sSyS:
About this issue, forget it, seems like some drawables were missing, for fixing it just cherry pick this

http://review.cyanogenmod.com/#/c/16326/

Or wait till it get's merged.

Cheers,

D4.
[Galaxy S II Original Android Development] codeworkx:
Seems to be a really hard issue.

http://review.cyanogenmod.com/#/c/16215/

-.-
[Galaxy S II Original Android Development] trinode:
Hey,

Has anyone experienced regular disconnects on older parrot bluetooth kit using CM9? (doesn't occur using Samsung ROM).

The problem occurs only when using CM9, along with these kits, If i switch to a Samsung ROM, all is fine, if I use a different bluetooth device, all is fine.

I'm happy to run / whatever is required to diagnose the problem, ADB and such is all set up on my laptop (I write apps), just don't know where to start debugging the OS itself though.

- Anthony
[Galaxy S II Original Android Development] cdesai:
Shouldn't have posted it here, but now that you have, post the build id / date, status of the ROM (any mods / custom kernels etc.), and a logcat
[Galaxy S II Original Android Development] julianjm:
I'll try to make a patch to be able to toggle the requirement of a more secure lockscreen when using the keystore or vpn.

The reason is that just installing cacert CA forces you to PIN or pattern lockscreen, which I don't like.

The setting would be in build.prop or local.prop.

What do you think about it? Does it have any chance of being merged?

Julian.
[Galaxy S II Original Android Development] codeworkx:
sounds like a security break. -1
[Galaxy S II Original Android Development] julianjm:
Well, if I have physical access to a device, it doesn't mind the lockscreen the user has. I could just flash a custom rom with no enforced security.

Also, if the user has root (which you can toggle from the ROM settings itself, isn't that a security issue?), there is nothing stopping him from taking full control of the device.

What I mean is... the device will work as usual unless you create a key in build.prop or local.prop. And not having this option don't increase security at all... it's just a little inconvenience for the potential cracker.

Julian.

Edit: Here it is, http://review.cyanogenmod.com/#/c/16584/
[Galaxy S II Original Android Development] ivkos:
Can you please review this change:

http://review.cyanogenmod.com/#/c/14094/

I'm sure that Bulgarian CM9 users would be happy to have a spell checking dictionary for the Bulgarian keyboard.
[Galaxy S II Original Android Development] rajaspidey:
need option to use 3G only mode!! music player crashes sometimes
[Galaxy S II Original Android Development] thracemerin:
Wrong thread, try here: http://xdaforums.com/showthread.php?t=1419102

This thread is for dev issues, requests for features aren't being taken, bug reports aren't being taken, especially not in this thread.
[Galaxy S II Original Android Development] Tungstwenty:
Reboot if CRT-On while on Youtube app?

I've struggled a while to make CRT-On effect available on stock Samsung ROMs and now that it's working, we notice that if the screen is turned off while watching a youtube video, when switching back on the CRT-On effect will hang and make the phone reboot after a while.

I've seen previous references for the need to have sources or headers for the "hwcomposer.exynos4.so" library, among others, and since the stack trace for the error comes from there I'm wondering whether you are noticing the same issue.

Can anyone please let me know if you face(d) the same issue and if it eventually has been solved?

My stack trace shows:

05-30 14:04:00.210 1826 1826 I DEBUG : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00000084
05-30 14:04:00.210 1826 1826 I DEBUG : r0 00000048 r1 00000001 r2 00000001 r3 00000001
05-30 14:04:00.210 1826 1826 I DEBUG : r4 000426f0 r5 000426f0 r6 00000001 r7 fffffff8
05-30 14:04:00.210 1826 1826 I DEBUG : r8 000269b0 r9 00000003 10 00043c68 fp 00000004
05-30 14:04:00.210 1826 1826 I DEBUG : ip 400a40c4 sp 40efcb88 lr 00000000 pc 41184d94 cpsr 60000030
...
05-30 14:04:00.345 1826 1826 I DEBUG : #00 pc 00003d94 /system/lib/hw/hwcomposer.exynos4.so
05-30 14:04:00.345 1826 1826 I DEBUG : #01 pc 00019ad2 /system/lib/libsurfaceflinger.so (_ZNK7android10HWComposer6commitEv)
05-30 14:04:00.345 1826 1826 I DEBUG : #02 pc 00018e18 /system/lib/libsurfaceflinger.so (_ZNK7android15DisplayHardware4flipERKNS_6RegionE)
05-30 14:04:00.345 1826 1826 I DEBUG : #03 pc 000200ec /system/lib/libsurfaceflinger.so (_ZN7android14SurfaceFlinger33electronBeamOnAnimat ionImplLockedEv)

which corresponds to:

electronBeamOnAnimationImplLocked() -> hw.flip(screenBounds) -> HWComposer::commit() -> hwc_composer_device_t->set() -> BANG on the Samsung code

PS: sorry for double post, but I posted this initially in the user thread and it's probably more suited for development discussion.
[Galaxy S II Original Android Development] kalpik:
Codeworkxx: Regarding wifi driver and lockscreen: http://xdaforums.com/showpost.php?p=26795767&postcount=9753