[Q] Set default power widget and lockscreen - Android

I'm working in my own rom, and i need to set Holo lockscreen by default, and the notification power widget with some toggles, and i dont know where i can set it, can you help me please?

LuisUrrutia said:
I'm working in my own rom, and i need to set Holo lockscreen by default, and the notification power widget with some toggles, and i dont know where i can set it, can you help me please?
Click to expand...
Click to collapse
What is your base?

lithid-cm said:
What is your base?
Click to expand...
Click to collapse
CM 7.2 Stable Cooper

No one?

Should learn patience when people are helping you, we don't all live on the internet. Also, if you were more descriptive in your OP I could have answered your question at that point.
Change default lockscreen to holo:
https://github.com/CyanogenMod/andr...parts/activities/LockscreenStyleActivity.java
Line: 168
Code:
Settings.System.RINGLOCK_STYLE_PREF, RinglockStyle.getIdByStyle(RinglockStyle.Bubble)));
to
Code:
Settings.System.RINGLOCK_STYLE_PREF, RinglockStyle.getIdByStyle(RinglockStyle.Holo)));
Change default power widgets:
https://github.com/CyanogenMod/andr...yanogenmod/cmparts/utils/PowerWidgetUtil.java
Line: 98
Code:
private static final String BUTTON_DELIMITER = "|";
private static final String BUTTONS_DEFAULT = BUTTON_WIFI
+ BUTTON_DELIMITER + BUTTON_BLUETOOTH
+ BUTTON_DELIMITER + BUTTON_GPS
+ BUTTON_DELIMITER + BUTTON_SOUND;
That is the list of buttons. Right above line 98 there is a nice list of buttons to set as default. To add a button. Append this for example.
Code:
+ BUTTON_DELIMITER + BUTTON_AIRPLANE;
Will look like:
Code:
private static final String BUTTON_DELIMITER = "|";
private static final String BUTTONS_DEFAULT = BUTTON_WIFI
+ BUTTON_DELIMITER + BUTTON_BLUETOOTH
+ BUTTON_DELIMITER + BUTTON_GPS
+ BUTTON_DELIMITER + BUTTON_SOUND;
+ BUTTON_DELIMITER + BUTTON_AIRPLANE;
To change the Airplane mode to the first one, do this.
Code:
private static final String BUTTON_DELIMITER = "|";
private static final String BUTTONS_DEFAULT = BUTTON_AIRPLANE
+ BUTTON_DELIMITER + BUTTON_BLUETOOTH
+ BUTTON_DELIMITER + BUTTON_GPS
+ BUTTON_DELIMITER + BUTTON_SOUND;
+ BUTTON_DELIMITER + BUTTON_WIFI;
Next time though, have some respect. Looks like I just help build your "Rom".
Take care.

lithid-cm said:
Should learn patience when people are helping you, we don't all live on the internet. Also, if you were more descriptive in your OP I could have answered your question at that point.
Change default lockscreen to holo:
https://github.com/CyanogenMod/andr...parts/activities/LockscreenStyleActivity.java
Line: 168
Code:
Settings.System.RINGLOCK_STYLE_PREF, RinglockStyle.getIdByStyle(RinglockStyle.Bubble)));
to
Code:
Settings.System.RINGLOCK_STYLE_PREF, RinglockStyle.getIdByStyle(RinglockStyle.Holo)));
Change default power widgets:
https://github.com/CyanogenMod/andr...yanogenmod/cmparts/utils/PowerWidgetUtil.java
Line: 98
Code:
private static final String BUTTON_DELIMITER = "|";
private static final String BUTTONS_DEFAULT = BUTTON_WIFI
+ BUTTON_DELIMITER + BUTTON_BLUETOOTH
+ BUTTON_DELIMITER + BUTTON_GPS
+ BUTTON_DELIMITER + BUTTON_SOUND;
That is the list of buttons. Right above line 98 there is a nice list of buttons to set as default. To add a button. Append this for example.
Code:
+ BUTTON_DELIMITER + BUTTON_AIRPLANE;
Will look like:
Code:
private static final String BUTTON_DELIMITER = "|";
private static final String BUTTONS_DEFAULT = BUTTON_WIFI
+ BUTTON_DELIMITER + BUTTON_BLUETOOTH
+ BUTTON_DELIMITER + BUTTON_GPS
+ BUTTON_DELIMITER + BUTTON_SOUND;
+ BUTTON_DELIMITER + BUTTON_AIRPLANE;
To change the Airplane mode to the first one, do this.
Code:
private static final String BUTTON_DELIMITER = "|";
private static final String BUTTONS_DEFAULT = BUTTON_AIRPLANE
+ BUTTON_DELIMITER + BUTTON_BLUETOOTH
+ BUTTON_DELIMITER + BUTTON_GPS
+ BUTTON_DELIMITER + BUTTON_SOUND;
+ BUTTON_DELIMITER + BUTTON_WIFI;
Next time though, have some respect. Looks like I just help build your "Rom".
Take care.
Click to expand...
Click to collapse
Thanks you very much, and I'm sorry it will not happen again.
I really appreciate your help, thanks a lot.

Related

[Q][DEVS] Modified kernel to support in-call 2-way recording

