Hi!
How can I set the backlight brightness on my Kaiser using mortscript?
I tried the SetBacklight(10, 10) command and also the commands
RegWriteDword ("HKCU", "ControlPanel\Backlight", "Brightness", 10)
RegWriteDword ("HKCU", "ControlPanel\Backlight", "ACBrightness", 10)
If I check in ControlPanel, only the slider that is not in use is changed.
So if I am on Battery power, only the slider for AC power is changed and vice versa.
I need to set the backlight to full (10) and half (5) when my bt headset connects.
Thanks a lot!!
This is the script:
RunCheck = 0
Application = "\Windows\AudioManager.exe"
WindowName = "Audio Manager"
While (1)
HandsFreeState = RegRead("HKLM", "System\State\Hardware", "Handsfree")
If (HandsFreeState = 1 && RunCheck = 0)
ToggleDisplay(1)
Run (Application)
#RegWriteDword ("HKCU", "ControlPanel\Backlight", "Brightness", 10)
#RegWriteDword ("HKCU", "ControlPanel\Backlight", "ACBrightness", 10)
SetBacklight(10,10)
SetVolume(255)
RunCheck = 1
EndIf
If (HandsFreeState = 0 && RunCheck = 1)
If (wndExists (WindowName))
Close(WindowName)
EndIf
#RegWriteDword ("HKCU", "ControlPanel\Backlight", "Brightness", 5)
#RegWriteDword ("HKCU", "ControlPanel\Backlight", "ACBrightness", 5)
SetBacklight(5,5)
SetVolume(150)
ToggleDisplay(0)
Vibrate(50)
RunCheck = 0
EndIf
Sleep (1000)
EndWhile
You cant do it using mortscript, on Kaiser and newer HTC devices.
HTC has changed the standard way to manage the backlight. It was done (in older devices) changing the registry and signaling a Windows Event. Now you must invoke some hidden functions of HTCUtil.dll. Unfortunatelly they are undocumented and Its not easy althought the name of the calls are clear. I am watching it right now to let CommMgrPro manage backlight on kaiser. If you unassamble backlight.exe you will see how Its done. But not easy....
Dani
When I got this problem on my PDA (Gsmart I) I found that there are another registry keys for backlight setting I found them on HKLM>SOFTWARE>GigabyeCM>LCDBacklight.
after changing this value with mortscript I run
SetBacklight(10,10)
command then my back light changed.
I wish this comment helps you.
Thanks!
Thanks for your replies!
Too bad mortscript can't manage backlight on the kaiser.
I use the kaiser in my car a lot and am looking for a way to control the backlight by time of day. So its dimmed at night and full brightness at daytime.
Best would be via a program and command line parameter so I can integrate it into my script,
which launches/exits the audio manager when my car bluetooth stereo/handsfree is connected.
Unfortunately I am no developer and don't know how to write a program like this.
There is an application called PhoneAlarm that will do exactly what you are trying to do. I use it for this purpose on my Cingular 8525 (HTC Tytn).
Sets MANY parameters on the phone by profile and/or time of day. There are lots of skins to minimize or maximize the screen footprint...
Hope that helps.
LightningDammitt said:
There is an application called PhoneAlarm that will do exactly what you are trying to do. I use it for this purpose on my Cingular 8525 (HTC Tytn).
Sets MANY parameters on the phone by profile and/or time of day. There are lots of skins to minimize or maximize the screen footprint...
Hope that helps.
Click to expand...
Click to collapse
Yes, with Tynt. CommMgrPro and many other programs does it too. The problem is HTC Kaiser (Tilt). HTC uses a new system. Classic ways used by many program doesnt work in kaiser
LightningDammitt said:
There is an application called PhoneAlarm that will do exactly what you are trying to do. I use it for this purpose on my Cingular 8525 (HTC Tytn).
Sets MANY parameters on the phone by profile and/or time of day. There are lots of skins to minimize or maximize the screen footprint...
Hope that helps.
Click to expand...
Click to collapse
Thank you for pointing out PhoneAlarm. I have been using PhoneAlarm for a couple of years now and like it very much. But I try to avoid it by doing what I need with Mortscript, because PhoneAlarm really slows down my Kaiser and has some issues with adjusting volume and sometimes switches power of phone when it should switch wifi.
After I spent some time disassembling backlight.exe, I found some usefull information here:
jianwu.spaces.live.com/blog/cns!C80015801668BB53!233.entry?ccr=9532#comment
It saved me a lot of time, as the program I was writing started working fine in minutes.
The problem with the backllight control seems to be common for newer HTC models - mine is Polaris with WM65X from pacrvalho.
make backlight control programm
Hello everybody!
Who can write a programm using the following
Code:
for .NET users (C#, can easily be translated on VB.NET), here are the calling functions :
[DllImport("HTCUtil.dll")]
private static extern int HTCUtilGetOnPowerBrightnessLevel(ref int pValue);
[DllImport("HTCUtil.dll")]
private static extern int HTCUtilGetOnBatteryBrightnessLevel(ref int pValue);
[DllImport("HTCUtil.dll")]
private static extern int HTCUtilSetOnPowerBrightnessLevel(ref int pValue);
[DllImport("HTCUtil.dll")]
private static extern int HTCUtilSetOnBatteryBrightnessLevel(ref int pValue);
[DllImport("HTCUtil.dll")]
private static extern int HTCUtilGetBacklightMinBrightness(ref int pValue);
[DllImport("HTCUtil.dll")]
private static extern int HTCUtilGetBacklightMaxBrightness(ref int pValue);
In program I need the next parameters:
-g (Set somewhere in registry the value of current brighteness level. For example:
HKCU\Software\MyBrightness\OnPower=80,
HKCU\Software\MyBrightness\OnBattery=20)
-p Value (Set OnPower brightness level and set in registry
HKCU\Software\MyBrightness\OnPower=Value)
-b Value (Set OnBattery brightness level and set in registry
HKCU\Software\MyBrightness\OnBattery =Value)
-pr (Set OnPower and OnBattery brightness level in previos state if it's possible)
Thank you beforehand.
Mods - you can delete this thread as it turns out it is NOT a general issue, but a ROM issue. Thanks!
For some reason, my notifications have started silencing. Ringtones still work - but SMS, Email, etc don't. This effect seems to go away after reboot.
I am a pretty experienced Android user, and have checked volume and sound to make sure they are set right - which they are.
Using Cyanogen 5.0.4.1, but have not had this problem before so I'm thinking it is an app issue.
I don't want to start uninstalling apps willy-nilly...anyone else having this issue?
This is my logcat when a message is received:
Code:
W/Service ( 236): setForeground: ignoring old API call on com.wsandroid.Core.BaseService
W/Service ( 236): setForeground: ignoring old API call on com.wsandroid.Core.BaseService
V/Telephony( 292): getOrCreateThreadId uri: content://mms-sms/threadID?recipient=%2B19793184040
V/Telephony( 292): getOrCreateThreadId cursor cnt: 1
I/power ( 92): *** set_screen_state 0
D/Sensors ( 92): using /dev/input/event6 (name=compass)
D/Sensors ( 92): using /dev/input/event3 (name=proximity)
D/Sensors ( 92): using /dev/input/event0 (name=lightsensor-level)
D/lights ( 92): 0 255 255
D/SurfaceFlinger( 92): About to give-up screen, flinger = 0x14c150
D/AK8973 ( 80): Compass CLOSE
Are you using a dock? If so it's happening to me too. If I reboot and don't use the dock it stops. There was some talk about it in the CM thread as a known issue.
uberingram said:
Are you using a dock? If so it's happening to me too. If I reboot and don't use the dock it stops. There was some talk about it in the CM thread as a known issue.
Click to expand...
Click to collapse
Indeed! Thanks for the pointer.
Mods - you can delete this thread as it turns out it is NOT a general issue, but a ROM issue. Thanks!
Since I saw some people wants tablet UI on mirroring or lapdock,
I made a file for Atrix's CM9 based on this thread.
http://forum.xda-developers.com/showthread.php?t=1467051
I didn't post a screenshot cause you can see it at link.
Every UI will change to that of tablet, and every app will act as tablet.
So here's the steps you have to do.
http://api2.ge.tt/0/81rFJED/0/blob/download
1. Download services.jar and overwrite it to /system/framework.
(Of course, need 644 permission.
If you are not sure, see other file's permission in folder.)
(This file is based on alpha 7)
2. Open /system/build.prop
3. Find the line 'ro.build.characteristics=default'
and change the 'default' to 'tablet'
4. Set the screen density to 120 by changing
'ro.sf.lcd_density=240' to 'ro.sf.lcd_density=120'
5. Save and reboot.
6. You will get tablet UI
So, If you want to get back,
just change your density to 240 and it will revert to phone UI.
We need reboot between UI change now,
but maybe devs can do some mod after CM9 have all feature
Awesome but, it doesn't look very good on the lap dock - there is something wrong with the resolution. Im sure it will be fixed.
Additionally if the phone could switch the UI from Phone to Tablet when HDMI is connected it would be an awesome way to ditch the awful Webtop.
+1 Thanks to you man!!
was trying to do this by editing the services.jar, this is WONDERFUL.
if possible can you tell me how to do a PM? (where changing the file classes), baksmali, simali need not only change which line ...
soluttion calls
folks, you should now be aware that the "app called" force close, I've tried the app (phone) several roms without success .. == force close when calling ==
ps: but the calls continue in the background!
some options:
1 - ShakeCall (has other apps)
2 - accessibility options = end call button poweer
This is cool!
I tried it, its like having a small tablet....
Just a pitty about the phone UI, its not actually usuable like that!
Whatching for development
I see great potential in this.
If we could autoscript something, where if the phone recognises that it's been connected via HDMI (for mirroring), then it automatically changes into tablet UI. That'll be so freakin awesome! And it'll be a good webtop replacement for CM9!
Notorious544d said:
I see great potential in this.
If we could autoscript something, where if the phone recognises that it's been connected via HDMI (for mirroring), then it automatically changes into tablet UI. That'll be so freakin awesome! And it'll be a good webtop replacement for CM9!
Click to expand...
Click to collapse
Thats what I've been saying...
Notorious544d said:
I see great potential in this.
If we could autoscript something, where if the phone recognises that it's been connected via HDMI (for mirroring), then it automatically changes into tablet UI. That'll be so freakin awesome! And it'll be a good webtop replacement for CM9!
Click to expand...
Click to collapse
+1
I thought somebody was already working on this.
Sent from my MB860 using xda premium
try
is usable but ...
set large fonts ...
do not set the lcd_density so small, it can be adjusted, try 140 .... (I think)
I find it very usable ... hopefully someone with enough knowledge to resolve calls ...
D/AudioMgrRIL( 1321): setting volume, volume = 6
I/AudioService( 1469): AudioFocus requestAudioFocus() from AudioFocus_For_Phone_Ring_And_Calls
D/lights ( 1469): RGB: "attention", color=0x00000000, flash=2, onMs/offMs=0/0 => blink=0, RGB=0 0 0
D/CallNotifier( 2693): showIncomingCall()... phone state = OFFHOOK
D/dalvikvm( 2693): GC_CONCURRENT freed 358K, 27% free 6530K/8839K, paused 2ms+2ms
D/lights ( 1469): LCD: SENSOR, 88 * 1.00 => 88
D/lights ( 1469): LCD: SENSOR, 82 * 1.00 => 82
D/lights ( 1469): LCD: SENSOR, 75 * 1.00 => 75
D/lights ( 1469): LCD: SENSOR, 69 * 1.00 => 69
D/dalvikvm( 2693): GC_CONCURRENT freed 422K, 27% free 6653K/9031K, paused 1ms+2ms
D/lights ( 1469): LCD: SENSOR, 63 * 1.00 => 63
D/lights ( 1469): LCD: SENSOR, 56 * 1.00 => 56
I/ ( 1400): odm_disp_esd_thread is running(200) state=1
D/lights ( 1469): RGB: "attention", color=0x00ffffff, flash=2, onMs/offMs=7/1000 => blink=1, RGB=255 255
255
D/lights ( 1469): LCD: SENSOR, 50 * 1.00 => 50
D/lights ( 1469): RGB: "attention", color=0x00000000, flash=2, onMs/offMs=0/0 => blink=0, RGB=0 0 0
D/lights ( 1469): LCD: SENSOR, 44 * 1.00 => 44
D/lights ( 1469): LCD: SENSOR, 37 * 1.00 => 37
D/lights ( 1469): RGB: "attention", color=0x00000000, flash=0, onMs/offMs=0/0 => blink=0, RGB=0 0 0
I/CustomSpnReader( 2693): operatorNumberic = 72402
I/CustomSpnReader( 2693): oriSpnName = TIM
I/CustomSpnReader( 2693): Current language is : pt
E/CustomSpnReader( 2693): Config File Path : /system/etc/spn-conf.xml
D/lights ( 1469): LCD: SENSOR, 31 * 1.00 => 31
D/lights ( 1469): LCD: SENSOR, 25 * 1.00 => 25
I/CustomSpnReader( 2693): expression : /spnOverrides/spnOverride[@numeric='72402']
W/ActivityThread( 2693): ClassLoader.getResources: The class loader returned by Thread.getContextClassLoa
der() may fail for processes that host multiple applications. You should explicitly specify a context cla
ss loader. For example: Thread.setContextClassLoader(getClass().getClassLoader());
D/lights ( 1469): LCD: SENSOR, 18 * 1.00 => 18
E/CustomSpnReader( 2693): Not Found : 72402 in spn-conf.xml
D/lights ( 1469): LCD: SENSOR, 12 * 1.00 => 12
D/ComprehensiveCountryDetector( 1469): onServiceStateChanged
D/lights ( 1469): LCD: SENSOR, 6 * 1.00 => 6
D/lights ( 1469): LCD: SENSOR, 0 * 1.00 => 0
I/power ( 1469): *** set_screen_state 0
D/lights ( 1469): buttons: USER, 0
D/SurfaceFlinger( 1318): About to give-up screen, flinger = 0xf918
D/ ( 1400): NVRM_DAEMON(1137): pm_notifier_thread: calling power_displays(false)
I/ ( 1400): DispMgr recv'd NvDispMgrDisplayAttr_Suspend
I/ ( 1400): called NvDispMgrAttrSetTranslate() from attr_common err=0
I/ ( 1400): DispMgr recv'd NvDispMgrDisplayAttr_Suspend
I/ ( 1400): called NvDispMgrAttrSetTranslate() from attr_common err=0
D/ ( 1400): NvDdkDispBacklightTimeout() thread running
I/ ( 1400): enter motDsiSetMode
I/ ( 1400): exit motDsiSetMode
I/ ( 1400):
I/ ( 1400): enter motDsiSetPowerLevel
I/ ( 1400): enter motDsiSuspend
I/nvrm_daemon( 1394): NVRM_DAEMON(1137): pm_notifier_thread: calling power_displays(false)
E/AudioHardwareMot( 1321): Error:Unsupported key = tty_mode=tty_off
D/dalvikvm( 2693): GC_CONCURRENT freed 425K, 27% free 6718K/9095K, paused 3ms+2ms
I/ ( 1400): exit motDsiSuspend
I/ ( 1400):
I/ ( 1400): exit motDsiSetPowerLevel
I/ ( 1400):
D/ ( 1400): NVRM_DAEMON(1140): pm_notifier_thread: returned from power_displays(false)
I/nvrm_daemon( 1394): NVRM_DAEMON(1140): pm_notifier_thread: returned from power_displays(false)
E/AudioHardwareMot( 1321): Error:Unsupported key = screen_state=off
E/DefaultVoicemailNotifier( 2419): No voicemails to notify about: clear the notification.
D/AccelerometerListener( 2693): orientation: horizontal
D/MccTable( 2693): updateMccMncConfiguration: mcc=724, mnc=2
D/MccTable( 2693): locale set to null_br
D/MccTable( 2693): WIFI_COUNTRY_CODE set to br
I/WifiService( 1469): WifiService trying to set country code to br with persist set to true
D/dalvikvm( 1469): GC_EXPLICIT freed 558K, 31% free 9601K/13767K, paused 4ms+5ms
D/dalvikvm( 2693): GC_CONCURRENT freed 421K, 26% free 6839K/9223K, paused 2ms+3ms
D/Tethering( 1469): MasterInitialState.processMessage what=3
D/PicasaSyncManager( 2253): active network: null
D/PicasaSyncManager( 2253): background data: true
I/MediaUploader( 2232): No need to wake up
Click to expand...
Click to collapse
seems an error of speakers, and also a file in system/etc/spn-conf.xml
WOW
I would love to have this ability. I am not a huge fan of the webtop as is, and if there was a method to use this UI through the HDMI connection (especially through a lapdock) I could see some cool things happening.
Only thing that stopped me from using this is that I can't use the phone
Sent from my MB860 using XDA App
The phone capability would be awesome to have, and I wouldn't doubt that the extremely talented DEV people could find a way to make that work, but no phone isn't a deal breaker for me.
I tried to get awareness of this in the CM9 thread of jokersax, but there is more important talk going on over there at the moment. Hopefully someone will pick up this project further, and make it available to those who want it (and hopefully add in the missing functionalities).
The UI experience I think would clean up the overall install of things on the phone, get rid of the webtop and/or separate OS installation, and provide one OS that will be used for both the phone and a docking experience.
We'll see though .
I can start working on this, this weekend, I've been busy working on a small version of vector Linux that runs through vnc on the lap dock.
Sent from my MB860 using XDA App
Use buildroot or OpenEmbedded to keep it light as possible, plus you can optimize the compiler flags for tegra
Sent from my MB860 using XDA App
OK, hadn't thought of build root, the only thing I'm having a little trouble is getting it to mount the 32 gb SD card, even after partitioning it for vector. Sometimes it'll mount. Some times mope
Sent from my MB860 using XDA App
Mount loop img, I preffer it over reformating the SD card
Also check out Linux for Tegra from nVidia
Sent from my MB860 using XDA App
Will do, thanks
Sent from my MB860 using XDA App
I don't sure if it's possible, but can we run vnc server on android and connect from Chroot/vnc environment. Sort of vnc in vnc. If it's possible we can use it instead aiw application.
Sent from my MB860 using XDA App
I can try that when I get home, but I don't think it'll work.
Sent from my MB860 using XDA App
Heck Yeah
I started up the talk again! haha
Thanks guys for talking/looking into getting this to work. Hopefully bumping this post will get people to check into this more, and be guinea pigs for the testing.
Unfortunately, my schedule and how I use my phone doesn't allow me the time to easily help out with testing things, and I apologize about that ahead of time.
Keep up the good work, and please keep us informed!
Also, I'm not sure if the thread creator would get upset with you working on his stuff (and publishing it for testing, or whatever) without proper consent. Just wanted to throw that out there, just in case. I don't want to see the progress on things to be thwarted due to something as trivial as getting a "verbal" OK to work on making something better.
Thanks for the time all!