Related
Hi,
I have a problem running a Direct3D app on full screen on a HTC Diamond: no matter which way I create the Direct3D device, by making a window that covers the full screen, or by creating a fullscreen device, all I see is the background of the window. Nothing rendered in Direct3D is shown.
If I use a window that is, for example, one pixel shorter than the full screen - everything works fine, but "real" full screen doesn't.
The Direct3D examples from the WM6 SDK, which also create a full screen window, fail exactly the same way both on my phone and on another Diamond I've tested, so I assume it's not a problem with my configuration or ROM, but a common one. Also I've found a few similar questions on other forums, mentioning phones like the Touch Pro, but no answers.
To create a fullscreen window I do the following:
g_screenWidth = GetSystemMetrics(SM_CXSCREEN);
g_screenHeight = GetSystemMetrics(SM_CYSCREEN);
g_hWndMain = CreateWindow(szWindowClass, szTitle, WS_VISIBLE,
0, 0, g_screenWidth, g_screenHeight, NULL, NULL, hInstance, NULL);
SHFullScreen(g_hWndMain, SHFS_HIDETASKBAR | SHFS_HIDESIPBUTTON);
/* ... */
D3DMPRESENT_PARAMETERS presentParameters;
memset(&presentParameters, 0, sizeof presentParameters);
presentParameters.SwapEffect = D3DMSWAPEFFECT_DISCARD;
presentParameters.Windowed = true;
HRESULT hr = g_d3d->CreateDevice(D3DMADAPTER_DEFAULT, D3DMDEVTYPE_DEFAULT, g_hWndMain, NULL,
&presentParameters, &g_dev);
All the functions succeed, however, nothing gets drawn on the screen besides the background of the window.
The same thing happens when I create a fullscreen device, like below:
// The same window creation stuff...
// ....
presentParameters.BackBufferWidth = g_screenWidth;
presentParameters.BackBufferHeight = g_screenHeight;
presentParameters.BackBufferFormat = D3DMFMT_UNKNOWN;
presentParameters.BackBufferCount = 1;
presentParameters.SwapEffect = D3DMSWAPEFFECT_DISCARD;
presentParameters.Windowed = false;
presentParameters.FullScreen_PresentationInterval = D3DMPRESENT_INTERVAL_DEFAULT;
HRESULT hr = g_d3d->CreateDevice(D3DMADAPTER_DEFAULT, D3DMDEVTYPE_DEFAULT, g_hWndMain, NULL,
&presentParameters, &g_dev);
Again, all the calls seem to succeed, but nothing is visible on the screen. I've tried setting the pixel format explicitly - still nothing is drawn.
But if I change the window in the first example to be one pixel less than the size of the screen, everything is displayed correctly.
Does anyone know why this is happening and whether some solutions for running the app full-screen are possible? As far as I understand, VSync is available only in fullscreen mode, so I'd like to get it working - although one missing line of pixels isn't really visible on the Diamond screen.
And yet another unrelated question: does the graphics chip in the Diamond support render-to-texture? It seems to be not available in Direct3D, but it might still be exposed in OpenGL ES in that case...
Just recently noticed that my calendar music notifications aren't triggering, the alert shows but the tone i selected doesn't play
anyone?
I've logged a call with HTC as I''m still running stock ROM but thought someone here would have a few ideas..
mtrax said:
anyone?
I've logged a call with HTC as I''m still running stock ROM but thought someone here would have a few ideas..
Click to expand...
Click to collapse
I created a test event can copied the system log
Can any one compare with a working phone.
D/AlertReceiver( 323): beginStartingService
D/AlertService( 323): allDay:false instanceBegin=1282114948000 minutes=5 alarmTime=1282114648000
D/BT HS/HF( 146): gsmAsuToSignal=19
D/dalvikvm( 323): GC freed 7567 objects / 442728 bytes in 107ms
D/AlertService( 323): >>>>>>> makeNewAlertNotification <<<<<<<
D/AlertService( 323): >>>>>>> eventId:296 <<<<<<<
D/AlertService( 323): >>>>>>> title:Hello <<<<<<<
I/AlertService( 323): get calendarId:5
I/AlertService( 323): Type:0 Vibrate:true Ringtone:content://media/internal/audio/media/23 <<< New Setting
D/NotificationFlashLightUtility getIncomingCall( 323): load success~~~~~~~~~~
V/AlertService( 323): changeNotificationSound: false
V/AlertService( 323): notification.sound != null: null
V/AlertService( 323): reminderType: 0
I/ActivityManager( 80): Starting activity: Intent { flg=0x10000000 cmp=com.htc.calendar/.AlertActivity }
Click to expand...
Click to collapse
Hi there pal!
I've got the same problem, my notifications don't show up in a notification bar ... any reminding whatsoever ...
I'm running stock rom as well ... if you figure out more I'd be glad for more info.
The think is, I'm just new to the android platform, so I can't really think of anything
latorante said:
Hi there pal!
I've got the same problem, my notifications don't show up in a notification bar ... any reminding whatsoever ...
I'm running stock rom as well ... if you figure out more I'd be glad for more info.
The think is, I'm just new to the android platform, so I can't really think of anything
Click to expand...
Click to collapse
yours might be a different problem as I see the notifications but it doesn't play the ringtone.
I extracted the syslog using the following App ( http://www.appbrain.com/app/org.jtb.alogcat) you might try using this immediately after you expect your calendar alarm.. to see what message show..
Tell you what, I've done some research on my Legend and it seems, that all calendrs work except the facebook one - the birthday notifications. And thats the one I was interested in...
I'll try the program you posted ...
cheers
Can someone run a quick test for me please?
Set a ringtone on a Calender alert
1. Open the Calendar application.
2. Press Menu then More then Settings.
3. Tap on Reminder settings.
4. Make sure that there is a tick mark on “All calendars.”
5. Tap on Set alerts & notifications and select Alert.
6. Tap on Select ringtone and tap the ring tone that you prefer.
Then set a calender event and when it triggers the ringtone should play.
If could send me the snippet of the system log so I can compare with mine,
thanks
I got a working one:
/AudioHardwareMSM72XX( 57): AUDIO_START: start kernel pcm_out driver.
D/AlertReceiver(12956): beginStartingService
D/AlertService(12956): allDay:false instanceBegin=1282455968000 minutes=5 alarmTime=1282455668000
D/AlertService(12956): >>>>>>> makeNewAlertNotification <<<<<<<
D/AlertService(12956): >>>>>>> eventId:721 <<<<<<<
D/AlertService(12956): >>>>>>> title:Test <<<<<<<
I/AlertService(12956): get calendarId:1
I/AlertService(12956): Type:0 Vibrate:true Ringtone:content://media/internal/audio/media/49 <<< New Setting
D/NotificationFlashLightUtility getIncomingCall(12956): load fail~~~~~~~~~~
V/AlertService(12956): changeNotificationSound: false
V/AlertService(12956): notification.sound != null: content://media/internal/audio/media/49
V/AlertService(12956): reminderType: 0
I/ActivityManager( 79): Starting activity: Intent { flg=0x10000000 cmp=com.htc.calendar/.AlertActivity }
D/MediaPlayer( 79): setDataSource(291, 0, 576460752303423487) pid = 79
D/PVPlayer( 57): setDataSource(31, 0, 11183)
I/AlertActivity(12956): mCursor.count: 1
I/PlayerDriver( 57): OpenCore enable firewall payload
I/ ( 57): OpenCore codec name PVMFOMXAudioDecNode , OMX.PV.mp3dec
W/MediaPlayer( 79): info/warning (1, 44)
I/AudioPolicyService( 57): startOutput(): before lock
W/NotificationService( 79): Notification sound delayed by 1211msecs
I/ActivityManager( 79): Displayed activity com.htc.calendar/.AlertActivity: 1401 ms (total 1401 ms)
I/AudioPolicyService( 57): stopOutput(): before lock
D/BT HS/HF_S( 153): gsmAsuToSignal=5
Click to expand...
Click to collapse
my log seems to vary slightly yours has:
V/AlertService(12956): notification.sound != null: content://media/internal/audio/media/49
where as mine has:
V/AlertService( 323): notification.sound != null: null
Hi,
I have a problem of draining battery with SL4A.
First, what i do :
I use Tasker to run SL4A script during night. I repeat script all 10 min. The script give back phone orientation to tasker. if phone don't move during 30min, i put phone in airplane mode and stop to repeat script all 10 min. I do this action only if screen is off, so phone in sleep mode.
The battery draining don't come from tasker, i test it without run SL4A script, no problem. I sure it's because of SL4A.
So with this script, i get battery drain during all night, and battery drain stop when alarm ring on morning (so when phone awake, it's important, remind this)
My script is this one :
Code:
import android, time
droid = android.Android()
class Task():
SET_VARIABLE = 547
def new_task(self):
self.action_cnt = 0
self.extras = {'version_number': '1.0', 'task_name': 'task' + str(time.time()), 'task_priority': 10 }
def set_var(self, varname, value):
self.action_cnt += 1
self.extras['action' + str(self.action_cnt)] = {'action': self.SET_VARIABLE, 'arg:1': varname, 'arg:2': value, 'arg:3': False, 'arg:4': False, 'arg:5': False}
def run_task(self):
taskIntent = droid.makeIntent('net.dinglisch.android.tasker.ACTION_TASK', None, None, self.extras).result
droid.sendBroadcastIntent(taskIntent)
def set_var_now(self, varname, value):
self.new_task()
self.set_var(varname, value)
self.run_task()
temps = 20
droid.startSensingTimed(1,500)
while temps > 0:
time.sleep(0.5)
x, y, z = droid.sensorsReadOrientation().result
temps = temps - 1
if x is not None:
break
droid.stopSensing()
t = Task()
t.new_task()
if x is not None:
t.set_var("%ORIENTATION_X", str(x))
t.set_var("%ORIENTATION_Y", str(y))
t.set_var("%ORIENTATION_Z", str(z))
t.set_var("%ORIENTATION", "Done")
t.run_task()
What i do in this script :
I read orientation (max 20 time in case of none result) and i send information to tasker.
I d'ont think i do error in this script.
So i think SL4A don't allow phone to back to sleep mode after finished is script.
Because i find a solution, turn on screen during one second after running script (i do this in tasker) and now, i don't have battery drain.
But this solution is not clean.
Any help to solve this problem ?
thanks a lot
I''m still kinda new to java coding but I really think you need to reffer to:
PARTIAL_WAKE_LOCK
like this:
Code:
PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
PowerManager.WakeLock wl = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "My Tag");
//WAIT here
wl.acquire();
// action here
wl.release();
full reference:
http://developer.android.com/reference/android/os/PowerManager.html
releases the wake lock after the process is finished. I hope that that info is correct, as im note sure.
Have you tried running your script on the emulator to make sure it's exiting properly?
I'm a bit worried about while code (python or not).
Sent from my HTC One X using xda premium
My code work properly, no error in console. Code is in Python (i'm not specialist but if i understand well, the "wend" is do by indentation)
And if code have error, turn on screen 1s after script will don't have any effect, i thinks.
About power management: after read, it's can be this problem. May be if do my own wake lock, SL4A will do one automatically (and forgot to close it)
I will try.
I don't arrive to get powerManager function :crying:
i try to add
Code:
pm = droid.powerManager()
pm.goToSleep(droid.sytemClock.uptimeMillis())
but no way goToSleep function is unknow.
Some help for syntax, i don't find any example. Thanks
i do like this
Code:
import android, time
droid = android.Android()
droid.wakeLockAcquirePartial()
class Task():
SET_VARIABLE = 547
def new_task(self):
self.action_cnt = 0
self.extras = {'version_number': '1.0', 'task_name': 'task' + str(time.time()), 'task_priority': 10 }
def set_var(self, varname, value):
self.action_cnt += 1
self.extras['action' + str(self.action_cnt)] = {'action': self.SET_VARIABLE, 'arg:1': varname, 'arg:2': value, 'arg:3': False, 'arg:4': False, 'arg:5': False}
def run_task(self):
taskIntent = droid.makeIntent('net.dinglisch.android.tasker.ACTION_TASK', None, None, self.extras).result
droid.sendBroadcastIntent(taskIntent)
def set_var_now(self, varname, value):
self.new_task()
self.set_var(varname, value)
self.run_task()
temps = 20
droid.startSensingTimed(1,500)
while temps > 0:
time.sleep(0.5)
x, y, z = droid.sensorsReadOrientation().result
temps = temps - 1
if x is not None:
break
droid.stopSensing()
t = Task()
t.new_task()
if x is not None:
t.set_var("%ORIENTATION_X", str(x))
t.set_var("%ORIENTATION_Y", str(y))
t.set_var("%ORIENTATION_Z", str(z))
t.set_var("%ORIENTATION", "Done")
t.run_task()
droid.wakeLockRelease()
But i still have problem. No effect to use wakeLock
hi,
I want to divide my smartphone display into two parts (left/right) . On the left Side i will display a normal 2d Video in a videoview and on the right side i will display an exact copy of the currently running Video from the left.
All approaches that I tried failed.
approach1:
Two VideoViews: one Videoview on the right and one Videoview on the left side.The left Side played normally and the right Side synchronized with mvideoviewright.seekto (mvideoviewleft.getCurrentPo position ()) to the left.
exact synchronization is not possible because in my opinion mvideoviewright.seekto (...) is not working properly.
second problem: you can hear 2 audios from the 2 videofiles
approach2:
copy the left VideoView to a bitmap -> and put the bitmap in an ImageView (right side)
This fails because it is not possible to copy VideoView (SurfaceView) to a Bitmap
Do you have other ideas of how to implement such a thing with sdk ?
MFG
Markus
markusschulze said:
hi,
I want to divide my smartphone display into two parts (left/right) . On the left Side i will display a normal 2d Video in a videoview and on the right side i will display an exact copy of the currently running Video from the left.
All approaches that I tried failed.
approach1:
Two VideoViews: one Videoview on the right and one Videoview on the left side.The left Side played normally and the right Side synchronized with mvideoviewright.seekto (mvideoviewleft.getCurrentPo position ()) to the left.
exact synchronization is not possible because in my opinion mvideoviewright.seekto (...) is not working properly.
second problem: you can hear 2 audios from the 2 videofiles
approach2:
copy the left VideoView to a bitmap -> and put the bitmap in an ImageView (right side)
This fails because it is not possible to copy VideoView (SurfaceView) to a Bitmap
Do you have other ideas of how to implement such a thing with sdk ?
MFG
Markus
Click to expand...
Click to collapse
You will not be able to get them playing exactly synchronized. However, you could mute the audio of one of the views.
Your second approach is too slow, but it would work in theory. You could get it as a bitmap if you draw it to a Canvas using the draw method and then save this as a bitmap. Performance will be very bad!
I have been trying to work up a tile for my Quick Tiles app that would allow a user to toggle the glowlight from the panel. With the help of @marcoNST (I do not own an NSTG) I have isolated the Glowlight Control dialog but my intention was to have that as an option for a long-press of the tile, while a simple tap would toggle the light without any intensity adjustment.
This toggle is normally handled by a 2-second press of the "n" button. I've been scouring logcats and tracking down smali files in jars but the closest I've come up with is a broadcast which is probably used, among other things, to tell the status bar manager that the light icon needs to be shown/hidden--so it's an after-the-fact thing:
Code:
com.BN.intent.action.SCREEN_LIGHTS_ON (or OFF)
I've exhausted my bag of tricks
Attached is a logcat showing the "n" button used to repeatedly toggle the light. There is a PowerManagerService statement each time, but I distrust this because I see that statement a lot in logcats, even for my NST sans glowlight. In fact, that statement often appears in triples!
So...quite the challenge
I'd appreciate hints or outright solutions. Any takers?
Code:
int i = 128; [b]// 0 (off) to 255 (full on)[/b]
ContentResolver cr = context.getContentResolver();
System.putInt(cr, System.SCREEN_BRIGHTNESS_MODE, System.SCREEN_BRIGHTNESS_MODE_MANUAL);
System.putInt(cr, System.SCREEN_BRIGHTNESS, i);
This is standard Android "screen brightness".
Renate NST said:
Code:
int i = 128; [b]// 0 (off) to 255 (full on)[/b]
ContentResolver cr = context.getContentResolver();
System.putInt(cr, System.SCREEN_BRIGHTNESS_MODE, System.SCREEN_BRIGHTNESS_MODE_MANUAL);
System.putInt(cr, System.SCREEN_BRIGHTNESS, i);
This is standard Android "screen brightness".
Click to expand...
Click to collapse
I thought/hoped as much when I ran across a kvetching post about the NGP and the need for a menu to turn on the light. So the complainer wrote a little app which just toggled the "screen brightness" to 0 for OFF and some arbitrary value he liked for ON.
It seemed wonderfully simple but when I did the same thing and shared the app with an NSTG user, it did absolutely nothing
Edit: I looked at this again and maybe made some progress. Although I have only a non-Glow NST, I did figure out how to call up the light control dialog, so I can do some tentative fiddling. If I use that dialog to turn the non-existent light ON and then change the screen brightness to zero, my tick mark for ON disappears and the slider control moves all the way to the left. That looks promising. One issue was that I saw a warning this time that autobrightness was ON (who knew?) and I had better turn it OFF. So I did that. Unfortunately when I start with the non-existent light in the OFF position, changing the screen brightness to a non-zero value does not place a tick mark in the light control panel showing the light as on. The slider advances, but...
Well, it's hard to test non-existent hardware, so I guess it's time to put together another toggle app and let my co-conspirator with the NSTG test it.
Edit: Nope. Changing the screen brightness to 0 or some other arbitrary value has no effect on the glowlight for the NSTG. Back to square zero.
nmyshkin said:
Back to square zero.
Click to expand...
Click to collapse
I've never had a NSTG, so I can't say.
I use an in-app brightness control in my reader app and it's exactly like the code above.
It works on every device that I have, Nooks, phones, tablets.
Maybe the NSTG is different.
Did you look in the code to see how it was done?
Does it use something native to talk to I2C?
Renate NST said:
I've never had a NSTG, so I can't say.
I use an in-app brightness control in my reader app and it's exactly like the code above.
It works on every device that I have, Nooks, phones, tablets.
Maybe the NSTG is different.
Did you look in the code to see how it was done?
Does it use something native to talk to I2C?
Click to expand...
Click to collapse
To be honest, I finally let it go. It's really hard to troubleshoot without the hardware and there was no real way for me to examine what was going on or not going on other than by report. I ddn't want to exhaust the member with the NSTG, so....
Renate NST said:
I've never had a NSTG, so I can't say.
I use an in-app brightness control in my reader app and it's exactly like the code above.
It works on every device that I have, Nooks, phones, tablets.
Maybe the NSTG is different.
Did you look in the code to see how it was done?
Does it use something native to talk to I2C?
Click to expand...
Click to collapse
Well, yes, actually. I finally tracked down an old NSTG for a reasonable price (a few tiny screen defects with the light, as expected...) and with your hint and some additional sleuthing I am half-way to my goal. There are two values in
/sys/devices/platform/i2c_omap.2/i2c-adapter/i2c-2/2-0040/leds/lcd-backlight/
one is brightness and the other is brightness2. Both are "0" when the light is off. When the light is on, they become the intensity value. Manually changing the value of brightness from "0" to some other number turns the light on (brightness2 stays at "0" when the value of brightness is manually changed, so they are not ganged together; not sure why there are two values). Manually changing the value of brightness back to "0" turns the light off.
This is good, but unfortunately the status bar icon does not change when the values are changed manually A portion of the logcat of the sequence of turning the light on and off in the usual way is below
Code:
D/WindowManager( 789): CALLING monitor
D/StatusBarPolicy( 789): ACTION_SCREEN_LIGHTS_ON
D/SurfaceFlinger( 789): Frame buffer posted; elapsed time = 17 msecs
I/PowerManagerService( 789): setPowerState: mPowerState=0x3 newState=0x3 noChangeLights=false reason=1
D/SurfaceFlinger( 789): Frame buffer posted; elapsed time = 12 msecs
D/WifiService( 789): ACTION_BATTERY_CHANGED pluggedType: 0
I/PowerManagerService( 789): setPowerState: mPowerState=0x3 newState=0x3 noChangeLights=false reason=1
I/PowerManagerService( 789): setPowerState: mPowerState=0x3 newState=0x3 noChangeLights=false reason=1
D/WindowManager( 789): CALLING monitor
I/PowerManagerService( 789): setPowerState: mPowerState=0x3 newState=0x3 noChangeLights=false reason=1
I/PowerManagerService( 789): setPowerState: mPowerState=0x3 newState=0x3 noChangeLights=false reason=1
D/WindowManager( 789): CALLING monitor
D/StatusBarPolicy( 789): ACTION_SCREEN_LIGHTS_OFF
So now the question becomes "How do I make the status bar icon change?" There's not a lot of info (for me) in that logcat snippet. I'm thinking an intent is broadcast when the light is cycled in the intended way, but I don't see evidence of it. I should add that this device is entirely gutted of B&N stuff (yay! I finally figured out how to kill the endless whining for B&N server contact!!), so whatever remains is capable of making the status bar icon change.
?
The two brightnesses could be the two different colors of LED for color tuning.
I'm not sure if this had that.
The backlight is in /system/framework/framework.apk in android.provider.settings.System
If you want, post the file somewhere and I'll take a look.
Yes, the settings are there, but I haven't tracked it to the hardware.
Renate NST said:
The two brightnesses could be the two different colors of LED for color tuning.
I'm not sure if this had that.
The backlight is in /system/framework/framework.apk in android.provider.settings.System
If you want, post the file somewhere and I'll take a look.
Click to expand...
Click to collapse
I assume you mean framework.jar as there is only the framework-res.apk and it contains precious little code.
I've decompiled the jar and taken a look around. It's a little different than what you were anticipating, probably. Any "light" references seem to be in Settings.smali, not the Settings$System.smali. There appears to be a reference to a broadcast intent regarding whether the lights have changed or are on/off but that seems to refer to com.BN which is certainly gone (I think) since I removed all the (visible) B&N stuff, including the jars. And yet it all still works properly if the light is turned on and off with the "n" button. What I don't see is how the status bar is getting wind of the change. But you'll probably see many things I don't
Copy of framework.jar attached.
In short, how in normal Android it's supposed to work.
You change the settings.
Settings is only a content provider, it doesn't know or care about the difference between "screen_brightness" and "activate_doomsday".
Some service puts a ContentObserver on that setting and when it changes it does something.
So for the Glow2:
Code:
services.jar
com.android.server.power.PowerManagerService
systemReady()
ContentResolver.registerContentObserver(Settings.System.SCREEN_BRIGHTNESS)
com.android.server.power.DisplayPowerController
com.android.server.LightsService.Light
setBrightness()
setLightLocked()
setLight_native()
libandroid_servers.so
setLight_native
So look at what you have for settings in:
Code:
# sqlite3 /data/data/com.android.providers.settings/databases/settings.db
.dump
Then:
Code:
# settings put <namespace> <key> <value>
The status bar will only change if you change through Settings, not the I2C.
So maybe the NSTG uses different settings.
Renate NST said:
In short, how in normal Android it's supposed to work.
You change the settings.
So look at what you have for settings in:
Code:
# sqlite3 /data/data/com.android.providers.settings/databases/settings.db
Click to expand...
Click to collapse
I've had a peek at settings.db before. In "system" it shows the last intensity setting of light (so it's non-zero generally, even when the light is off). There is also an entry for "screen brightness mode" for which I show a value of 0 (perhaps it's 1 when the light is on?) and also "dim screen" which shows a value of 1 (again, I copied this file when the light was off).
Hmm...
Aha. If I copy out the settings.db file when the light is on, I get a value of 1 for "screen brightness mode".
Now to try the real thing. Thanks for pointing me in a possible direction. So many of those database values seemed like descriptive artifacts that don't effect real change when you alter them but instead report a change when it has happened. I have been mistaken.
nmyshkin said:
I get a value of 1 for "screen brightness mode".
Click to expand...
Click to collapse
It's "screen_brightness_mode" and that means to use the ambient brightness to modify the display brightness.
None of the Nooks have a sensor, so that really doesn't affect anything.
"screen_brightness" is the stock single value for brightness.
Are there any other settings for brightness/color/temp/whatever?
Post the services.jar
Renate NST said:
It's "screen_brightness_mode" and that means to use the ambient brightness to modify the display brightness.
None of the Nooks have a sensor, so that really doesn't affect anything.
"screen_brightness" is the stock single value for brightness.
Are there any other settings for brightness/color/temp/whatever?
Post the services.jar
Click to expand...
Click to collapse
Using sqlite to change the value of screen_brightness_mode in settings.db does not, in fact, turn on the light. What is does do is (bizarre) tick the box that says the light is on in the quick settings panel for the light :silly:
I've attached services.jar. There are no other entries in settings.db that could plausibly be construed as having to do with the light.
nmyshkin said:
I've attached services.jar.
Click to expand...
Click to collapse
I can see that PowerManagerService$SettingsObserver.smali is only tracking changes to screen_brightness_mode.
I can see that B&N strayed from stock here quite a bit.
I can see that this jar has been modified by something called "ModUtils"
So:
If you want to turn on the light, use a ContentResolver, set screen_brightness, then set screen_brightness_mode to 1;
If you want to turn off the light, use a ContentResolver, set screen_brightness_mode to 0;
If you want to change the level of the light, use a ContentResolver, set screen_brightness, then increment screen_brightness_mode (so as to effect a change).
Renate NST said:
I can see that PowerManagerService$SettingsObserver.smali is only tracking changes to screen_brightness_mode.
Click to expand...
Click to collapse
So that's the place, then.
I can see that B&N strayed from stock here quite a bit.
Click to expand...
Click to collapse
Based on the principle that enough is never enough.
I can see that this jar has been modified by something called "ModUtils"
Click to expand...
Click to collapse
Yes, service and framework jar both have small modifications in them from NookTouchModManager and GApps installation.
So:
If you want to turn on the light, use a ContentResolver, set screen_brightness, then set screen_brightness_mode to 1;
If you want to turn off the light, use a ContentResolver, set screen_brightness_mode to 0;
If you want to change the level of the light, use a ContentResolver, set screen_brightness, then increment screen_brightness_mode (so as to effect a change).
Click to expand...
Click to collapse
I assume you are suggesting this so that the changes will be broadcast to whatever routine is updating the idiot icon in the status bar to show that the light is either on or off (I mean, if you can't tell the light is on or off by looking at the screen, an icon is probably not going to help you...). Otherwise the same effect can be accomplished by changing the values of "brightness" and "brightness2".
Since I'm not going to be addressing this issue via JAVA, I need to keep looking for a method to address the status bar icon change. If I had that, I'd be fine with writing a simple value change via shell command to turn the light on/off.
The Law of Unintended Consequences
Mark this "sorta solved", I guess.
While mulling over the possibilities I decided to go ahead with setting up the device and flashed the only available kernel that includes both No Refresh and USB host. This kernel is, unfortunately, based on FW 1.1.5 but it behaves fine on my NST running FW 1.2.2.
It does not like the Glowlight option. What it does is interesting: a long-press of the "n" button, which should turn the light on/off at the last used intensity, changes the status bar icon but does not turn the light on or off. Accessing the light from the control panel changes the status bar icon but only turns the light on if the slider is touched. To actually turn the light off, it is necessary to push the slider all the way down manually before changing the status bar icon. And actually, you cannot get to "0" by manually pushing the slider. The stored value turns out to be "3".
While still not revealing how the status bar icon gets the word, this did enable me to construct a software "solution" from shell commands that both changes the status bar icon and turns the light off and on, after checking settings.db to see what the last intensity setting was. I could not have done that without my previous delving into the i2c stuff.
In the end none of this mattered because what I really wanted to do was move the function from a long-press of the "n" button to some other hardware button. This was possible to do with Nook Touch Mod Manager, but when I addressed the hardware button with a sendevent command via Tasker, it responded as the stock hardware assignment, not the reassigned button. So game over.
Anyway, I have Glowlight functionality with a kernel based on 1.1.5 and in the end, that's almost as good.