To start of...
Before anyone goes APE regarding the issue of how it is illegal to record conversations.. I have heard all the rants and concerns on how illegal this is and that the wrath of god should/will get anyone whoever breaches the topic...
Here is my scenario that I have run into the past that it would be nice to have such a feature.. I am driving down the feeway and my mom calls me up to blow the breeze.. At some point in the conversation it comes up that she is baking a favorite cake of mine. One thing leads to another and she is rattling off the recipe.. I am on the freeway doing 80 so I have no way to write this down... You get the point…
Sorry for the long intro..
I have found a similar topic that has been done on the EVO 4G:
http://forum.xda-developers.com/showthread.php?t=1137094
That is what I am looking for on the Photon. I would just like to pose this question to the devs of the kernels that have poped up recenetly.. Is it possible to do this on the Photon Kernel?
Thank you in advance, and a appology to anyone that I have ruffled their feather breaching this topic.
RJR
I'd love to see this feature. I hope nobody complains about it because it is legal in certain areas, if yours isn't one of them then don't use the feature. Where I live (New York) it is perfectly legal to record a conversation without informing the other party. It is only illegal to record a conversation if you are not taking part in it (if you are a 3rd party.)
Almost every time I call tech support I like to record the conversation. Usually I'd put the support call into a 3-way phone call with my voicemail service but having this feature built into the kernel would be awesome.
agreed, any updates for the photon would be awesome
rrusek said:
To start of...
Before anyone goes APE regarding the issue of how it is illegal to record conversations.. I have heard all the rants and concerns on how illegal this is and that the wrath of god should/will get anyone whoever breaches the topic...
Here is my scenario that I have run into the past that it would be nice to have such a feature.. I am driving down the feeway and my mom calls me up to blow the breeze.. At some point in the conversation it comes up that she is baking a favorite cake of mine. One thing leads to another and she is rattling off the recipe.. I am on the freeway doing 80 so I have no way to write this down... You get the point…
Sorry for the long intro..
I have found a similar topic that has been done on the EVO 4G:
http://forum.xda-developers.com/showthread.php?t=1137094
That is what I am looking for on the Photon. I would just like to pose this question to the devs of the kernels that have poped up recenetly.. Is it possible to do this on the Photon Kernel?
Thank you in advance, and a appology to anyone that I have ruffled their feather breaching this topic.
RJR
Click to expand...
Click to collapse
Sent from my MB855 using XDA App
sub2k1 said:
Where I live (New York) it is perfectly legal to record a conversation without informing the other party. It is only illegal to record a conversation if you are not taking part in it (if you are a 3rd party.)
Click to expand...
Click to collapse
My father in law is a private investigator and FYI the laws get real crazy when u call over state lines, or from jurisdiction to jurisdiction. for example, in Indiana, as long as one party consents, it's totally legal, however, if I call Illinois (2 party consent state) it's illegal to record the conversation without consent from both parties, regardless where the call originates from. Both parties must consent, and there must be an audible tone every 30 seconds or something like that.
Not whining because I can see the benefits of such an app, just wanted every one informed of what the "rules" are.
Sent phrom my Mo-Pho
Who cares bout laws or rules ... that would be badazz
Sent from my MB855 using XDA App
lucidvtec said:
Who cares bout laws or rules ... that would be badazz
Sent from my MB855 using XDA App
Click to expand...
Click to collapse
+1 I also think this would be pretty cool!
Sent from my MB855 using xda premium
daddymikey1975 said:
My father in law is a private investigator and FYI the laws get real crazy when u call over state lines, or from jurisdiction to jurisdiction. for example, in Indiana, as long as one party consents, it's totally legal, however, if I call Illinois (2 party consent state) it's illegal to record the conversation without consent from both parties, regardless where the call originates from. Both parties must consent, and there must be an audible tone every 30 seconds or something like that.
Not whining because I can see the benefits of such an app, just wanted every one informed of what the "rules" are.
Sent phrom my Mo-Pho
Click to expand...
Click to collapse
That is interesting. I still can't imagine it being held against me as I conducted a lawful activity inside the boundaries of my state which is compliant with my state. Perhaps any evidence a private investigator would gather would be useless in the other state where it was deemed illegal however what happens if that evidence is presented to a judge of a New York court? Do you think the judge would toss it? Regardless I'm not a lawyer but when I call customer/technical support and get a recording saying "This call may be monitored or recorded" I consider that consent from the other party and anyways I use the recordings for my own purposes. Anways you aren't whining and I appreciate the tidbit.
sub2k1 said:
Regardless I'm not a lawyer but when I call customer/technical support and get a recording saying "This call may be monitored or recorded" I consider that consent from the other party and anyways I use the recordings for my own purposes. Anways you aren't whining and I appreciate the tidbit.
Click to expand...
Click to collapse
as long as there is a notification and both parties remain on the phone, the consent is implied
regarding your previous question, the rules from the jurisdiction with the least amount of leniency will be applied to both parties of the phone call regardless of the calls origin (1 party/2 party consent) if it's just for customer service you should be fine.. I would advise against recording those $3.99/minute late night calls
Two words: Google Voice.
Integrate your Sprint number with Google Voice, and you instantly have the ability to record incoming calls simply by pressing 4. Downside is it only works on incoming calls.. And it does play a "This call is being recorded" message to both parties.
RickNY1971 said:
Two words: Google Voice.
Integrate your Sprint number with Google Voice, and you instantly have the ability to record incoming calls simply by pressing 4. Downside is it only works on incoming calls.. And it does play a "This call is being recorded" message to both parties.
Click to expand...
Click to collapse
Yeah, the thing is... I mainly need to record outgoing calls.
i remember the miui has this recording feature originally
Kernel Patch used for EVO 4G
Can this patch be used on the kernels that are currenly out Photon?
---------------------------------
From 0ade273fbca96fc909aa4873ed0ec56b37adb8b0 Mon Sep 17 00:00:00 2001
From: Kraml Liu <[email protected]>
Date: Wed, 16 Mar 2011 09:28:01 +0800
Subject: [PATCH] Add rVoix call line recording patch, see below URL for
detail
http://forum.xda-developers.com/showthread.php?t=993793
---
arch/arm/mach-msm/qdsp6/pcm_in.c | 104 +++++++++++++++++++++++--------------
arch/arm/mach-msm/qdsp6/q6audio.c | 98 ++++++++++++++++++++++++++++++++++-
2 files changed, 160 insertions(+), 42 deletions(-)
diff --git a/arch/arm/mach-msm/qdsp6/pcm_in.c b/arch/arm/mach-msm/qdsp6/pcm_in.c
index 3b3d23b..b711f46 100644
--- a/arch/arm/mach-msm/qdsp6/pcm_in.c
+++ b/arch/arm/mach-msm/qdsp6/pcm_in.c
@@ -26,18 +26,30 @@
#include <mach/msm_qdsp6_audio.h>
-#define BUFSZ (256)
-static DEFINE_MUTEX(pcm_in_lock);
-static uint32_t sample_rate = 8000;
-static uint32_t channel_count = 1;
-static uint32_t buffer_size = BUFSZ;
-static int pcm_in_opened = 0;
+struct msm_voicerec_mode {
+ uint32_t rec_mode;
+};
+
+
+#define AUDIO_SET_INCALL _IOW(AUDIO_IOCTL_MAGIC, 19, struct msm_voicerec_mode)
+#define AUDIO_FLAG_INCALL_MIXED 2
+
+struct pcm {
+ struct audio_client *ac;
+ uint32_t sample_rate;
+ uint32_t channel_count;
+ uint32_t buffer_size;
+ uint32_t rec_mode;
+};
+
+#define BUFSZ (256)
void audio_client_dump(struct audio_client *ac);
static long q6_in_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{
+ struct pcm *pcm = file->private_data;
int rc = 0;
switch (cmd) {
@@ -61,17 +73,15 @@ static long q6_in_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
break;
}
- mutex_lock(&pcm_in_lock);
- if (file->private_data) {
+ if (pcm->ac) {
rc = -EBUSY;
} else {
- file->private_data = q6audio_open_pcm(
- buffer_size, sample_rate, channel_count,
- AUDIO_FLAG_READ, acdb_id);
- if (!file->private_data)
+ pcm->ac = q6audio_open_pcm(pcm->buffer_size,
+ pcm->sample_rate, pcm->channel_count,
+ pcm->rec_mode, acdb_id);
+ if (!pcm->ac)
rc = -ENOMEM;
}
- mutex_unlock(&pcm_in_lock);
break;
}
case AUDIO_STOP:
@@ -96,17 +106,32 @@ static long q6_in_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
rc = -EINVAL;
break;
}
- sample_rate = config.sample_rate;
- channel_count = config.channel_count;
- buffer_size = config.buffer_size;
+
+ pcm->sample_rate = config.sample_rate;
+ pcm->channel_count = config.channel_count;
+ pcm->buffer_size = config.buffer_size;
+ break;
+ }
+ case AUDIO_SET_INCALL: {
+ struct msm_voicerec_mode voicerec_mode;
+ if (copy_from_user(&voicerec_mode, (void *)arg,
+ sizeof(struct msm_voicerec_mode)))
+ return -EFAULT;
+ if (voicerec_mode.rec_mode != AUDIO_FLAG_READ &&
+ voicerec_mode.rec_mode != AUDIO_FLAG_INCALL_MIXED) {
+ pcm->rec_mode = AUDIO_FLAG_READ;
+ pr_err("invalid rec_mode\n");
+ rc = -EINVAL;
+ } else
+ pcm->rec_mode = voicerec_mode.rec_mode;
break;
}
case AUDIO_GET_CONFIG: {
struct msm_audio_config config;
- config.buffer_size = buffer_size;
+ config.buffer_size = pcm->buffer_size;
config.buffer_count = 2;
- config.sample_rate = sample_rate;
- config.channel_count = channel_count;
+ config.sample_rate = pcm->sample_rate;
+ config.channel_count = pcm->channel_count;
config.unused[0] = 0;
config.unused[1] = 0;
config.unused[2] = 0;
@@ -123,32 +148,33 @@ static long q6_in_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
static int q6_in_open(struct inode *inode, struct file *file)
{
- int rc;
+ struct pcm *pcm;
pr_info("pcm_in: open\n");
- mutex_lock(&pcm_in_lock);
- if (pcm_in_opened) {
- pr_err("pcm_in: busy\n");
- rc = -EBUSY;
- } else {
- pcm_in_opened = 1;
- rc = 0;
- }
- mutex_unlock(&pcm_in_lock);
- return rc;
+ pcm = kzalloc(sizeof(struct pcm), GFP_KERNEL);
+
+ if (!pcm)
+ return -ENOMEM;
+
+ pcm->channel_count = 1;
+ pcm->sample_rate = 8000;
+ pcm->buffer_size = BUFSZ;
+ pcm->rec_mode = AUDIO_FLAG_READ;
+ file->private_data = pcm;
+ return 0;
}
static ssize_t q6_in_read(struct file *file, char __user *buf,
size_t count, loff_t *pos)
{
+ struct pcm *pcm = file->private_data;
struct audio_client *ac;
struct audio_buffer *ab;
const char __user *start = buf;
int xfer;
int res;
- mutex_lock(&pcm_in_lock);
- ac = file->private_data;
+ ac = pcm->ac;
if (!ac) {
res = -ENODEV;
goto fail;
@@ -181,20 +207,18 @@ static ssize_t q6_in_read(struct file *file, char __user *buf,
}
fail:
res = buf - start;
- mutex_unlock(&pcm_in_lock);
-
return res;
}
static int q6_in_release(struct inode *inode, struct file *file)
{
+
int rc = 0;
- mutex_lock(&pcm_in_lock);
- if (file->private_data)
- rc = q6audio_close(file->private_data);
- pcm_in_opened = 0;
- mutex_unlock(&pcm_in_lock);
- pr_info("pcm_in: release\n");
+ struct pcm *pcm = file->private_data;
+ if (pcm->ac)
+ rc = q6audio_close(pcm->ac);
+ kfree(pcm);
+ pr_info("pcm_out: release\n");
return rc;
}
diff --git a/arch/arm/mach-msm/qdsp6/q6audio.c b/arch/arm/mach-msm/qdsp6/q6audio.c
index 2df5b24..444710d 100644
--- a/arch/arm/mach-msm/qdsp6/q6audio.c
+++ b/arch/arm/mach-msm/qdsp6/q6audio.c
@@ -393,6 +393,7 @@ static int audio_out_open(struct audio_client *ac, uint32_t bufsz,
return audio_ioctl(ac, &rpc, sizeof(rpc));
}
+#if 0
static int audio_in_open(struct audio_client *ac, uint32_t bufsz,
uint32_t rate, uint32_t channels)
{
@@ -415,6 +416,34 @@ static int audio_in_open(struct audio_client *ac, uint32_t bufsz,
TRACE("%p: open in\n", ac);
return audio_ioctl(ac, &rpc, sizeof(rpc));
}
+#else
+static int audio_in_open(struct audio_client *ac, uint32_t bufsz,
+ uint32_t flags, uint32_t rate, uint32_t channels)
+{
+ struct adsp_open_command rpc;
+
+ memset(&rpc, 0, sizeof(rpc));
+
+ rpc.format.standard.format = ADSP_AUDIO_FORMAT_PCM;
+ rpc.format.standard.channels = channels;
+ rpc.format.standard.bits_per_sample = 16;
+ rpc.format.standard.sampling_rate = rate;
+ rpc.format.standard.is_signed = 1;
+ rpc.format.standard.is_interleaved = 1;
+
+ rpc.hdr.opcode = ADSP_AUDIO_IOCTL_CMD_OPEN_READ;
+ rpc.device = ADSP_AUDIO_DEVICE_ID_DEFAULT;
+ if (flags == AUDIO_FLAG_READ)
+ rpc.stream_context = ADSP_AUDIO_DEVICE_CONTEXT_RECORD;
+ else
+ rpc.stream_context = ADSP_AUDIO_DEVICE_CONTEXT_MIXED_RECORD;
+
+ rpc.buf_max_size = bufsz;
+
+ TRACE("%p: open in\n", ac);
+ return audio_ioctl(ac, &rpc, sizeof(rpc));
+}
+#endif
static int audio_mp3_open(struct audio_client *ac, uint32_t bufsz,
uint32_t rate, uint32_t channels)
@@ -1565,6 +1594,31 @@ done:
return 0;
}
+static void adie_rx_path_enable(uint32_t acdb_id)
+{
+ if (audio_rx_path_id) {
+ adie_enable();
+ adie_set_path(adie, audio_rx_path_id, ADIE_PATH_RX);
+ adie_set_path_freq_plan(adie, ADIE_PATH_RX, 48000);
+
+ adie_proceed_to_stage(adie, ADIE_PATH_RX,
+ ADIE_STAGE_DIGITAL_READY);
+ adie_proceed_to_stage(adie, ADIE_PATH_RX,
+ ADIE_STAGE_DIGITAL_ANALOG_READY);
+ }
+}
+
+static void q6_rx_path_enable(int reconf, uint32_t acdb_id)
+{
+ audio_update_acdb(audio_rx_device_id, acdb_id);
+ if (!reconf)
+ qdsp6_devchg_notify(ac_control, ADSP_AUDIO_RX_DEVICE, audio_rx_device_id);
+ qdsp6_standby(ac_control);
+ qdsp6_start(ac_control);
+}
+
+
+
struct audio_client *q6audio_open_pcm(uint32_t bufsz, uint32_t rate,
uint32_t channels, uint32_t flags, uint32_t acdb_id)
{
@@ -1581,7 +1635,7 @@ struct audio_client *q6audio_open_pcm(uint32_t bufsz, uint32_t rate,
ac->flags = flags;
mutex_lock(&audio_path_lock);
-
+#if 0
if (ac->flags & AUDIO_FLAG_WRITE) {
audio_rx_path_refcount++;
if (audio_rx_path_refcount == 1) {
@@ -1626,7 +1680,47 @@ struct audio_client *q6audio_open_pcm(uint32_t bufsz, uint32_t rate,
audio_rx_analog_enable(1);
}
}
-
+#else
+ if (ac->flags & AUDIO_FLAG_WRITE) {
+ audio_rx_path_refcount++;
+ if (audio_rx_path_refcount == 1) {
+ _audio_rx_clk_enable();
+ q6_rx_path_enable(0, acdb_id);
+ adie_rx_path_enable(acdb_id);
+ }
+ } else {
+ /* TODO: consider concurrency with voice call */
+ if (audio_tx_path_refcount > 0) {
+ tx_clk_freq = 8000;
+ } else {
+ tx_clk_freq = rate;
+ }
+ audio_tx_path_refcount++;
+ if (audio_tx_path_refcount == 1) {
+ tx_clk_freq = rate;
+ _audio_tx_clk_enable();
+ _audio_tx_path_enable(0, acdb_id);
+ }
+ }
+
+ for (retry = 5;;retry--) {
+ if (ac->flags & AUDIO_FLAG_WRITE)
+ rc = audio_out_open(ac, bufsz, rate, channels);
+ else
+ rc = audio_in_open(ac, bufsz, flags, rate, channels);
+ if (rc == 0)
+ break;
+ if (retry == 0)
+ BUG();
+ pr_err("q6audio: open pcm error %d, retrying\n", rc);
+ msleep(1);
+ }
+
+ if (ac->flags & AUDIO_FLAG_WRITE) {
+ if (audio_rx_path_refcount == 1)
+ audio_rx_analog_enable(1);
+ }
+#endif
mutex_unlock(&audio_path_lock);
for (retry = 5;;retry--) {
--
1.7.5.4
rrusek said:
Can this patch be used on the kernels that are currenly out Photon?
Code:
---------------------------------
From 0ade273fbca96fc909aa4873ed0ec56b37adb8b0 Mon Sep 17 00:00:00 2001
From: Kraml Liu <[email protected]>
Date: Wed, 16 Mar 2011 09:28:01 +0800
Subject: [PATCH] Add rVoix call line recording patch, see below URL for
detail
[url]http://forum.xda-developers.com/showthread.php?t=993793[/url]
---
arch/arm/mach-msm/qdsp6/pcm_in.c | 104 +++++++++++++++++++++++--------------
arch/arm/mach-msm/qdsp6/q6audio.c | 98 ++++++++++++++++++++++++++++++++++-
2 files changed, 160 insertions(+), 42 deletions(-)
diff --git a/arch/arm/mach-msm/qdsp6/pcm_in.c b/arch/arm/mach-msm/qdsp6/pcm_in.c
index 3b3d23b..b711f46 100644
--- a/arch/arm/mach-msm/qdsp6/pcm_in.c
+++ b/arch/arm/mach-msm/qdsp6/pcm_in.c
@@ -26,18 +26,30 @@
#include <mach/msm_qdsp6_audio.h>
-#define BUFSZ (256)
-static DEFINE_MUTEX(pcm_in_lock);
-static uint32_t sample_rate = 8000;
-static uint32_t channel_count = 1;
-static uint32_t buffer_size = BUFSZ;
-static int pcm_in_opened = 0;
+struct msm_voicerec_mode {
+ uint32_t rec_mode;
+};
+
+
+#define AUDIO_SET_INCALL _IOW(AUDIO_IOCTL_MAGIC, 19, struct msm_voicerec_mode)
+#define AUDIO_FLAG_INCALL_MIXED 2
+
+struct pcm {
+ struct audio_client *ac;
+ uint32_t sample_rate;
+ uint32_t channel_count;
+ uint32_t buffer_size;
+ uint32_t rec_mode;
+};
+
+#define BUFSZ (256)
void audio_client_dump(struct audio_client *ac);
static long q6_in_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{
+ struct pcm *pcm = file->private_data;
int rc = 0;
switch (cmd) {
@@ -61,17 +73,15 @@ static long q6_in_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
break;
}
- mutex_lock(&pcm_in_lock);
- if (file->private_data) {
+ if (pcm->ac) {
rc = -EBUSY;
} else {
- file->private_data = q6audio_open_pcm(
- buffer_size, sample_rate, channel_count,
- AUDIO_FLAG_READ, acdb_id);
- if (!file->private_data)
+ pcm->ac = q6audio_open_pcm(pcm->buffer_size,
+ pcm->sample_rate, pcm->channel_count,
+ pcm->rec_mode, acdb_id);
+ if (!pcm->ac)
rc = -ENOMEM;
}
- mutex_unlock(&pcm_in_lock);
break;
}
case AUDIO_STOP:
@@ -96,17 +106,32 @@ static long q6_in_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
rc = -EINVAL;
break;
}
- sample_rate = config.sample_rate;
- channel_count = config.channel_count;
- buffer_size = config.buffer_size;
+
+ pcm->sample_rate = config.sample_rate;
+ pcm->channel_count = config.channel_count;
+ pcm->buffer_size = config.buffer_size;
+ break;
+ }
+ case AUDIO_SET_INCALL: {
+ struct msm_voicerec_mode voicerec_mode;
+ if (copy_from_user(&voicerec_mode, (void *)arg,
+ sizeof(struct msm_voicerec_mode)))
+ return -EFAULT;
+ if (voicerec_mode.rec_mode != AUDIO_FLAG_READ &&
+ voicerec_mode.rec_mode != AUDIO_FLAG_INCALL_MIXED) {
+ pcm->rec_mode = AUDIO_FLAG_READ;
+ pr_err("invalid rec_mode\n");
+ rc = -EINVAL;
+ } else
+ pcm->rec_mode = voicerec_mode.rec_mode;
break;
}
case AUDIO_GET_CONFIG: {
struct msm_audio_config config;
- config.buffer_size = buffer_size;
+ config.buffer_size = pcm->buffer_size;
config.buffer_count = 2;
- config.sample_rate = sample_rate;
- config.channel_count = channel_count;
+ config.sample_rate = pcm->sample_rate;
+ config.channel_count = pcm->channel_count;
config.unused[0] = 0;
config.unused[1] = 0;
config.unused[2] = 0;
@@ -123,32 +148,33 @@ static long q6_in_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
static int q6_in_open(struct inode *inode, struct file *file)
{
- int rc;
+ struct pcm *pcm;
pr_info("pcm_in: open\n");
- mutex_lock(&pcm_in_lock);
- if (pcm_in_opened) {
- pr_err("pcm_in: busy\n");
- rc = -EBUSY;
- } else {
- pcm_in_opened = 1;
- rc = 0;
- }
- mutex_unlock(&pcm_in_lock);
- return rc;
+ pcm = kzalloc(sizeof(struct pcm), GFP_KERNEL);
+
+ if (!pcm)
+ return -ENOMEM;
+
+ pcm->channel_count = 1;
+ pcm->sample_rate = 8000;
+ pcm->buffer_size = BUFSZ;
+ pcm->rec_mode = AUDIO_FLAG_READ;
+ file->private_data = pcm;
+ return 0;
}
static ssize_t q6_in_read(struct file *file, char __user *buf,
size_t count, loff_t *pos)
{
+ struct pcm *pcm = file->private_data;
struct audio_client *ac;
struct audio_buffer *ab;
const char __user *start = buf;
int xfer;
int res;
- mutex_lock(&pcm_in_lock);
- ac = file->private_data;
+ ac = pcm->ac;
if (!ac) {
res = -ENODEV;
goto fail;
@@ -181,20 +207,18 @@ static ssize_t q6_in_read(struct file *file, char __user *buf,
}
fail:
res = buf - start;
- mutex_unlock(&pcm_in_lock);
-
return res;
}
static int q6_in_release(struct inode *inode, struct file *file)
{
+
int rc = 0;
- mutex_lock(&pcm_in_lock);
- if (file->private_data)
- rc = q6audio_close(file->private_data);
- pcm_in_opened = 0;
- mutex_unlock(&pcm_in_lock);
- pr_info("pcm_in: release\n");
+ struct pcm *pcm = file->private_data;
+ if (pcm->ac)
+ rc = q6audio_close(pcm->ac);
+ kfree(pcm);
+ pr_info("pcm_out: release\n");
return rc;
}
diff --git a/arch/arm/mach-msm/qdsp6/q6audio.c b/arch/arm/mach-msm/qdsp6/q6audio.c
index 2df5b24..444710d 100644
--- a/arch/arm/mach-msm/qdsp6/q6audio.c
+++ b/arch/arm/mach-msm/qdsp6/q6audio.c
@@ -393,6 +393,7 @@ static int audio_out_open(struct audio_client *ac, uint32_t bufsz,
return audio_ioctl(ac, &rpc, sizeof(rpc));
}
+#if 0
static int audio_in_open(struct audio_client *ac, uint32_t bufsz,
uint32_t rate, uint32_t channels)
{
@@ -415,6 +416,34 @@ static int audio_in_open(struct audio_client *ac, uint32_t bufsz,
TRACE("%p: open in\n", ac);
return audio_ioctl(ac, &rpc, sizeof(rpc));
}
+#else
+static int audio_in_open(struct audio_client *ac, uint32_t bufsz,
+ uint32_t flags, uint32_t rate, uint32_t channels)
+{
+ struct adsp_open_command rpc;
+
+ memset(&rpc, 0, sizeof(rpc));
+
+ rpc.format.standard.format = ADSP_AUDIO_FORMAT_PCM;
+ rpc.format.standard.channels = channels;
+ rpc.format.standard.bits_per_sample = 16;
+ rpc.format.standard.sampling_rate = rate;
+ rpc.format.standard.is_signed = 1;
+ rpc.format.standard.is_interleaved = 1;
+
+ rpc.hdr.opcode = ADSP_AUDIO_IOCTL_CMD_OPEN_READ;
+ rpc.device = ADSP_AUDIO_DEVICE_ID_DEFAULT;
+ if (flags == AUDIO_FLAG_READ)
+ rpc.stream_context = ADSP_AUDIO_DEVICE_CONTEXT_RECORD;
+ else
+ rpc.stream_context = ADSP_AUDIO_DEVICE_CONTEXT_MIXED_RECORD;
+
+ rpc.buf_max_size = bufsz;
+
+ TRACE("%p: open in\n", ac);
+ return audio_ioctl(ac, &rpc, sizeof(rpc));
+}
+#endif
static int audio_mp3_open(struct audio_client *ac, uint32_t bufsz,
uint32_t rate, uint32_t channels)
@@ -1565,6 +1594,31 @@ done:
return 0;
}
+static void adie_rx_path_enable(uint32_t acdb_id)
+{
+ if (audio_rx_path_id) {
+ adie_enable();
+ adie_set_path(adie, audio_rx_path_id, ADIE_PATH_RX);
+ adie_set_path_freq_plan(adie, ADIE_PATH_RX, 48000);
+
+ adie_proceed_to_stage(adie, ADIE_PATH_RX,
+ ADIE_STAGE_DIGITAL_READY);
+ adie_proceed_to_stage(adie, ADIE_PATH_RX,
+ ADIE_STAGE_DIGITAL_ANALOG_READY);
+ }
+}
+
+static void q6_rx_path_enable(int reconf, uint32_t acdb_id)
+{
+ audio_update_acdb(audio_rx_device_id, acdb_id);
+ if (!reconf)
+ qdsp6_devchg_notify(ac_control, ADSP_AUDIO_RX_DEVICE, audio_rx_device_id);
+ qdsp6_standby(ac_control);
+ qdsp6_start(ac_control);
+}
+
+
+
struct audio_client *q6audio_open_pcm(uint32_t bufsz, uint32_t rate,
uint32_t channels, uint32_t flags, uint32_t acdb_id)
{
@@ -1581,7 +1635,7 @@ struct audio_client *q6audio_open_pcm(uint32_t bufsz, uint32_t rate,
ac->flags = flags;
mutex_lock(&audio_path_lock);
-
+#if 0
if (ac->flags & AUDIO_FLAG_WRITE) {
audio_rx_path_refcount++;
if (audio_rx_path_refcount == 1) {
@@ -1626,7 +1680,47 @@ struct audio_client *q6audio_open_pcm(uint32_t bufsz, uint32_t rate,
audio_rx_analog_enable(1);
}
}
-
+#else
+ if (ac->flags & AUDIO_FLAG_WRITE) {
+ audio_rx_path_refcount++;
+ if (audio_rx_path_refcount == 1) {
+ _audio_rx_clk_enable();
+ q6_rx_path_enable(0, acdb_id);
+ adie_rx_path_enable(acdb_id);
+ }
+ } else {
+ /* TODO: consider concurrency with voice call */
+ if (audio_tx_path_refcount > 0) {
+ tx_clk_freq = 8000;
+ } else {
+ tx_clk_freq = rate;
+ }
+ audio_tx_path_refcount++;
+ if (audio_tx_path_refcount == 1) {
+ tx_clk_freq = rate;
+ _audio_tx_clk_enable();
+ _audio_tx_path_enable(0, acdb_id);
+ }
+ }
+
+ for (retry = 5;;retry--) {
+ if (ac->flags & AUDIO_FLAG_WRITE)
+ rc = audio_out_open(ac, bufsz, rate, channels);
+ else
+ rc = audio_in_open(ac, bufsz, flags, rate, channels);
+ if (rc == 0)
+ break;
+ if (retry == 0)
+ BUG();
+ pr_err("q6audio: open pcm error %d, retrying\n", rc);
+ msleep(1);
+ }
+
+ if (ac->flags & AUDIO_FLAG_WRITE) {
+ if (audio_rx_path_refcount == 1)
+ audio_rx_analog_enable(1);
+ }
+#endif
mutex_unlock(&audio_path_lock);
for (retry = 5;;retry--) {
--
1.7.5.4
Click to expand...
Click to collapse
It might be able to be used. I'll take a look a little later when I'm not busy.
mrinehart93 said:
It might be able to be used. I'll take a look a little later when I'm not busy.
Click to expand...
Click to collapse
did you have a chance to look into patching this kernel into our photon, it would be awesome to get call recording working, this is probably the only thing I still miss my evo.
Call Recording
I desperately want call recording too!
Update
A developer by the name of Criskelo had made this work on Galaxy S II..
http://forum.xda-developers.com/showthread.php?t=1222368
Looks like the following 2 libraries:
libaudioflinger.so
libaudiopolicy.so
where modified.
Any progress on getting this working on the Photon?
I really hope this can be done!
So far poke recorder with skype internet call on speaker phone seems to be the only way. poke recorder is by far the best audio recorder. Pro version oddly doesn't work for me. I start recording and then make skype call. On speakerphone both sides get picked up.
This certainly seems like a phone issue, I can hear the lack of background noise when the call starts in the recording.
Legal? Illegal?
recorded conversation(s) you obtain can be submitted as evidence .
Council may need to argue, supporting case law, ect.
Every state has its own laws governing this issue.
1.: Check the laws in the state where the call will be initiated.
2.: Research the law in the state where the call will be answered.
If you call me and I answer your cal in the state of Oregon, it is 100% legal to record our conversation without your knowledge. If I call you from Oregon, the same applies.
I dislike mis information being circulated pertaining to this issue.
Ilegal? It all depends on many factors.
Most impotantly, how will anyone know what you have done or intend to do unless you discose/reveal this information. The information you have on your cell phone be could compromised by LE during a criminal investigation or if someone found your lost phone. This could expose you.
Sorry for any errors. I'm at PDX getting lined up for the usual TSA security check.
Tom Apperson, Profesional Legal Investigator
Licensed, Insured, Bonded

[Q] How to get a Reference ID to accept a variable input?

Hi, I'm trying to create an application, and i require to use a variable input for a reference ID to display different arrays here is what i am using at the moment
Code:
public void verbTenses() {
Spinner verbs = (Spinner) findViewById(R.id.verbs);
Spinner tenses = (Spinner) findViewById(R.id.verb_tenses);
[COLOR="Blue"]ListAdapter adapter = R.array.(verbs.getSelectedItem() + "_" + tenses.getSelectedItem());[/COLOR]
ListView list = (ListView) findViewById(R.id.ListView01);
list.setAdapter(adapter);
}
the error area is highlighted
Thank you

Diffs between MIUI.us_streak_2.2.17 and MIUI.us_passion_2.2.17

Hello,
I diffed the MIUI hPa streak version against the N1 version of MIUI 2.2.7. This may useful for everone that wants to port MIUI-Versions of the N1 to the Streak:
Added Files:
system/etc/01_qcomm_omx.cfg
system/etc/install-recovery.sh
system/etc/permissions/android.hardware.camera.autofocus.xml
system/etc/permissions/android.hardware.camera.front.xml
system/etc/permissions/android.hardware.camera.xml
system/etc/permissions/android.hardware.location.xml
system/etc/permissions/android.hardware.sensor.accelerometer.xml
system/etc/permissions/android.hardware.sensor.compass.xml
system/etc/permissions/android.hardware.touchscreen.multitouch.distinct.xml
system/etc/permissions/android.hardware.touchscreen.multitouch.jazzhand.xml
system/etc/wlan/nvram.txt
system/usr/idc/synaptics-rmi-touchscreen.idc
system/usr/keylayout/8k_handset.kl
system/usr/keylayout/Austin_headset.kl
system/usr/keylayout/h2w_headset.kl
system/usr/keylayout/mahimahi-keypad.kl
system/usr/keylayout/surf_keypad.kl
system/usr/keylayout/synaptics_capsensor.kl
system/app/KoreanIME.apk
system/app/RootExplorer.apk
system/app/SetCpu.apk
system/bin/calibrate
system/bin/lightsensor
system/bin/patchram_only
system/bin/qmuxd
system/bin/sensors_daemon
system/etc/bt/4325D1_004.002.004.0230.0243.hcd
system/etc/wlan/fw_bcm4325_apsta.bin
system/etc/wlan/sdio-g-cdc-reclaim-idsup-wme-pktfilter-keepalive-aoe-toe-ccx-wapi.bin
system/etc/wlan/sdio-g-cdc-reclaim-idsup-wme-pktfilter-keepalive-aoe-toe-ccx-wapi-nowps.bin
system/etc/wlan/sdio-g-cdc-reclaim-idsup-wme-pktfilter-keepalive-aoe-toe-ccx-wapi_rc63.1.bin
system/etc/wlan/sdio-mfgtest-g-cdc-seqcmds.bin
system/lib/hw/gps.streak.so
system/lib/hw/lights.qsd8k.so
system/lib/hw/sensors.streak.so
system/lib/libauth.so
system/lib/libcm.so
system/lib/libcommondefs.so
system/lib/libdiag.so
system/lib/libdsm.so
system/lib/libdss.so
system/lib/libdsutils.so
system/lib/libgsdi_exp.so
system/lib/libgstk_exp.so
system/lib/libidl.so
system/lib/libjni_koreanime.so
system/lib/libloc_api-rpc-qc.so
system/lib/libmmgsdilib.so
system/lib/libmmipl.so
system/lib/libmmjpeg.so
system/lib/libnv.so
system/lib/liboem_rapi.so
system/lib/libOmxEvrcDec.so
system/lib/libOmxEvrcEnc.so
system/lib/libOmxQcelp13Dec.so
system/lib/libOmxQcelp13Enc.so
system/lib/liboncrpc.so
system/lib/libpbmlib.so
system/lib/libqmi.so
system/lib/libqueue.so
system/lib/libril-qc-1.so
system/lib/libril-qcril-hook-oem.so
system/lib/libsetcpu-native.so
system/lib/libwms.so
system/lib/libwmsts.so
system/lib/modules/dhd.ko
system/lib/modules/vsync.ko
system/usr/keychars/8k_handset.kcm.bin
system/usr/keychars/surf_keypad.kcm.bin
system/usr/keychars/synaptics_capsensor.kcm.bin
----------------------------------------------------------------------------------
Changed files (also removed)
META-INF/com/google/android/updater-script
system/build.prop
system/etc/apns-conf.xml
system/etc/gps.conf
system/etc/media_profiles.xml
system/etc/vold.fstab
system/lib/egl/egl.cfg
system/usr/idc/synaptics-rmi-touchscreen.idc
system/usr/keylayout/h2w_headset.kl
system/usr/keylayout/mahimahi-keypad.kl
system/usr/keylayout/qwerty.kl
boot.img
system/app/LatinIME.apk
system/app/LatinImeTutorial.apk
system/app/Torch.apk
system/bin/netd
system/bin/wpa_cli
system/bin/wpa_supplicant
system/etc/firmware/bcm4329.hcd
system/etc/firmware/default.acdb
system/etc/firmware/default_att.acdb
system/etc/firmware/default_france.acdb
system/etc/firmware/yamato_pm4.fw
system/framework/android.policy.jar
system/framework/framework.jar
system/framework/framework-res.apk
system/framework/services.jar
system/lib/egl/libEGL_adreno200.so
system/lib/egl/libGLES_android.so
system/lib/egl/libGLESv1_CM_adreno200.so
system/lib/egl/libGLESv2_adreno200.so
system/lib/egl/libq3dtools_adreno200.so
system/lib/hw/copybit.qsd8k.so
system/lib/hw/gps.mahimahi.so
system/lib/hw/gralloc.default.so
system/lib/hw/gralloc.qsd8k.so
system/lib/hw/lights.mahimahi.so
system/lib/hw/sensors.mahimahi.so
system/lib/libaudio.so
system/lib/libbluedroid.so
system/lib/libcamera_client.so
system/lib/libcameraservice.so
system/lib/libcamera.so
system/lib/libgsl.so
system/lib/libhardware_legacy.so
system/lib/liboemcamera.so
system/lib/libOmxCore.so
system/lib/libOmxVdec.so
system/lib/libOmxVidEnc.so
system/lib/libril.so
system/lib/libstagefright_avc_common.so
system/lib/libstagefright_color_conversion.so
system/lib/libstagefright_omx.so
system/lib/libstagefright.so
system/lib/modules/bcm4329.ko
system/usr/keychars/mahimahi-keypad.kcm.bin
system/vendor/firmware/fw_bcm4329_apsta.bin
system/vendor/firmware/fw_bcm4329.bin
Good luck!
hunderteins
diffs in framework.jar
I decompiled framework.jar with jad to detemine what hPa changed. That is not complete. Some of it is just garbage. But the diff gives some hints where to lay hand on, to port MIUI to the Streak:
diff -Nruw MIUI.us_passion_2.2.17/framework_decom/android/telephony/PhoneNumberUtils.jad MIUI.us_streak_2.2.17/framework_decom/android/telephony/PhoneNumberUtils.jad
--- MIUI.us_passion_2.2.17/framework_decom/android/telephony/PhoneNumberUtils.jad 2012-03-10 20:25:05.000000000 +0100
+++ MIUI.us_streak_2.2.17/framework_decom/android/telephony/PhoneNumberUtils.jad 2012-03-10 20:28:08.000000000 +0100
@@ -2134,6 +2134,103 @@
JapanesePhoneNumberFormatter.format(editable);
}
+ public static void formatKoreanNumber(Editable editable)
+ {
+ int i = editable.length();
+ if(i > 6) goto _L2; else goto _L1
+_L1:
+ return;
+_L2:
+ int k;
+ int ai[];
+ editable.subSequence(0, i);
+ for(int j = 0; j < editable.length()
+ if(editable.charAt(j) == '-')
+ editable.delete(j, j + 1);
+ else
+ j++;
+
+ k = editable.length();
+ ai = new int[2];
+ if(editable.charAt(0) != '0' || editable.charAt(1) != '2') goto _L4; else goto _L3
+_L3:
+ k;
+ JVM INSTR tableswitch 7 10: default 136
+ // 7 139
+ // 8 139
+ // 9 139
+ // 10 195;
+ goto _L5 _L6 _L6 _L6 _L7
+_L5:
+ continue; /* Loop/switch isn't completed */
+_L6:
+ byte byte0;
+ ai[0] = 2;
+ ai[1] = 5;
+ byte0 = 2;
+_L9:
+ for(int l = 0; l < byte0; l++)
+ {
+ int j1 = ai[l];
+ editable.replace(j1 + l, j1 + l, "-");
+ }
+
+ break; /* Loop/switch isn't completed */
+_L7:
+ ai[0] = 2;
+ ai[1] = 6;
+ byte0 = 2;
+ if(true) goto _L9; else goto _L8
+_L4:
+ switch(k)
+ {
+ default:
+ continue; /* Loop/switch isn't completed */
+
+ case 7: // '\007'
+ ai[0] = 3;
+ byte0 = 1;
+ break;
+
+ case 8: // '\b'
+ ai[0] = 4;
+ byte0 = 1;
+ break;
+
+ case 9: // '\t'
+ case 10: // '\n'
+ ai[0] = 3;
+ ai[1] = 6;
+ byte0 = 2;
+ break;
+
+ case 11: // '\013'
+ ai[0] = 3;
+ ai[1] = 7;
+ byte0 = 2;
+ break;
+
+ case 12: // '\f'
+ ai[0] = 4;
+ ai[1] = 8;
+ byte0 = 2;
+ break;
+ }
+ continue; /* Loop/switch isn't completed */
+_L8:
+ int i1 = editable.length();
+ while(i1 > 0 && editable.charAt(i1 - 1) == '-')
+ {
+ editable.delete(i1 - 1, i1);
+ i1--;
+ }
+ continue; /* Loop/switch isn't completed */
+ if(true) goto _L9; else goto _L10
+_L10:
+ if(true) goto _L1; else goto _L11
+_L11:
+ }
+
public static void formatNanpNumber(Editable editable)
{
int i;
@@ -2298,6 +2395,10 @@
case 2: // '\002'
formatJapaneseNumber(editable);
break;
+
+ case 3: // '\003'
+ formatKoreanNumber(editable);
+ break;
}
continue; /* Loop/switch isn't completed */
if(true) goto _L1; else goto _L3
@@ -2385,6 +2486,9 @@
if("jp".compareToIgnoreCase(s) == 0)
k = 2;
else
+ if("kr".compareToIgnoreCase(s) == 0)
+ k = 3;
+ else
k = 0;
goto _L4
}
@@ -3456,6 +3560,7 @@
private static final boolean COUNTLY_CALLING_CALL[];
private static final boolean DBG = false;
public static final int FORMAT_JAPAN = 2;
+ public static final int FORMAT_KOREA = 3;
public static final int FORMAT_NANP = 1;
public static final int FORMAT_UNKNOWN = 0;
private static final Pattern GLOBAL_PHONE_NUMBER_PATTERN = Pattern.compile("[\\+]?[0-9.-]+");
diff -Nruw MIUI.us_passion_2.2.17/framework_decom/com/android/internal/telephony/gsm/SIMFileHandler.jad MIUI.us_streak_2.2.17/framework_decom/com/android/internal/telephony/gsm/SIMFileHandler.jad
--- MIUI.us_passion_2.2.17/framework_decom/com/android/internal/telephony/gsm/SIMFileHandler.jad 2012-03-10 20:25:35.000000000 +0100
+++ MIUI.us_streak_2.2.17/framework_decom/com/android/internal/telephony/gsm/SIMFileHandler.jad 2012-03-10 20:28:43.000000000 +0100
@@ -34,55 +34,98 @@
protected String getEFPath(int i)
{
- i;
- JVM INSTR lookupswitch 18: default 156
- // 20272: 214
- // 28433: 208
- // 28435: 208
- // 28436: 208
- // 28438: 208
- // 28439: 208
- // 28440: 208
- // 28472: 202
- // 28476: 196
- // 28486: 202
- // 28589: 202
- // 28613: 202
- // 28615: 202
- // 28616: 202
- // 28617: 202
- // 28618: 202
- // 28619: 202
- // 28621: 202;
- goto _L1 _L2 _L3 _L3 _L3 _L3 _L3 _L3 _L4 _L5 _L4 _L4 _L4 _L4 _L4 _L4 _L4 _L4 _L4
+ if(RIL.mAPPTYPE_VAL != com.android.internal.telephony.IccCardApplication.AppType.APPTYPE_USIM) goto _L2; else goto _L1
_L1:
- String s1 = getCommonIccEFPath(i);
- if(s1 != null) goto _L7; else goto _L6
-_L6:
- IccCard icccard = super.phone.getIccCard();
- if(icccard == null || !icccard.isApplicationOnIcc(com.android.internal.telephony.IccCardApplication.AppType.APPTYPE_USIM)) goto _L9; else goto _L8
-_L8:
- String s = "3F007F105F3A";
-_L11:
+ i;
+ JVM INSTR lookupswitch 21: default 188
+ // 20272: 211
+ // 28433: 205
+ // 28435: 205
+ // 28436: 205
+ // 28438: 205
+ // 28439: 205
+ // 28440: 205
+ // 28472: 205
+ // 28475: 205
+ // 28476: 205
+ // 28480: 205
+ // 28486: 205
+ // 28589: 205
+ // 28613: 205
+ // 28614: 205
+ // 28615: 205
+ // 28616: 205
+ // 28617: 205
+ // 28618: 205
+ // 28619: 205
+ // 28621: 205;
+ goto _L3 _L4 _L5 _L5 _L5 _L5 _L5 _L5 _L5 _L5 _L5 _L5 _L5 _L5 _L5 _L5 _L5 _L5 _L5 _L5 _L5 _L5
+_L3:
+ String s;
+ String s2 = getCommonIccEFPath(i);
+ if(s2 == null)
+ s = "3F007F105F3A";
+ else
+ s = s2;
+_L7:
return s;
_L5:
- s = "3F007F10";
+ s = "3F007FFF";
continue; /* Loop/switch isn't completed */
_L4:
- s = "3F007F20";
- continue; /* Loop/switch isn't completed */
-_L3:
- s = "3F007F20";
+ s = "3F007F105F3A";
continue; /* Loop/switch isn't completed */
_L2:
+ switch(i)
+ {
+ default:
+ String s1 = getCommonIccEFPath(i);
+ if(s1 == null)
+ {
+ IccCard icccard = phone.getIccCard();
+ if(icccard != null && icccard.isApplicationOnIcc(com.android.internal.telephony.IccCardApplication.AppType.APPTYPE_USIM))
+ {
s = "3F007F105F3A";
- continue; /* Loop/switch isn't completed */
-_L9:
+ break;
+ }
Log.e("GSM", "Error: EF Path being returned in null");
-_L7:
+ }
s = s1;
- if(true) goto _L11; else goto _L10
-_L10:
+ break;
+
+ case 28476:
+ s = "3F007F10";
+ break;
+
+ case 28472:
+ case 28486:
+ case 28589:
+ case 28613:
+ case 28615:
+ case 28616:
+ case 28617:
+ case 28618:
+ case 28619:
+ case 28621:
+ s = "3F007F20";
+ break;
+
+ case 28433:
+ case 28435:
+ case 28436:
+ case 28437:
+ case 28438:
+ case 28439:
+ case 28440:
+ s = "3F007F20";
+ break;
+
+ case 20272:
+ s = "3F007F105F3A";
+ break;
+ }
+ if(true) goto _L7; else goto _L6
+_L6:
}
public void handleMessage(Message message)
diff -Nruw MIUI.us_passion_2.2.17/framework_decom/com/android/internal/telephony/IccConstants.jad MIUI.us_streak_2.2.17/framework_decom/com/android/internal/telephony/IccConstants.jad
--- MIUI.us_passion_2.2.17/framework_decom/com/android/internal/telephony/IccConstants.jad 2012-03-10 20:25:31.000000000 +0100
+++ MIUI.us_streak_2.2.17/framework_decom/com/android/internal/telephony/IccConstants.jad 2012-03-10 20:28:37.000000000 +0100
@@ -9,6 +9,7 @@
public interface IccConstants
{
+ public static final String ADF = "7FFF";
public static final String DF_CDMA = "7F25";
public static final String DF_GRAPHICS = "5F50";
public static final String DF_GSM = "7F20";
@@ -18,6 +19,7 @@
public static final int EF_ADN = 28474;
public static final int EF_CFF_CPHS = 28435;
public static final int EF_CFIS = 28619;
+ public static final int EF_CSP_CPHS = 28437;
public static final int EF_CST = 28466;
public static final int EF_EXT1 = 28490;
public static final int EF_EXT2 = 28491;
@@ -32,6 +34,7 @@
public static final int EF_MBI = 28617;
public static final int EF_MSISDN = 28480;
public static final int EF_MWIS = 28618;
+ public static final int EF_OPL = 28614;
public static final int EF_PBR = 20272;
public static final int EF_PNN = 28613;
public static final int EF_RUIM_SPN = 28481;
diff -Nruw MIUI.us_passion_2.2.17/framework_decom/com/android/internal/telephony/PhoneFactory.jad MIUI.us_streak_2.2.17/framework_decom/com/android/internal/telephony/PhoneFactory.jad
--- MIUI.us_passion_2.2.17/framework_decom/com/android/internal/telephony/PhoneFactory.jad 2012-03-10 20:25:32.000000000 +0100
+++ MIUI.us_streak_2.2.17/framework_decom/com/android/internal/telephony/PhoneFactory.jad 2012-03-10 20:28:39.000000000 +0100
@@ -18,7 +18,7 @@
// Referenced classes of package com.android.internal.telephony:
// PhoneProxy, Phone, DefaultPhoneNotifier, SamsungRIL,
-// HTCRIL, LGEStarRIL, SemcRIL, MotoTegraRIL,
+// HTCRIL, LGEStarRIL, SemcRIL, QualcommNoSimReadyRIL,
// RIL, CommandsInterface, PhoneNotifier
public class PhoneFactory
@@ -164,10 +164,10 @@
Log.i("PHONE", "Using Semc RIL");
sCommandsInterface = new SemcRIL(context, j, k);
} else
- if("mototegra".equals(s))
+ if("streak".equals(s))
{
- Log.i("PHONE", "Using Motorola Tegra2 RIL");
- sCommandsInterface = new MotoTegraRIL(context, j, k);
+ Log.i("PHONE", "Using Dell Streak Qualcomm RIL");
+ sCommandsInterface = new QualcommNoSimReadyRIL(context, j, k);
} else
{
sCommandsInterface = new RIL(context, j, k);
diff -Nruw MIUI.us_passion_2.2.17/framework_decom/com/android/internal/telephony/RIL.jad MIUI.us_streak_2.2.17/framework_decom/com/android/internal/telephony/RIL.jad
--- MIUI.us_passion_2.2.17/framework_decom/com/android/internal/telephony/RIL.jad 2012-03-10 20:25:33.000000000 +0100
+++ MIUI.us_streak_2.2.17/framework_decom/com/android/internal/telephony/RIL.jad 2012-03-10 20:28:40.000000000 +0100
@@ -1139,7 +1139,7 @@
{
RILRequest rilrequest = RILRequest.obtain(6, message);
riljLog((new StringBuilder()).append(rilrequest.serialString()).append("> ").append(requestToString(rilrequest.mRequest)).toString());
- rilrequest.mp.writeInt(2);
+ rilrequest.mp.writeString(mAid);
rilrequest.mp.writeString(s);
rilrequest.mp.writeString(s1);
send(rilrequest);
@@ -1149,7 +1149,7 @@
{
RILRequest rilrequest = RILRequest.obtain(7, message);
riljLog((new StringBuilder()).append(rilrequest.serialString()).append("> ").append(requestToString(rilrequest.mRequest)).toString());
- rilrequest.mp.writeInt(2);
+ rilrequest.mp.writeString(mAid);
rilrequest.mp.writeString(s);
rilrequest.mp.writeString(s1);
send(rilrequest);
@@ -1349,7 +1349,8 @@
public void getIMSI(Message message)
{
RILRequest rilrequest = RILRequest.obtain(11, message);
- riljLog((new StringBuilder()).append(rilrequest.serialString()).append("> getIMSI:RIL_REQUEST_GET_IMSI ").append(11).append(" ").append(requestToString(rilrequest.mRequest)).toString());
+ rilrequest.mp.writeString(mAid);
+ riljLog((new StringBuilder()).append(rilrequest.serialString()).append("> getIMSI:RIL_REQUEST_GET_IMSI ").append(11).append(" aid: ").append(mAid).append(" ").append(requestToString(rilrequest.mRequest)).toString());
send(rilrequest);
}
@@ -1539,6 +1540,7 @@
String s2, Message message)
{
RILRequest rilrequest = RILRequest.obtain(28, message);
+ rilrequest.mp.writeString(mAid);
rilrequest.mp.writeInt(i);
rilrequest.mp.writeInt(j);
rilrequest.mp.writeString(s);
@@ -1547,7 +1549,7 @@
rilrequest.mp.writeInt(i1);
rilrequest.mp.writeString(s1);
rilrequest.mp.writeString(s2);
- riljLog((new StringBuilder()).append(rilrequest.serialString()).append("> iccIO: ").append(requestToString(rilrequest.mRequest)).append(" 0x").append(Integer.toHexString(i)).append(" 0x").append(Integer.toHexString(j)).append(" ").append(" path: ").append(s).append(",").append(k).append(",").append(l).append(",").append(i1).toString());
+ riljLog((new StringBuilder()).append(rilrequest.serialString()).append("> iccIO: ").append(" aid: ").append(mAid).append(" ").append(requestToString(rilrequest.mRequest)).append(" 0x").append(Integer.toHexString(i)).append(" 0x").append(Integer.toHexString(j)).append(" ").append(" path: ").append(s).append(",").append(k).append(",").append(l).append(",").append(i1).toString());
send(rilrequest);
}
@@ -2610,8 +2612,9 @@
public void queryFacilityLock(String s, String s1, int i, Message message)
{
RILRequest rilrequest = RILRequest.obtain(42, message);
- riljLog((new StringBuilder()).append(rilrequest.serialString()).append("> ").append(requestToString(rilrequest.mRequest)).toString());
- rilrequest.mp.writeInt(3);
+ riljLog((new StringBuilder()).append(rilrequest.serialString()).append("> ").append(requestToString(rilrequest.mRequest)).append(" aid: ").append(mAid).append(" facility: ").append(s).toString());
+ rilrequest.mp.writeInt(4);
+ rilrequest.mp.writeString(mAid);
rilrequest.mp.writeString(s);
rilrequest.mp.writeString(s1);
rilrequest.mp.writeString(Integer.toString(i));
@@ -2865,6 +2868,8 @@
if(s != null)
s = s.split(" ")[0];
datacallstate.address = s;
+ parcel.readInt();
+ parcel.readInt();
arraylist.add(datacallstate);
}
@@ -2904,30 +2909,73 @@
protected Object responseIccCardStatus(Parcel parcel)
{
- IccCardStatus icccardstatus = new IccCardStatus();
+ IccCardStatus icccardstatus;
+ int ai[];
+ int ai1[];
+ int i;
+ int k;
+ int i1;
+ int j1;
+ icccardstatus = new IccCardStatus();
+ ai = new int[8];
+ ai1 = new int[8];
icccardstatus.setCardState(parcel.readInt());
icccardstatus.setUniversalPinState(parcel.readInt());
- icccardstatus.setGsmUmtsSubscriptionAppIndex(parcel.readInt());
- icccardstatus.setCdmaSubscriptionAppIndex(parcel.readInt());
- int i = parcel.readInt();
- if(i > 8)
- i = 8;
- icccardstatus.setNumApplications(i);
+ i = parcel.readInt();
for(int j = 0; j < i; j++)
- {
- IccCardApplication icccardapplication = new IccCardApplication();
- icccardapplication.app_type = icccardapplication.AppTypeFromRILInt(parcel.readInt());
- icccardapplication.app_state = icccardapplication.AppStateFromRILInt(parcel.readInt());
- icccardapplication.perso_substate = icccardapplication.PersoSubstateFromRILInt(parcel.readInt());
+ ai[j] = parcel.readInt();
+
+ k = parcel.readInt();
+ for(int l = 0; l < k; l++)
+ ai1[l] = parcel.readInt();
+
+ i1 = parcel.readInt();
+ if(i1 > 8)
+ i1 = 8;
+ icccardstatus.setNumApplications(i1);
+ j1 = 0;
+_L9:
+ if(j1 >= i1) goto _L2; else goto _L1
+_L1:
+ IccCardApplication icccardapplication;
+ int k1;
+ int l1;
+ int i2;
+ icccardapplication = new IccCardApplication();
+ k1 = parcel.readInt();
+ icccardapplication.app_type = icccardapplication.AppTypeFromRILInt(k1);
+ l1 = parcel.readInt();
+ icccardapplication.app_state = icccardapplication.AppStateFromRILInt(l1);
+ i2 = parcel.readInt();
+ icccardapplication.perso_substate = icccardapplication.PersoSubstateFromRILInt(i2);
icccardapplication.aid = parcel.readString();
icccardapplication.app_label = parcel.readString();
icccardapplication.pin1_replaced = parcel.readInt();
icccardapplication.pin1 = icccardapplication.PinStateFromRILInt(parcel.readInt());
icccardapplication.pin2 = icccardapplication.PinStateFromRILInt(parcel.readInt());
+ if(k1 <= 0 || l1 <= 0 || i2 <= 0) goto _L4; else goto _L3
+_L3:
+ if(i <= 0) goto _L6; else goto _L5
+_L5:
+ mAPPTYPE_VAL = icccardapplication.app_type;
+ icccardstatus.setGsmUmtsSubscriptionAppIndex(ai[j1]);
+_L7:
+ mAid = icccardapplication.aid;
+_L4:
icccardstatus.addApplication(icccardapplication);
+ j1++;
+ continue; /* Loop/switch isn't completed */
+_L6:
+ if(k > 0)
+ {
+ mAPPTYPE_VAL = icccardapplication.app_type;
+ icccardstatus.setCdmaSubscriptionAppIndex(ai1[j1]);
}
-
+ if(true) goto _L7; else goto _L2
+_L2:
return icccardstatus;
+ if(true) goto _L9; else goto _L8
+_L8:
}
protected Object responseInts(Parcel parcel)
@@ -3330,8 +3378,9 @@
public void setFacilityLock(String s, boolean flag, String s1, int i, Message message)
{
RILRequest rilrequest = RILRequest.obtain(43, message);
- riljLog((new StringBuilder()).append(rilrequest.serialString()).append("> ").append(requestToString(rilrequest.mRequest)).toString());
- rilrequest.mp.writeInt(4);
+ riljLog((new StringBuilder()).append(rilrequest.serialString()).append("> ").append(requestToString(rilrequest.mRequest)).append(" aid: ").append(mAid).append(" facility: ").append(s).append(" lockstate: ").append(flag).toString());
+ rilrequest.mp.writeInt(5);
+ rilrequest.mp.writeString(mAid);
rilrequest.mp.writeString(s);
String s2;
if(flag)
@@ -3551,7 +3600,7 @@
{
RILRequest rilrequest = RILRequest.obtain(2, message);
riljLog((new StringBuilder()).append(rilrequest.serialString()).append("> ").append(requestToString(rilrequest.mRequest)).toString());
- rilrequest.mp.writeInt(1);
+ rilrequest.mp.writeString(mAid);
rilrequest.mp.writeString(s);
send(rilrequest);
}
@@ -3560,7 +3609,7 @@
{
RILRequest rilrequest = RILRequest.obtain(4, message);
riljLog((new StringBuilder()).append(rilrequest.serialString()).append("> ").append(requestToString(rilrequest.mRequest)).toString());
- rilrequest.mp.writeInt(1);
+ rilrequest.mp.writeString(mAid);
rilrequest.mp.writeString(s);
send(rilrequest);
}
@@ -3569,7 +3618,7 @@
{
RILRequest rilrequest = RILRequest.obtain(3, message);
riljLog((new StringBuilder()).append(rilrequest.serialString()).append("> ").append(requestToString(rilrequest.mRequest)).toString());
- rilrequest.mp.writeInt(2);
+ rilrequest.mp.writeString(mAid);
rilrequest.mp.writeString(s);
rilrequest.mp.writeString(s1);
send(rilrequest);
@@ -3579,7 +3628,7 @@
{
RILRequest rilrequest = RILRequest.obtain(5, message);
riljLog((new StringBuilder()).append(rilrequest.serialString()).append("> ").append(requestToString(rilrequest.mRequest)).toString());
- rilrequest.mp.writeInt(2);
+ rilrequest.mp.writeString(mAid);
rilrequest.mp.writeString(s);
rilrequest.mp.writeString(s1);
send(rilrequest);
@@ -3708,6 +3757,8 @@
static final int RIL_MAX_COMMAND_BYTES = 8192;
static final String SOCKET_NAME_RIL = "rild";
static final int SOCKET_OPEN_RETRY_MILLIS = 4000;
+ public static IccCardApplication.AppType mAPPTYPE_VAL;
+ public static String mAid;
protected Context mContext;
protected boolean mInitialRadioStateChange;
BroadcastReceiver mIntentReceiver;
diffs in services.jar
diff -Nruw MIUI.us_passion_2.2.17/services_decom/com/android/server/HeadsetObserver.jad MIUI.us_streak_2.2.17/services_decom/com/android/server/HeadsetObserver.jad
--- MIUI.us_passion_2.2.17/services_decom/com/android/server/HeadsetObserver.jad 2012-03-10 20:40:39.000000000 +0100
+++ MIUI.us_streak_2.2.17/services_decom/com/android/server/HeadsetObserver.jad 2012-03-10 20:42:04.000000000 +0100
@@ -21,7 +21,7 @@
mContext = context;
mWakeLock = ((PowerManager)context.getSystemService("power")).newWakeLock(1, "HeadsetObserver");
mWakeLock.setReferenceCounted(false);
- startObserving("DEVPATH=/devices/virtual/switch/h2w");
+ startObserving("DEVPATH=/devices/virtual/switch/headset");
init();
}
@@ -41,8 +41,8 @@
i = mHeadsetState;
mPrevHeadsetState = mHeadsetState;
String s1;
- i = Integer.valueOf((new String(ac, 0, (new FileReader("/sys/class/switch/h2w/state")).read(ac, 0, 1024))).trim()).intValue();
- s1 = (new String(ac, 0, (new FileReader("/sys/class/switch/h2w/name")).read(ac, 0, 1024))).trim();
+ i = Integer.valueOf((new String(ac, 0, (new FileReader("/sys/class/switch/headset/state")).read(ac, 0, 1024))).trim()).intValue();
+ s1 = (new String(ac, 0, (new FileReader("/sys/class/switch/headset/name")).read(ac, 0, 1024))).trim();
s = s1;
_L1:
update(s, i);
@@ -168,9 +168,9 @@
private static final int BIT_HEADSET = 1;
private static final int BIT_HEADSET_NO_MIC = 2;
private static final int HEADSETS_WITH_MIC = 1;
- private static final String HEADSET_NAME_PATH = "/sys/class/switch/h2w/name";
- private static final String HEADSET_STATE_PATH = "/sys/class/switch/h2w/state";
- private static final String HEADSET_UEVENT_MATCH = "DEVPATH=/devices/virtual/switch/h2w";
+ private static final String HEADSET_NAME_PATH = "/sys/class/switch/headset/name";
+ private static final String HEADSET_STATE_PATH = "/sys/class/switch/headset/state";
+ private static final String HEADSET_UEVENT_MATCH = "DEVPATH=/devices/virtual/switch/headset";
private static final boolean LOG = true;
private static final int SUPPORTED_HEADSETS = 3;
private static final String TAG = com/android/server/HeadsetObserver.getSimpleName();
diff -Nruw MIUI.us_passion_2.2.17/services_decom/com/android/server/PowerManagerService.jad MIUI.us_streak_2.2.17/services_decom/com/android/server/PowerManagerService.jad
--- MIUI.us_passion_2.2.17/services_decom/com/android/server/PowerManagerService.jad 2012-03-10 20:40:46.000000000 +0100
+++ MIUI.us_streak_2.2.17/services_decom/com/android/server/PowerManagerService.jad 2012-03-10 20:42:11.000000000 +0100
@@ -17,8 +17,7 @@
import com.android.internal.app.IBatteryStats;
import com.android.internal.app.ShutdownThread;
import com.android.server.am.BatteryStatsService;
-import java.io.FileDescriptor;
-import java.io.PrintWriter;
+import java.io.*;
import java.util.*;
// Referenced classes of package com.android.server:
@@ -1142,28 +1141,47 @@
private void enableLightSensor(boolean flag)
{
- if(mSensorManager == null || mLightSensorEnabled == flag) goto _L2; else goto _L1
+ byte abyte0[];
+ FileOutputStream fileoutputstream;
+ abyte0 = new byte[2];
+ fileoutputstream = new FileOutputStream("/sys/devices/platform/mddi_auo_wvga.0/leds/lcd-backlight/mode");
+ Slog.e("PowerManagerService", (new StringBuilder()).append("enableLightSensor ").append(flag).append(" ").append(mUseSoftwareAutoBrightness).toString());
+ abyte0[0] = 109;
+ if(!flag) goto _L2; else goto _L1
_L1:
+ int i = 53;
+_L7:
+ abyte0[1] = (byte)i;
+ fileoutputstream.write(abyte0);
+ fileoutputstream.close();
+_L9:
+ if(mSensorManager == null || mLightSensorEnabled == flag) goto _L4; else goto _L3
+_L3:
long l;
mLightSensorEnabled = flag;
l = Binder.clearCallingIdentity();
- if(!flag) goto _L4; else goto _L3
-_L3:
+ if(!flag) goto _L6; else goto _L5
+_L5:
mSensorManager.registerListener(mLightListener, mLightSensor, 3);
-_L6:
+_L8:
Binder.restoreCallingIdentity(l);
-_L2:
- return;
_L4:
+ return;
+_L2:
+ i = 50;
+ goto _L7
+_L6:
lightFilterStop();
mSensorManager.unregisterListener(mLightListener);
mHandler.removeCallbacks(mAutoBrightnessTask);
- if(true) goto _L6; else goto _L5
-_L5:
+ goto _L8
+ Exception exception1;
+ exception1;
+ Binder.restoreCallingIdentity(l);
+ throw exception1;
Exception exception;
exception;
- Binder.restoreCallingIdentity(l);
- throw exception;
+ goto _L9
}
private void enableProximityLockLocked()
@@ -1820,6 +1838,11 @@
flag = true;
else
flag = false;
+ if(mAutoBrightessEnabled != flag)
+ {
+ mAutoBrightessEnabled = flag;
+ enableLightSensor(mAutoBrightessEnabled);
+ }
if(mUseSoftwareAutoBrightness && mAutoBrightessEnabled != flag)
{
mAutoBrightessEnabled = flag;
@@ -1895,6 +1918,7 @@
else
l = 0L;
mLastScreenOnTime = l;
+ enableLightSensor(mAutoBrightessEnabled);
if(!mUseSoftwareAutoBrightness) goto _L2; else goto _L3
_L3:
enableLightSensor(flag);
@@ -2870,6 +2894,7 @@
mUnplugTurnsOnScreen = resources.getBoolean(0x10d0007);
mFlashlightAffectsLightSensor = resources.getBoolean(0x10d0016);
mUseSoftwareAutoBrightness = resources.getBoolean(0x10d0005);
+ mUseSoftwareAutoBrightness = false;
if(mUseSoftwareAutoBrightness)
{
mAutoBrightnessLevels = resources.getIntArray(0x1070019);
@@ -3374,6 +3399,7 @@
long l;
mSensorManager = new SensorManager(mHandlerThread.getLooper());
mProximitySensor = mSensorManager.getDefaultSensor(8);
+ enableLightSensor(true);
if(mUseSoftwareAutoBrightness)
{
mLightSensor = mSensorManager.getDefaultSensor(5);
diffs in android.policy.jar
diff -Nruw MIUI.us_passion_2.2.17/android.policy_decom/com/android/internal/policy/impl/PhoneWindowManager.jad MIUI.us_streak_2.2.17/android.policy_decom/com/android/internal/policy/impl/PhoneWindowManager.jad
--- MIUI.us_passion_2.2.17/android.policy_decom/com/android/internal/policy/impl/PhoneWindowManager.jad 2012-03-10 20:48:33.000000000 +0100
+++ MIUI.us_streak_2.2.17/android.policy_decom/com/android/internal/policy/impl/PhoneWindowManager.jad 2012-03-10 20:49:41.000000000 +0100
@@ -1532,6 +1532,7 @@
}
if(flag1 && j1 == 0)
{
+ performHapticFeedbackLw(null, 1, false);
mHandler.postDelayed(mHomeLongPress, ViewConfiguration.getGlobalActionKeyTimeout());
mHomePressed = true;
}
@@ -1540,6 +1541,8 @@
}
if(k == 4)
{
+ if(flag1 && j1 == 0)
+ performHapticFeedbackLw(null, 1, false);
android.view.WindowManager.LayoutParams layoutparams;
if(windowstate != null)
layoutparams = windowstate.getAttrs();
@@ -1579,13 +1582,17 @@
}
if(k == 82)
{
- if(flag1 && j1 == 0 && mEnableShiftMenuBugReports && (i1 & 1) == 1)
+ if(flag1 && j1 == 0)
+ {
+ performHapticFeedbackLw(null, 1, false);
+ if(mEnableShiftMenuBugReports && (i1 & 1) == 1)
{
Intent intent1 = new Intent("android.intent.action.BUG_REPORT");
mContext.sendOrderedBroadcast(intent1, null);
flag4 = true;
continue; /* Loop/switch isn't completed */
}
+ }
} else
if(k == 84)
if(flag1)
Questions or Problems Should Not Be Posted in the Development Forum
Please Post in the Correct Forums & Read the Forum Rules
Moving to Q&A

[Q] how to restore a deleted application without the usb debug ?

My question is very simple and hopefully the great teachers in this forum can answer.
how to go and change the file in system / build.prop without activating usb debuging?
how to restore all my apps in / system / which have been erased without activating usb debuging?
<< ycusoy | http://admin-belajar.blogspot.com >>
Bonus: text mouse rotate
Code:
<style type="text/css">
/* Circle Text Styles */
#outerCircleText {
/* Optional - DO NOT SET FONT-SIZE HERE, SET IT IN THE SCRIPT */
font-style: italic;font-weight: bold;font-family: 'comic sans ms', verdana, arial;color: #000;
/* End Optional *//* Start Required - Do Not Edit*/
position: absolute;top: 0;left: 0;z-index: 3000;cursor: default;}#outerCircleText div {position: relative;}#outerCircleText div div {position: absolute;top: 0;left: 0;text-align: center;}
/* End Required *//* End Circle Text Styles */
</style>
<script type="text/javascript">
;(function(){ // Your message here (QUOTED STRING)
var msg = "http://forum.xda-developers.com/editpost.php?do=editpost&postid=26043694";
/* THE REST OF THE EDITABLE VALUES BELOW ARE ALL UNQUOTED NUMBERS */// Set font's style size for calculating dimensions// Set to number of desired pixels font size (decimal and negative numbers not allowed)
var size = 14;
// Set both to 1 for plain circle, set one of them to 2 for oval// Other numbers & decimals canhave interesting effects, keep these low (0 to 3)
var circleY = 0.75; var circleX = 2;
// The larger this divisor, the smaller the spaces between letters// (decimals allowed, not negative numbers)
var letter_spacing = 5;
// The larger this multiplier, the bigger the circle/oval// (decimals allowed, not negative numbers, some rounding is applied)
var diameter = 10; // Rotation speed, set it negative if you want it to spin clockwise (decimals allowed)
var rotation = 0.4; // This is not the rotation speed,its the reaction speed, keep low!// Set this to 1 or a decimal less than one (decimals allowed, not negative numbers)
var speed = 0.3;
////////////////////// Stop Editing //////////////////////
if (!window.addEventListener &&!window.attachEvent ||!document.createElement) return;msg = msg.split('');var n = msg.length - 1, a = Math.round(size * diameter * 0.208333), currStep = 20,ymouse = a * circleY + 20, xmouse = a * circleX + 20, y = [], x = [], Y = [], X = [],o = document.createElement('div'), oi= document.createElement('div'),b = document.compatMode && document.compatMode !="BackCompat"? document.documentElement : document.body,mouse = function(e){e = e || window.event;ymouse = !isNaN(e.pageY)? e.pageY : e.clientY;
//
y-positionxmouse = !isNaN(e.pageX)? e.pageX : e.clientX;
//
x-position},makecircle = function(){
// rotation/positioning
if(init.nopy){ o.style.top = (b || document.body).scrollTop + 'px'; o.style.left = (b || document.body).scrollLeft + 'px';};currStep -= rotation;for (var d, i = n; i > -1; --i){
// makes the circle
d = document.getElementById('iemsg'+ i).style; d.top = Math.round(y[i] + a * Math.sin((currStep + i) / letter_spacing) * circleY - 15) + 'px'; d.left = Math.round(x[i] + a * Math.cos((currStep + i) / letter_spacing) * circleX) + 'px';};},drag = function(){
// makes the resistancey
[0] = Y[0] += (ymouse - Y[0]) * speed;x[0] = X[0] += (xmouse - 20 - X[0]) * speed;for (var i = n; i > 0; --i){ y[i] = Y[i] += (y[i-1] - Y[i]) * speed; x[i] = X[i] += (x[i-1] - X[i]) * speed;};makecircle();},init = function(){
// appends message divs, & sets initial values for positioning arrays
if(!isNaN(window.pageYOffset)){ ymouse += window.pageYOffset; xmouse += window.pageXOffset;} else init.nopy = true;for (var d, i = n; i > -1; --i){ d = document.createElement('div'); d.id = 'iemsg' + i; d.style.height = d.style.width = a+ 'px'; d.appendChild(document.createTextNode(msg[i])); oi.appendChild(d); y[i] = x[i] = Y[i]= X[i] = 0;};o.appendChild(oi); document.body.appendChild(o);setInterval(drag, 25);},ascroll = function(){ymouse += window.pageYOffset;xmouse += window.pageXOffset;window.removeEventListener('scroll', ascroll, false);};o.id = 'outerCircleText'; o.style.fontSize = size + 'px';if (window.addEventListener){window.addEventListener('load', init, false);document.addEventListener('mouseover', mouse, false);document.addEventListener('mousemove', mouse, false); if (/Apple/.test(navigator.vendor)) window.addEventListener('scroll', ascroll, false);}else if (window.attachEvent){window.attachEvent('onload', init);document.attachEvent('onmousemove', mouse);};})();</script>
paste before closing tag </head>

How to add Admob in Custom Dialog?

Hi guys!
I'm trying to implement Admob banner in Custom Dialog box.
I want to make in in XML 'cause i'm thinking this is simplier to change it positions etc.
So here is fragment from my GameActivity where is Custom Dialog too.
Fragment with dialog:
Code:
public void showRestartDialog() {
final Dialog dialog = new Dialog(GameActivity.this);
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.getWindow().setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT));
dialog.setContentView(R.layout.activity_dialog);
//set up image view
ImageView img = (ImageView) dialog.findViewById(R.id.imageView1);
img.setImageResource(R.drawable.puste);
int highest = PrefUtil.getHighestScore(this);
String text = null;
if (currentPoint > highest) {
highest = currentPoint;
PrefUtil.setHighestScore(this, currentPoint);
} else {
}
text = "\n " + currentPoint + "\n\n " + highest;
TextView text1 = (TextView)
dialog.findViewById(R.id.TextView01);
text1.setText(text);
[B] AdView adView = (AdView)dialog.findViewById(R.id.adView);
AdRequest adRequest = new AdRequest.Builder().build();
adView.loadAd(adRequest);[/B]
Where is a problem? With this code, the dialog is showing but without banner.
Help me please!
Greetings!
PS. If You need more code, please tell me.

Categories

Resources