General [CLOSED] AOSP support -- working AOSP12 built from source. - Google Pixel 6 Pro

Here is a build of AOSP12r14
This is SD1A.210817.037
{Mod edit: Link removed}
Run flash-base.sh from the corresponding factory image to update bootloader and radio if you like.
Use "fastboot update" to install.
Very minor changes from pure AOSP;
1) selinux is permissive because I haven't got around to fixing a glitch.
2) Dialer/Messaging/Contacts have selective picks from lineageos for dark mode.
3) Dialer includes automatic call recording per the following;
Code:
From 945c17eabfdf9f108b26eda3d54266c0a2255234 Mon Sep 17 00:00:00 2001
Date: Mon, 8 Nov 2021 14:17:51 -0500
Subject: [PATCH] Automatic call recording
Change-Id: Icdb26fa6729e6a13dc6190a42dc75453900a6345
---
.../dialer/app/res/values/cm_strings.xml | 2 ++
.../dialer/app/res/xml/sound_settings.xml | 5 ++++
.../dialer/callrecord/res/values/config.xml | 4 +--
.../android/incallui/CallButtonPresenter.java | 30 +++++++++++++++++--
4 files changed, 37 insertions(+), 4 deletions(-)
diff --git a/java/com/android/dialer/app/res/values/cm_strings.xml b/java/com/android/dialer/app/res/values/cm_strings.xml
index 1dcdb2b81..3f7602d44 100644
--- a/java/com/android/dialer/app/res/values/cm_strings.xml
+++ b/java/com/android/dialer/app/res/values/cm_strings.xml
@@ -38,6 +38,8 @@
<string name="call_recording_format">Audio format</string>
<string name="wb_amr_format" translatable="false">AMR-WB</string>
<string name="aac_format" translatable="false">AAC</string>
+ <string name="auto_call_recording_title">Auto call recording</string>
+ <string name="auto_call_recording_key" translatable="false">auto_call_recording</string>
<string name="call_via">Call via</string>
<string name="call_via_dialog_title">Call via\u2026</string>
diff --git a/java/com/android/dialer/app/res/xml/sound_settings.xml b/java/com/android/dialer/app/res/xml/sound_settings.xml
index aa025874f..d31ea9e5c 100644
--- a/java/com/android/dialer/app/res/xml/sound_settings.xml
+++ b/java/com/android/dialer/app/res/xml/sound_settings.xml
@@ -83,6 +83,11 @@
android:entryValues="@array/call_recording_encoder_values"
android:defaultValue="0" />
+ <SwitchPreference
+ android:defaultValue="false"
+ android:key="@string/auto_call_recording_key"
+ android:title="@string/auto_call_recording_title"/>
+
</PreferenceCategory>
</PreferenceScreen>
diff --git a/java/com/android/dialer/callrecord/res/values/config.xml b/java/com/android/dialer/callrecord/res/values/config.xml
index 7aabd6cac..2832c87bc 100644
--- a/java/com/android/dialer/callrecord/res/values/config.xml
+++ b/java/com/android/dialer/callrecord/res/values/config.xml
@@ -16,8 +16,8 @@
-->
<resources>
- <bool name="call_recording_enabled">false</bool>
+ <bool name="call_recording_enabled">true</bool>
<!-- 1 (MIC) for microphone audio source (default)
4 (VOICE_CALL) if supported by device for voice call uplink + downlink audio source -->
- <integer name="call_recording_audio_source">1</integer>
+ <integer name="call_recording_audio_source">4</integer>
</resources>
diff --git a/java/com/android/incallui/CallButtonPresenter.java b/java/com/android/incallui/CallButtonPresenter.java
index 0fa833edd..175fe7cc2 100644
--- a/java/com/android/incallui/CallButtonPresenter.java
+++ b/java/com/android/incallui/CallButtonPresenter.java
@@ -21,6 +21,7 @@ import android.content.Context;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.os.Bundle;
+import android.os.Handler;
import android.os.Trace;
import android.preference.PreferenceManager;
import android.support.v4.app.Fragment;
@@ -74,6 +75,7 @@ public class CallButtonPresenter
private DialerCall call;
private boolean isInCallButtonUiReady;
private PhoneAccountHandle otherAccount;
+ private boolean isRecording = false;
private CallRecorder.RecordingProgressListener recordingProgressListener =
new CallRecorder.RecordingProgressListener() {
@@ -114,6 +116,11 @@ public class CallButtonPresenter
CallRecorder recorder = CallRecorder.getInstance();
recorder.addRecordingProgressListener(recordingProgressListener);
+ if(recorder.isRecording()){
+ inCallButtonUi.setCallRecordingState(true);
+ } else {
+ inCallButtonUi.setCallRecordingState(false);
+ }
// Update the buttons state immediately for the current call
onStateChange(InCallState.NO_CALLS, inCallPresenter.getInCallState(), CallList.getInstance());
@@ -144,6 +151,8 @@ public class CallButtonPresenter
@Override
public void onStateChange(InCallState oldState, InCallState newState, CallList callList) {
Trace.beginSection("CallButtonPresenter.onStateChange");
+ CallRecorder recorder = CallRecorder.getInstance();
+ boolean isEnabled = PreferenceManager.getDefaultSharedPreferences(context).getBoolean(context.getString(R.string.auto_call_recording_key), false);
if (call != null) {
call.removeListener(this);
}
@@ -152,6 +161,16 @@ public class CallButtonPresenter
} else if (newState == InCallState.INCALL) {
call = callList.getActiveOrBackgroundCall();
+ if (!isRecording && isEnabled && call != null) {
+ isRecording = true;
+ new Handler().postDelayed(new Runnable() {
+ @Override
+ public void run() {
+ callRecordClicked(true);
+ }
+ }, 500);
+ }
+
// When connected to voice mail, automatically shows the dialpad.
// (On previous releases we showed it when in-call shows up, before waiting for
// OUTGOING. We may want to do that once we start showing "Voice mail" label on
@@ -167,6 +186,9 @@ public class CallButtonPresenter
}
call = callList.getIncomingCall();
} else {
+ if (isEnabled && recorder.isRecording()) {
+ recorder.finishRecording();
+ }
call = null;
}
@@ -337,6 +359,7 @@ public class CallButtonPresenter
public void callRecordClicked(boolean checked) {
CallRecorder recorder = CallRecorder.getInstance();
if (checked) {
+ /*
final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
boolean warningPresented = prefs.getBoolean(KEY_RECORDING_WARNING_PRESENTED, false);
if (!warningPresented) {
@@ -354,6 +377,10 @@ public class CallButtonPresenter
} else {
startCallRecordingOrAskForPermission();
}
+ */
+ if(!recorder.isRecording()) {
+ startCallRecordingOrAskForPermission();
+ }
} else {
if (recorder.isRecording()) {
recorder.finishRecording();
@@ -566,8 +593,7 @@ public class CallButtonPresenter
&& call.getState() != DialerCallState.CONNECTING;
final CallRecorder recorder = CallRecorder.getInstance();
- final boolean showCallRecordOption = recorder.canRecordInCurrentCountry()
- && !isVideo && call.getState() == DialerCallState.ACTIVE;
+ final boolean showCallRecordOption = !isVideo && call.getState() == DialerCallState.ACTIVE;
otherAccount = TelecomUtil.getOtherAccount(getContext(), call.getAccountHandle());
boolean showSwapSim =
--
2.27.0

Its happening.
refs/heads/android12-d1-s4-release - device/google/gs101 - Git at Google
refs/heads/android12-d1-s4-release - device/google/raviole - Git at Google
refs/heads/android12-d1-s4-release - device/google/raviole-kernel - Git at Google
refs/heads/android-gs-raviole-5.10-android12-d1 - kernel/gs - Git at Google
etc.
Apparently "raviole" is what you get when you cross a "raven" with an "oriole"

96carboard said:
Its happening.
refs/heads/android12-d1-s4-release - device/google/gs101 - Git at Google
refs/heads/android12-d1-s4-release - device/google/raviole - Git at Google
refs/heads/android12-d1-s4-release - device/google/raviole-kernel - Git at Google
refs/heads/android-gs-raviole-5.10-android12-d1 - kernel/gs - Git at Google
etc.
Apparently "raviole" is what you get when you cross a "raven" with an "oriole"
Click to expand...
Click to collapse
Let the games begin....

Now its tagged android-12.0.0_r4
That means it should be sync/buildable now.
Nope, not yet, soon. Apparently the balance of r4 isn't available yet.

Pixel has had very poor aftermarket custom ROM support since the beginning.
Most devs just aren't interested in it. Would be nice if that changes with the 6 series but I won't get my hopes up.

CZ Eddie said:
Pixel has had very poor aftermarket custom ROM support since the beginning.
Most devs just aren't interested in it. Would be nice if that changes with the 6 series but I won't get my hopes up.
Click to expand...
Click to collapse
What are you talking about? ONLY Nexus/Pixel is supported by AOSP.

96carboard said:
What are you talking about? ONLY Nexus/Pixel is supported by AOSP.
Click to expand...
Click to collapse
I don't understand your response.
I've been flashing custom ROM's since the Samsung Skyrocket and while development has generally fallen off a cliff since those days, there are some phones with more active support and Pixel has not been one of the leaders in this regard.
Go look at OnePlus forums and compare custom (not customized stock) ROM quantity to any of the Pixel phone forums.

CZ Eddie said:
I don't understand your response.
I've been flashing custom ROM's since the Samsung Skyrocket and while development has generally fallen off a cliff since those days, there are some phones with more active support and Pixel has not been one of the leaders in this regard.
Go look at OnePlus forums and compare custom (not customized stock) ROM quantity to any of the Pixel phone forums.
Click to expand...
Click to collapse
That's not support, that's broken crap made by people who are so pissed off with the LACK of support that they do it themselves. Kind-of.
Nexus/Pixel are *ACTUALLY* supported in AOSP. You don't need broken hacker projects to make them work. You repo init, repo sync, lunch, make, install.
EDIT: This is AOSP - https://android.googlesource.com/?format=HTML
If your device isn't in there, then its not supported.
The primary reason you buy a Nexus/Pixel is *BECAUSE* it is supported in there and doesn't depend on hacks.

r4 is now all up, time to sync and build from source!

96carboard said:
r4 is now all up, time to sync and build from source!
Click to expand...
Click to collapse
i'm seeing r4 - r7 or am i just dumb?

plasticarmyman said:
i'm seeing r4 - r7 or am i just dumb?
Click to expand...
Click to collapse
There are 4 factory system images available. Maybe they correspond.

Interesting, there seem to be 3 variations. Regular, 64-bit only, and pKVM. The second wont run 32bit code and will therefore create compatibility problems. The last... protected kernel based virtual machine... no idea what the implication is.

I wish I could justify a high end SSD for my build server. Been just sitting here for several minutes waiting for lunch just to spit out the build menu.
And of course, what comes up is aosp_slider-userdebug and aosp_whitefin-userdebug. So... the bootloader version says "slider-1.0-7753224".
The build files for slider don't correspond to what's on the filesystem.
Going to try....
```lunch aosp_raven-userdebug```
And mustn't forget the propblobs.... https://developers.google.com/android/drivers
This looks familiar... BUILD_ID=SD1A.210817.019.C4
Note that its r7 I'm building.
Made it past the first stage of build, now its actually compiling stuff.
[ 3% 4357/125906] build ..... etc.
Hopefully when I look in the morning it will be built and working and not a broken mess.

So, it built and it installed and it sort-of works.
When I put in the sim card, it did a bunch of strange reboot and wipes, but eventually booted. Checked the logs and it was going crazy with a couple of selinux denials;
[ 38.787756] type=1400 audit(1635512778.460:87): avc: denied { read } for comm="pool-3-thread-1" name="ubject_r:vendor_rild_prop:s0" dev="tmpfs" ino=326 scontext=u:rlatform_app:s0:c512,c768 tcontext=ubject_r:vendor_rild_prop:s0 tclass=file permissive=0 app=com.shannon.imsservice
[ 38.788763] type=1107 audit(1635512778.464:88): uid=0 auid=4294967295 ses=4294967295 subj=u:r:init:s0 msg='avc: denied { set } for property=persist.vendor.radio.call_waiting_for_sync_0 pid=4573 uid=10086 gid=10086 scontext=u:rlatform_app:s0:c512,c768 tcontext=ubject_r:vendor_rild_prop:s0 tclass=property_service permissive=0'
Setting it to permissive briefly (i.e. # setenforce 0) lets it do what it has to do.
Not too bad for a first try!
Download: <removed, out of date. See first post.>
UPDATE!!!
Here's a vendor_boot.img (fastboot flash vendor_boot vendor_boot.img) that sets selinux to permissive:
<removed, out of date. See first post.>
That pretty much makes it all work. Obviously making it enforce is better, but this at least is usable now.

Sweet! I think this phone will get alot of love. The hardware is great. The price is right. This will be a great year or so. Until I get antsy and get the Pixel 7 Pro

Since I have AOSP running nicely on this phone, I've started really liking it (really hated it with all the google [bloat|spy]ware. Previously was using a Nexus 6 over Pixel 2XL because of its width. I was a little worried because this phone isn't quite as wide as the N6, but turns out its close enough that I can't really tell the difference.
Really working well.
The only issue I'm having is that the wide angle camera isn't available, which I think is because no camera software I've been able to find has been able to send a zoom level of 0.7 to the hal. The hal switches dynamically between the normal and telephoto based on zoom level.

I think i might try doing aosp (i dont know where to start, but ill try fastboot flash), but have you tried the GrapheneOS camera app? (https://github.com/GrapheneOS/Camera) I have tried the one from here (
https://twitter.com/i/web/status/1454715561368227843) and it works, but i am not sure about on AOSP.

I've just found out that you can flash aosp from flash.android.com
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}

AlexDalas said:
I've just found out that you can flash aosp from flash.android.comView attachment 5445805
Click to expand...
Click to collapse
dont think this is AOSP.

tids2k said:
dont think this is AOSP.
Click to expand...
Click to collapse
I am not sure if it is AOSP (think it is, but can never be so sure), but it doesn't have gapps so it's doable for me
edit: i am getting micro g working hopefully

Related

[DEV][08/May/2013]HD2 off-mode Alarm Clock(cLK)[WIP]

This is an experiment - project. It is about adding off-mode alarm clock to the HD2.
(If you don't have cLK installed (at least v1.5.1.4), then this is not applicable for you)
kokotas said:
Is it even possible to include something like auto-power-on in cLK, for alarm clock purposes?
Click to expand...
Click to collapse
After ~10 months, zicoxx asked more or less the same thing:
zicoxx said:
i want to suggest a feature for clk and our hd2..offline alarms
Click to expand...
Click to collapse
So lets see what we have so far...
This project depends on 3 factors, (1)Kernel, (2)Android application, (3)Bootloader.
Kernel
The kernel has a function in arch\arm\mach-msm\pm.c which handles the reboot reason:
Code:
static int msm_reboot_call(struct notifier_block *this, unsigned long code, void *_cmd)
{
if((code == SYS_RESTART) && _cmd) {
char *cmd = _cmd;
if (!strcmp(cmd, "bootloader")) {
restart_reason = 0x77665500;
} else if (!strcmp(cmd, "recovery")) {
restart_reason = 0x77665502;
} else if (!strcmp(cmd, "eraseflash")) {
restart_reason = 0x776655EF;
} else if (!strncmp(cmd, "oem-", 4)) {
unsigned code = simple_strtoul(cmd + 4, 0, 16) & 0xff;
restart_reason = 0x6f656d00 | code;
[COLOR="YellowGreen"]
//This is the proposed patch to our kernel
//(thanks Rick_1995 for suggesting it to bypass the time limit of 255 min)
} else if (!strncmp(cmd, "S", 1)) {
unsigned code = simple_strtoul(cmd + 1, 0, 16) & 0x00ffffff;
restart_reason = 0x53000000 | code;
[/COLOR]
} else if (!strcmp(cmd, "force-hard")) {
restart_reason = 0x776655AA;
} else {
restart_reason = 0x77665501;
}
}
return NOTIFY_DONE;
}
Not being able to compile a new kernel with a change like the green text in the above function, I just used the "oem-" prefix in the reboot reason passed from the application. The downside of this is that we can't set an alarm for more than 255 min from the current time.
Application
The application is able to:
reboot the device using the PowerManager class since it is signed and placed in /system/app:
Code:
//MinutesToSuspend is set using a TimePicker
mPowerManager.reboot("oem-" + MinutesToSuspend);
[COLOR="YellowGreen"]
//In case we have a kernel with the above patch included
mPowerManager.reboot("S" + MinutesToSuspend);[/COLOR]
play the alarm when the device has booted usind the BroadcastReceiver class that will get the BOOT_COMPLETED action.
Bootloader
The bootloader (in this case cLK):
detects the boot reason and decodes the MinutesToSuspend from it and enters a sort of suspend mode with a timeout equal to MinutesToSuspend converted to msec
Code:
if(target_check_reboot_mode() == (target_check_reboot_mode() | 0x6f656d00)) {
char str[16];
char *endptr;
unsigned MinutesToSuspend;
unsigned msecToSuspend = 0;
// Decode the MinutesToSuspend from the reboot_mode
sprintf(str, "%i", (target_check_reboot_mode() ^ 0x6f656d00));
MinutesToSuspend = strtol(str, &endptr, 16);
if (MinutesToSuspend < 3)
msecToSuspend = (MinutesToSuspend * 60000);
else
msecToSuspend = (MinutesToSuspend * 60000) - (120000);
suspend_time = msecToSuspend;
show_multi_boot_screen = 0;
boot_into_recovery = 0;
}
[COLOR="YellowGreen"]
//In case we have a kernel with the above patch included
#define MARK_ALARM_TAG 0x53000000
if(target_check_reboot_mode() & 0xFF000000 == MARK_ALARM_TAG) {
uint32_t MinutesToSuspend;
// Decode the MinutesToSuspend from the reboot_mode
MinutesToSuspend = target_check_reboot_mode() ^ MARK_ALARM_TAG;
if (MinutesToSuspend > 3)
MinutesToSuspend -= 2;
suspend_time = MinutesToSuspend * 60000;
show_multi_boot_screen = 0;
boot_into_recovery = 0;
}
[/COLOR]
if(suspend_time) {
msm_acpu_clock_init(1); // 384MHz (acpu_freq_tbl[0])
//Could try setting cpu clock at 245...
//msm_acpu_clock_init(0); // 245MHz (acpu_freq_tbl[0])
htcleo_suspend(suspend_time);
}
the suspend mode is implemented using this function
Code:
#define DS2746_SAFE_CHG_VOLTAGE 4200 // mV
void htcleo_suspend(unsigned timeout)
{
uint32_t voltage;
//int16_t current;
bool usb_cable_connected;
time_t start_time;
start_time = current_time();
if (timeout)
htcleo_panel_bkl_pwr(0);
do {
//current = ds2746_current(DS2746_I2C_SLAVE_ADDR, 1200);
voltage = ds2746_voltage(DS2746_I2C_SLAVE_ADDR);
usb_cable_connected = htcleo_usb_online();
if (usb_cable_connected) {
if (voltage < DS2746_SAFE_CHG_VOLTAGE) {
// If battery needs charging, set new charger state
if (htcleo_ac_online()) {
if (htcleo_charger_state() != CHG_AC ) {
writel(0x00080000, USB_USBCMD);
ulpi_write(0x48, 0x04);
htcleo_set_charger(CHG_AC);
}
} else {
if (htcleo_charger_state() != CHG_USB_LOW ) {
writel(0x00080001, USB_USBCMD);
mdelay(10);
htcleo_set_charger(CHG_USB_LOW);
}
}
// Led = solid amber
if (htcleo_notif_led_mode != 2)
thread_resume(thread_create("htcleo_notif_led_set_mode_2",
&htcleo_notif_led_set_mode,
(void *)2,
HIGH_PRIORITY,
DEFAULT_STACK_SIZE));
} else {
// Battery is full
if(timeout) {
// Set charger state to CHG_OFF_FULL_BAT
if (htcleo_charger_state() != CHG_OFF_FULL_BAT ) {
writel(0x00080001, USB_USBCMD);
mdelay(10);
htcleo_set_charger(CHG_OFF_FULL_BAT);
}
// and turn led solid green
if (htcleo_usb_online() && (htcleo_notif_led_mode != 1))
thread_resume(thread_create("htcleo_notif_led_set_mode_1",
&htcleo_notif_led_set_mode,
(void *)1,
HIGH_PRIORITY,
DEFAULT_STACK_SIZE));
} else {
// exit while if we don't have a timeout
break;
}
}
} else {
// Set charger state to CHG_OFF
if (htcleo_charger_state() != CHG_OFF ) {
writel(0x00080001, USB_USBCMD);
mdelay(10);
htcleo_set_charger(CHG_OFF);
}
// and turn off led
if (htcleo_notif_led_mode != 0)
thread_resume(thread_create("htcleo_notif_led_set_off",
&htcleo_notif_led_set_mode,
(void *)0,
HIGH_PRIORITY,
DEFAULT_STACK_SIZE));
}
// While in loop keep tracking if POWER button is pressed
// in order to (re)boot the device
for (int i=0; i<6; i++) {
if(keys_get_state(KEY_POWER)!=0) {
target_reboot(0);
return;//:)
}
mdelay(96);//total delay ~500ms per loop
}
// And check if timeout exceeded in order to reboot
if (timeout && (current_time() - start_time >= timeout))
target_reboot(0);
} while ( (usb_cable_connected) /* && current >= 0) */
||(timeout) ); // If we have a timeout this while-loop never breaks if we don't reboot.
// Double check voltage
mdelay(10);
voltage = ds2746_voltage(DS2746_I2C_SLAVE_ADDR);
if (voltage < DS2746_SAFE_CHG_VOLTAGE) {
// If battery is not full then
// EITHER the cable is unplugged
// OR the double check of voltage gave us
// a value less than the safe voltage.
// Set charger state to CHG_OFF
writel(0x00080001, USB_USBCMD);
mdelay(10);
htcleo_set_charger(CHG_OFF);
} else {
// If battery is full
// set charger state to CHG_OFF_FULL_BAT
writel(0x00080001, USB_USBCMD);
mdelay(10);
htcleo_set_charger(CHG_OFF_FULL_BAT);
// and turn led solid green
if (htcleo_usb_online() && (htcleo_notif_led_mode != 1))
thread_resume(thread_create("htcleo_notif_led_set_mode_1",
&htcleo_notif_led_set_mode,
(void *)1,
HIGH_PRIORITY,
DEFAULT_STACK_SIZE));
// While usb cable is connected
// keep tracking if POWER button is pressed OR timeout exceeded
// in order to (re)boot the device
while (htcleo_usb_online()) {
if(keys_get_state(KEY_POWER)!=0)
target_reboot(0);
/* if (timeout && (current_time() - start_time >= timeout))
break; */
}
}
// If we've set a timeout and reached it, reboot the device
/* if (timeout && (current_time() - start_time >= timeout))
target_reboot(0); */
// Shutdown the device
enter_critical_section();
platform_exit();
msm_proc_comm(PCOM_POWER_DOWN, 0, 0);
for (;;) ;
}
Any suggestions or observations are welcomed!
This is open for everyone to use or contribute. Source is available at https://github.com/n0d3/HD2_Alarm_Clock
If you have to ask for an apk to test, then you may download this example's apk from here.But don't consider this as an application release thread.
Bazinga
Should I say first or something? Anyway, testing with ~.7 clk now
Thank you!
THANKS KOKOTAS to make it possible also if it is an experiment..
almost you try if it's possible to use it in our beloved hd2
now i try it,and test this version..
however there is an app for samsung phone developer from chainfire team nomoarpowah that use offline charging mode for alarm..
maybe you can check that app to see if can use something
i hope that OUR WONDERFUL DEVELOPER can do another miracle..
I think since Android is between us, make a wake up alarm is really hard to do. Because we need a sub level software such as a boot loader, that listen the internal clock to turn on the device when established. I hope that you will win this challenge bro
All the best !
Although I think this Will be difficult...
zicoxx said:
THANKS KOKOTAS to make it possible also if it is an experiment..
almost you try if it's possible to use it in our beloved hd2
now i try it,and test this version..
however there is an app for samsung phone developer from chainfire team nomoarpowah that use offline charging mode for alarm..
maybe you can check that app to see if can use something
i hope that OUR WONDERFUL DEVELOPER can do another miracle..
Click to expand...
Click to collapse
Chainfire use the charging deamon to include his project. Because we doesnt see source which are availible for the HD2 we couldnt build something like this. Another point would be that the device comes original by windows Mobile so the process completly differs like bootloader/ init by spl/ availible functions !
If you Test chainfire app and read the thread you readout that most of them completly new written coded.
Alarm is integrated into new charging deamon so it doesnt fire device to boot up normal android ...
See it like another very small System work completly alone if device is off (charging)
Sent from my GT-I9300 using xda app-developers app
tb-killa said:
Chainfire use the charging deamon to include his project. Because we doesnt see source which are availible for the HD2 we couldnt build something like this. Another point would be that the device comes original by windows Mobile so the process completly differs like bootloader/ init by spl/ availible functions !
If you Test chainfire app and read the thread you readout that most of them completly new written coded.
Alarm is integrated into new charging deamon so it doesnt fire device to boot up normal android ...
See it like another very small System work completly alone if device is off (charging)
Sent from my GT-I9300 using xda app-developers app
Click to expand...
Click to collapse
If you look closely, It should work already and NOT require any of chainfire's work. cLK is open source, Linux is open source, Android is open source (atleast the part related to this). The only issue you might think of is that the core will be in wfi state instead of pc, unless kokotas has fixed pc in clk.
kokotas said:
Code:
unsigned code = simple_strtoul(cmd + 1, 0, 16) & 0xff000000;
Click to expand...
Click to collapse
Don't you think it should be
Code:
unsigned code = simple_strtoul(cmd + 1, 0, 16) & 0x00FFFFFF;
That's a good point.
I think booting into android to have a ring might be an issue in some cases
(bootloop, long time to boot android itself)
Using a recovery mode to quickly boot into and initiate an alarm that would be more reliable.
... at least I think
nerveless, good job and keep up the good work
Very nice work, seems like more and more people are learning to dev.
Rick_1995 said:
If you look closely, It should work already and NOT require any of chainfire's work. cLK is open source, Linux is open source, Android is open source (atleast the part related to this). The only issue you might think of is that the core will be in wfi state instead of pc, unless kokotas has fixed pc in clk.
Click to expand...
Click to collapse
I think we doesnt have sources of charging deamon for the HD2 right?
If we checked different threads we could read that htc doesnt public sources for Desire, others!
I agree that C(LK) could also do the Same job!
Sent from my GT-I9300 using xda app-developers app
tb-killa said:
I think we doesnt have sources of charging deamon for the HD2 right?
If we checked different threads we could read that htc doesnt public sources for Desire, others!
I agree that C(LK) could also do the Same job!
Sent from my GT-I9300 using xda app-developers app
Click to expand...
Click to collapse
code for charging daemon is not needed....
@kokotas, Why aren't you entering WFI state ?
You should do something like this:
Create a suspend thread and ensure there is no other thread with a higher (or the same) priority.
Inside the thread handle, there should be an infinite loop with something like this:
Code:
int suspend_task(void *args) {
int timeout_ms = (uint32_t) args;
htcleo_panel_bkl_pwr(0);
while( ! (key_pressed(KEY_POWER) && (timeout_ms <= 0)) ) {
if(usb_is_connected())
charge_device();
else
arch_idle(); // WFI
timeout_ms -= 10;
}
reboot();
return 0;
}
#define MARK_ALARM_TAG 0x53000000
void board_init(void) {
.........
uint32_t MinutesToSuspend = target_check_reboot_mode();
if((MinutesToSuspend & 0xFF000000) == MARK_ALARM_TAG) {
MinutesToSuspend &= 0x00FFFFFF;
if (MinutesToSuspend > 3)
MinutesToSuspend -= 2;
thread_create("suspend", suspend_task, (void *) (MinutesToSuspend * 60000) , HIGHEST_PRIORITY, DEFAULT_STACK_SIZE)
}
.........
}
Rick_1995 said:
@kokotas, Why aren't you entering WFI state ?
Click to expand...
Click to collapse
Honestly, never thought of Wait For Interrupt state
I'll rewrite the code based on your example and I'm thinking of creating a new branch in git in order to upload the complete source of latest cLK.
Regards!
kokotas said:
Honestly, never thought of Wait For Interrupt state
I'll rewrite the code based on your example and I'm thinking of creating a new branch in git in order to upload the complete source of latest cLK.
Regards!
Click to expand...
Click to collapse
Thanks, was wanting to update too. Just remember to create a new branch instead of an entirely new repository.
Regards
FYI.
Kernel patch arch\arm\mach-msm\pm.c in the first post has already added into my git.
It was included in my latest ICS kernel r3.6.
https://github.com/tytung/android_k...mmit/23357b2a9d64a076f1b9ac664dae209748fd5ece
tytung said:
FYI.
Kernel patch arch\arm\mach-msm\pm.c in the first post has already added into my git.
It was included in my latest ICS kernel r3.6.
https://github.com/tytung/android_k...mmit/23357b2a9d64a076f1b9ac664dae209748fd5ece
Click to expand...
Click to collapse
Thank you tytung:good:
I changed the relevant source in the application (also updated git repo) and tested successfully.
This also gave me the chance to try something else. Since it makes "oem-" prefix available to be used for other purposes, I've written another application which uses that prefix in reboot_reason for rebooting directly to any extra boot partition, with no need to press any buttons during boot-up.
Will post more info in a separate thread.
EDIT1:
Link
EDIT2:
Rick_1995 said:
Thanks, was wanting to update too. Just remember to create a new branch instead of an entirely new repository.
Regards
Click to expand...
Click to collapse
Just created new branch here.
Regards!
Thank you for your great work.I am trying to make offmode alarm work in clk 1.5.1.5 and nand rom nexushd2 v2.8
After i press set alarm device reboots but then it gives message "error:boot selection not found.an irrecoverable error found" and it boot in clk menu and stays there.I have boot,sboot partition and i select from default kernel the boot partition
clio94 said:
Thank you for your great work.I am trying to make offmode alarm work in clk 1.5.1.5 and nand rom nexushd2 v2.8
After i press set alarm device reboots but then it gives message "error:boot selection not found.an irrecoverable error found" and it boot in clk menu and stays there.I have boot,sboot partition and i select from default kernel the boot partition
Click to expand...
Click to collapse
Hi clio94,
Did you download the SysAlarm2.apk or you're still using the first one (SysAlarm.apk)?
Now that I think of it, I should remove the first one cause it will not work as expected with the last cLK.
Regards!
I tried the first version.The second version work ok.Thank you
clio94 said:
I tried the first version.The second version work ok.Thank you
Click to expand...
Click to collapse
Have you try in nand rom or nativesd ROM?
Thanks!!
Inviato dal mio multiboot HD2

I successfully built a CWM with english for P6(But i have some problem)

I can move up and down with the volume keys,But I can not use the power button controls the Enter key。So it just can move up and down but can't Confirm each command. I think the key values of this CWM is wrong.Everyone who can help me to build a CWM for P6 with correct key values and I will be very thank you.
Pictures:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
You need to modify recovery_ui.c before compiling CWM to alter KEY Mapping. Don't forget to define the below in your BoardConfig.mk beforehand.
Just swap out "KEY_MENU" for "KEY_POWER" within "recovery_ui.c"...
BoardConfig.mk:
Code:
BOARD_CUSTOM_RECOVERY_KEYMAPPING := ../../device/[B]*INSERT-MANUFACTURE-NAME[/B]/[B]*INSERT-DEVICE-NAME/recovery_ui.c[/B]
The only issue then you'll have is binding a back key map since as you know we're short a few keys, failing that build a Touch CWM recovery since this issue is addressed.
Bravo on getting a successful and bootable CWM build. Hats off to you sir.
can you help me to build a recovery Binaries.
zhenaguo said:
can you help me to build a recovery Binaries.
Click to expand...
Click to collapse
Another case is this, in BoardConfig.mk
Code:
BOARD_HAS_NO_SELECT_BUTTON := true
If you builded the cwm with their web builder, probably this is the error
can you help me to build a recovery binary.
zhenaguo said:
can you help me to build a recovery binary.
Click to expand...
Click to collapse
I can, but stickman89 know a lot more than me
Post here or pm, i'll try to help you
many thanks . i will pm to you and give you the files
zhenaguo said:
many thanks . i will pm to you and give you the files
Click to expand...
Click to collapse
I still need to complete the repo sync (i'm aroun 90%), pm it to stickman too, he already got all the enviroment set up
Either modify the existing "default_recovery_ui.c" located at [SOURCE FOLDER]/bootable/recovery/ and add the below: (Replace any existing entries if defined, do not remove unrelated entries otherwise)
Code:
int device_handle_key(int key_code, int visible) {
if (visible) {
switch (key_code) {
case KEY_DOWN:
case KEY_VOLUMEDOWN:
return HIGHLIGHT_DOWN;
case KEY_UP:
case KEY_VOLUMEUP:
return HIGHLIGHT_UP;
case KEY_ENTER:
case KEY_POWER:
return SELECT_ITEM;
}
}
return NO_ACTION;
}
for device reset after power button being pressed 5 times add the following to the same file on a new line and below the above entry:
Code:
int device_reboot_now(volatile char* key_pressed, int key_code) {
// Reboot if the power key is pressed five times in a row, with
// no other keys in between.
static int presses = 0;
if (key_code == KEY_POWER) { // power button
++presses;
return presses == 5;
} else {
presses = 0;
return 0;
}
}
or define your own recovery_ui.c via BoardConfig.mk and setup your own. Obviously were missing a return/back key so perhaps building against Touch Recovery is a better idea.
...For now the above should suffice.
Stickman89 said:
Either modify the existing "default_recovery_ui.c" located at [SOURCE FOLDER]/bootable/recovery/ and add the below: (Replace any existing entries if defined, do not remove unrelated entries otherwise)
Code:
int device_handle_key(int key_code, int visible) {
if (visible) {
switch (key_code) {
case KEY_DOWN:
case KEY_VOLUMEDOWN:
return HIGHLIGHT_DOWN;
case KEY_UP:
case KEY_VOLUMEUP:
return HIGHLIGHT_UP;
case KEY_ENTER:
case KEY_POWER:
return SELECT_ITEM;
}
}
return NO_ACTION;
}
for device reset after power button being pressed 5 times add the following to the same file on a new line and below the above entry:
Code:
int device_reboot_now(volatile char* key_pressed, int key_code) {
// Reboot if the power key is pressed five times in a row, with
// no other keys in between.
static int presses = 0;
if (key_code == KEY_POWER) { // power button
++presses;
return presses == 5;
} else {
presses = 0;
return 0;
}
}
or define your own recovery_ui.c via BoardConfig.mk and setup your own. Obviously were missing a return/back key so perhaps building against Touch Recovery is a better idea.
...For now the above should suffice.
Click to expand...
Click to collapse
I have upload the kernel and recovery.fstab to mediafire disk.There are two versions.one i named Kernel1_international_version.The others i named kernel2_Chinese_version.I am sure that each recovery.fstab of them is correct written.So,please help to to build a recovery binary for them.or you can post to someone who can do this work.I will be very thank you.Here is the link:
1.http://www.mediafire.com/download/r3zpk2cq5efv8dx/Kernel1_international_version.zip
2.http://www.mediafire.com/?eydeecerp7dzy7d
Your .fstab looks fine for international version
This **** repo still syncing
zhenaguo said:
I have upload the kernel and recovery.fstab to mediafire disk.There are two versions.one i named Kernel1_international_version.The others i named kernel2_Chinese_version.I am sure that each recovery.fstab of them is correct written.So,please help to to build a recovery binary for them.or you can post to someone who can do this work.I will be very thank you.Here is the link:
1.http://www.mediafire.com/download/r3zpk2cq5efv8dx/Kernel1_international_version.zip
2.http://www.mediafire.com/?eydeecerp7dzy7d
Click to expand...
Click to collapse
How on earth did you flash CWM Recovery without Huawei signing it?
We need to know the procedure you used and any other modifications to CWM source you specifically made in order to get this booting on our device.
Your environment is clearly working, would make more sense if you made these changes. The method
S34Qu4K3 gave in terms of a simple one line fix to BoardConfig.mk will allow CWM selection or alternatively use my method which required a bit more interaction.
I bet that's the Honor 2 CWM (or a huawei dev ;D)
What about CWM builder? Touch recovery should work right? I know, that the power button issue is in the non touch recovery provided by the builder
Zhenaguo add this line to your BoardConfig.mk: (as suggested by S34Qu4K3)
Code:
BOARD_HAS_NO_SELECT_BUTTON := true
It's that simple. If that doesn't work provide me with the following file: /bootable/recovery/default_recovery_ui.c and I'll make the required modifications for our button mapping.
Without knowing how you bypassed encryption to flash said recovery our efforts won't be at all effective.
Since your able to successfully build a bootable CWM you may as well make the above simple modification.
zhenaguo, Hello previously encountered the same problem as you, but was able to resolve it on U9510E, the machine with the same architecture. if you can help it, you would appreciate your help on my phone
Sorry for the off topic but do you think that we 'll be able to use it or as a base for the ascend mate?
ollden said:
Sorry for the off topic but do you think that we 'll be able to use it or as a base for the ascend mate?
Click to expand...
Click to collapse
i guess so. in my U9510 this apk working.

[ROM] [purely AOSP 4.4.2_r1] maguro meets KitKat & Miracast [22/12/13]

Hi, i'm tested Miracast Source and Sink on KitKat maguro.
Miracast Source
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
confirmed receiver(sink):
More Better: NEC WSBOX. http://www.n-keitai.com/n-03e/wsb.html
Good: Samsung AllShare. push back button of allshare before miracast start. The Led turns blue.
Bad: Q-WH-D1. froze sink device after p2p connection succeed
XXX unknown: i don't have Netgear PTV3000, Actiontec ScreenBeam
Miracast Sink
N4(Source) to GN(Sink)
if you have unused old GN and MHL adapter, GN become a Miracast Sink adapter
ROM-Link, some warnings.
install needed latest recovery. i'm using openrecovery-twrp-2.6.3.1-maguro.img
4.4 source code with 4.3 driver build.
gapps NOT contained.
SuperUser NOT contained.
enabled Sink feature
Graphics Glitches
ok, THIS IS MY OWN MIRA TEST ROM
TRY AT YOUR OWN RISK!
https://github.com/kensuke/How-to-Miracast-on-AOSP/wiki/Ota-packages
NEW for 4.4.2_r1
ROM: https://drive.google.com/file/d/0B1NZ-kUcUidjS2tkWEkyZk8zQ2M/edit?usp=sharing md5:aaa3c1b29d0145e65bfa055c83b69ccb
- - -
OLD for 4.4_r1
ROM: https://db.tt/6Qlwz93o md5:93b31ab0acb2e9c4bdb3a6c38f4f3728
mirror: https://docs.google.com/file/d/0B1NZ-kUcUidjVTZ3MXFtUThrdlU/edit
flashable zip for other Custom KitKat ROM
it's difficult?
other custom roms
http://forum.xda-developers.com/showpost.php?p=48802748&postcount=36
Modified Files
base src: AOSP 4.4_r1
driver files: merge 4.3
/device/samsung/*: merge AOSP 4.3_r2.2
/device/samsung/tuna/init.tuna.rc: tiny fix for Wi-Fi
/device/samsung/tuna/libsensors: tiny fix for build error
<several Miracast Patches> -> See https://github.com/kensuke/How-to-Miracast-on-AOSP/wiki
/external/wpa_supplicant_8/wpa_supplicant/p2p_supplicant.c: P2p Capability Check Skipped!!
N7 2012 also doing Miracast
http://forum.xda-developers.com/showthread.php?t=2515833
thanks!
Thanks for the new rom but the link of the rom is down
New rom must be try......tq !
Sent from my Galaxy Nexus using XDA Premium HD app
---------- Post added at 11:29 AM ---------- Previous post was at 10:48 AM ----------
Any mirror ? Dropbox error .....
Sent from my Galaxy Nexus using XDA Premium HD app
Wow....new rom!
Must try.....
Any screenshots???
Anyone tried this ROM?
Link is down, error 509 ... tested a minute ago. ..
Gesendet von meinem Galaxy Nexus mit Tapatalk 2
@s107ken Nice work dude looks like @Koush did not get this memo
Koushik Dutta - Google+ - Beta APK: AirPlay Mirroring and Screen Recording in… - http://goo.gl/WkfPZf
Caveat:
This will NOT work on any devices that don't support MiraCast, like the Galaxy Nexus. Your phone is too damn old.
aosp said:
@s107ken Nice work dude looks like @Koush did not get this memo
Koushik Dutta - Google+ - Beta APK: AirPlay Mirroring and Screen Recording in… - http://goo.gl/WkfPZf
Caveat:
This will NOT work on any devices that don't support MiraCast, like the Galaxy Nexus. Your phone is too damn old.
Click to expand...
Click to collapse
Yea, I saved this pic from the Nexus about page (GNeX) when I first got it.
-JR-
jazzruby said:
Yea, I saved this pic from the Nexus about page (GNeX) when I first got it.
-JR-
Click to expand...
Click to collapse
That's a weird graphic, as the youtube video mentions Galaxy Nexus, but the smartphone pictured is a Nexus 4 (note the bezel and the speaker location).
Anyway, it's great to know gnex is actually capable of using this technology. I'm looking forward to it being included in custom roms like cm and omni.
ilarrain said:
That's a weird graphic, as the youtube video mentions Galaxy Nexus, but the smartphone pictured is a Nexus 4 (note the bezel and the speaker location).
Anyway, it's great to know gnex is actually capable of using this technology. I'm looking forward to it being included in custom roms like cm and omni.
Click to expand...
Click to collapse
Yea, definitely appears a Nexus 4, I found the -somewhat updated- source:
http://www.android.com/versions/jelly-bean-4-2/
and a link to the 'Fast & Smooth' video (appears embedded, but not)
http://www.youtube.com/watch?v=V5E5revikUU
Anyway sorry for the interrupt; back to business :highfive:
Thanks @s107ken looking forward to this; but the link errors out:
Error (509)
This account's public links are generating too much traffic and have been temporarily disabled!
Click to expand...
Click to collapse
Oh well, try again tommorrow.
-JR-
dab_penyo said:
Wow....new rom!
Must try.....
Any screenshots???
Click to expand...
Click to collapse
this rom is AOSP with miracast only, so nothing changes from AOSP.
mirror
https://docs.google.com/file/d/0B1NZ-kUcUidjVTZ3MXFtUThrdlU/edit?usp=docslist_api
Sent from my N-03E using xda app-developers app
aosp said:
@s107ken Nice work dude looks like @Koush did not get this memo
Koushik Dutta - Google+ - Beta APK: AirPlay Mirroring and Screen Recording in… - http://goo.gl/WkfPZf
Caveat:
This will NOT work on any devices that don't support MiraCast, like the Galaxy Nexus. Your phone is too damn old.
Click to expand...
Click to collapse
Whoa!! But that's 4.3 right? This works on a stock (rooted) 4.4
Although I am curious if I can get it to work on my 4.1 rooted Photon Q LTE.
Very Cool. And I wanna know if this function can be added to CM 11??
s107ken said:
this rom is AOSP with miracast only, so nothing changes from AOSP.
mirror
https://docs.google.com/file/d/0B1NZ-kUcUidjVTZ3MXFtUThrdlU/edit?usp=docslist_api
Sent from my N-03E using xda app-developers app
Click to expand...
Click to collapse
Is this based on Android 4.4 firmware right but using Android 4.3 drivers?
Which Gapps should I use? Android 4.4 Gapps or Android 4.3 Gapps?
pcphobic said:
Is this based on Android 4.4 firmware right but using Android 4.3 drivers?
Which Gapps should I use? Android 4.4 Gapps or Android 4.3 Gapps?
Click to expand...
Click to collapse
i'm using 4.4 gapps, pa_gapps-full-4.4-20131107-signed.zip, maybe this one is a little bit old file.
"Ok Google" is working.
s107ken said:
i'm using 4.4 gapps, pa_gapps-full-4.4-20131107-signed.zip, maybe this one is a little bit old file.
"Ok Google" is working.
Click to expand...
Click to collapse
Never say never right
Can someone check whether screenrecord works for you on this ROM or not?
Type adb shell in command prompt. Then type su. Then type 'screenrecord sdcard/demo.mp4' (without quotes).
Or if you have terminal emulator installed on your phone then just open it, type su followed by the screen record command mentioned earlier.
Thank you.
Sent from my Galaxy Nexus using Tapatalk
AbhishekS said:
Can someone check whether screenrecord works for you on this ROM or not?
Type adb shell in command prompt. Then type su. Then type 'screenrecord sdcard/demo.mp4' (without quotes).
Or if you have terminal emulator installed on your phone then just open it, type su followed by the screen record command mentioned earlier.
Thank you.
Sent from my Galaxy Nexus using Tapatalk
Click to expand...
Click to collapse
try and error finish "aborted"
error found
Code:
E/MediaBuffer(1137): offset = 22, length = 34530, mSize = 34530
A/MediaBuffer(1137): frameworks/av/media/libstagefright/MediaBuffer.cpp:140 CHECK((mGraphicBuffer != NULL) || (offset + length <= mSize)) failed.
A/libc(1137): Fatal signal 6 (SIGABRT) at 0x00000471 (code=-6), thread 1137 (screenrecord)
source code
Code:
void MediaBuffer::set_range(size_t offset, size_t length) {
if ((mGraphicBuffer == NULL) && (offset + length > mSize)) {
ALOGE("offset = %d, length = %d, mSize = %d", offset, length, mSize);
}
CHECK((mGraphicBuffer != NULL) || (offset + length <= mSize)); // <--- failed this assert
mRangeOffset = offset;
mRangeLength = length;
}
force fixed? source code
Code:
void MediaBuffer::set_range(size_t offset, size_t length) {
if ((mGraphicBuffer == NULL) && (offset + length > mSize)) {
ALOGE("offset = %d, length = %d, mSize = %d", offset, length, mSize);
offset = 0; // <--- added
}
CHECK((mGraphicBuffer != NULL) || (offset + length <= mSize)); // <--- failed this assert
mRangeOffset = offset;
mRangeLength = length;
}
this is very duty fix:cyclops:
library install
Code:
$ adb root
$ adb remount
$ adb push libstagefright.so /system/lib
$ adb reboot
attach file contains demo.mp4 recorded by this ROM and fixed libstagefright.so.
i don't know this libstagefright.so applicable to another ROM like CM.
try backup before overwrite.
Thank you. It seems to be working on CM11.
Sent from my Galaxy Nexus using Tapatalk
---------- Post added at 06:18 PM ---------- Previous post was at 06:00 PM ----------
Yes it works. But the video seems to buggy. As in records perfectly fine, but you can't forward after a certain limit. The video I recorded can't be forwarded post 2:33 seconds. Though it plays fine.
The same with your video. It plays but can't be forwarded.
But great effort. Hats off to you.
Sent from my Galaxy Nexus using Tapatalk
s107ken said:
try and error finish "aborted"
error found
Code:
E/MediaBuffer(1137): offset = 22, length = 34530, mSize = 34530
A/MediaBuffer(1137): frameworks/av/media/libstagefright/MediaBuffer.cpp:140 CHECK((mGraphicBuffer != NULL) || (offset + length <= mSize)) failed.
A/libc(1137): Fatal signal 6 (SIGABRT) at 0x00000471 (code=-6), thread 1137 (screenrecord)
source code
Code:
void MediaBuffer::set_range(size_t offset, size_t length) {
if ((mGraphicBuffer == NULL) && (offset + length > mSize)) {
ALOGE("offset = %d, length = %d, mSize = %d", offset, length, mSize);
}
CHECK((mGraphicBuffer != NULL) || (offset + length <= mSize)); // <--- failed this assert
mRangeOffset = offset;
mRangeLength = length;
}
force fixed? source code
Code:
void MediaBuffer::set_range(size_t offset, size_t length) {
if ((mGraphicBuffer == NULL) && (offset + length > mSize)) {
ALOGE("offset = %d, length = %d, mSize = %d", offset, length, mSize);
offset = 0; // <--- added
}
CHECK((mGraphicBuffer != NULL) || (offset + length <= mSize)); // <--- failed this assert
mRangeOffset = offset;
mRangeLength = length;
}
this is very duty fix:cyclops:
library install
Code:
$ adb root
$ adb remount
$ adb push libstagefright.so /system/lib
$ adb reboot
attach file contains demo.mp4 recorded by this ROM and fixed libstagefright.so.
i don't know this libstagefright.so applicable to another ROM like CM.
try backup before overwrite.
Click to expand...
Click to collapse
Looks great :good: , hopefully someone can include that fix to the frameworks_av..

[Help] Notifications & Toasts don't work

So, I'm writing my very first module and everything works except notification/toast creation. I don't know why.
The best I've managed is ONE toast but never again. I haven't even managed a single notification. What could I be doing wrong?
What drives me crazy is that the thread runs without error. I get my XposedBridge.log()'s just fine. I even throttled the reporting to no faster than every 5 seconds.
I've tried running the following from my thread. I've tried running it on the MainLooper (WTF Google, why can't you do something like Swing?)
Code:
// INSIDE my worker thread run
Application app = AndroidAppHelper.currentApplication();
mNotifyManager = (NotificationManager) app.getSystemService(Context.NOTIFICATION_SERVICE);
mBuilder = new NotificationCompat.Builder(app);
mBuilder.setContentTitle("File Thinger")
.setContentText("Thinging in progress")
//.setSmallIcon(R.drawable.download)
;
Code:
//------------
// INSIDE my worker thread reporting code
//Handler handler = new Handler(Looper.getMainLooper());
//handler.post(new Runnable() {
// public void run() {
if (!TextUtils.isEmpty(message)) {
if (toast != null) {
toast.cancel(); //dismiss current toast if visible
toast.setText(message);
} else {
toast = Toast.makeText(app, message, duration);
}
toast.show();
}
// }
//});
mBuilder.setProgress(me, mp, false);
mNotifyManager.notify(notificationId, mBuilder.build());
XposedBridge.log(cp + "% (" + mp + " / " + me + ")");
For added funzies, I'm working in NoxPlayer with Android 5.
I got Toast working. I put everything in the runnable. No idea why notifications aren't working.

Intermediate: How to Integrate Location Kit into Hotel booking application

Introduction
This article is based on Multiple HMS services application. I have created Hotel Booking application using HMS Kits. We need mobile app for reservation hotels when we are traveling from one place to another place.
In this article, I am going to implement HMS Location Kit & Shared Preferences.
View attachment 5230279
Flutter setup
Refer this URL to setup Flutter.
Software Requirements
1. Android Studio 3.X
2. JDK 1.8 and later
3. SDK Platform 19 and later
4. Gradle 4.6 and later
Steps to integrate service
1. We need to register as a developer account in AppGallery Connect.
2. Create an app by referring to Creating a Project and Creating an App in the Project
3. Set the data storage location based on current location.
4. Enabling Required Services: Location Kit.
5. Generating a Signing Certificate Fingerprint.
6. Configuring the Signing Certificate Fingerprint.
7. Get your agconnect-services.json file to the app root directory.
Important: While adding app, the package name you enter should be the same as your Flutter project’s package name.
Note: Before you download agconnect-services.json file, make sure the required kits are enabled.
Development Process
Create Application in Android Studio.
1. Create Flutter project.
2. App level gradle dependencies. Choose inside project Android > app > build.gradle.
Code:
apply plugin: 'com.android.application'
apply plugin: 'com.huawei.agconnect'
Root level gradle dependencies
Code:
maven {url 'https://developer.huawei.com/repo/'}
classpath 'com.huawei.agconnect:agcp:1.4.1.300'
Add the below permissions in Android Manifest file.
Code:
<manifest xlmns:android...>
...
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
<uses-permission android:name="android.permission.ACTIVITY_RECOGNITION" />
<uses-permission android:name="com.huawei.hms.permission.ACTIVITY_RECOGNITION" />
<application ...
</manifest>
3. Refer below URL for cross-platform plugins. Download required plugins.
https://developer.huawei.com/consum...y-V1/flutter-sdk-download-0000001050304074-V1
4. After completing all the steps above, you need to add the required kits’ Flutter plugins as dependencies to pubspec.yaml file. You can find all the plugins in pub.dev with the latest versions.
Code:
dependencies:
flutter:
sdk: flutter
shared_preferences: ^0.5.12+4
bottom_navy_bar: ^5.6.0
cupertino_icons: ^1.0.0
provider: ^4.3.3
huawei_location:
path: ../huawei_location/
flutter:
uses-material-design: true
assets:
- assets/images/
5. After adding them, run flutter pub get command. Now all the plugins are ready to use.
6. Open main.dart file to create UI and business logics.
Location kit
HUAWEI Location Kit assists developers in enabling their apps to get quick and accurate user locations and expand global positioning capabilities using GPS, Wi-Fi, and base station locations.
Fused location: Provides a set of simple and easy-to-use APIs for you to quickly obtain the device location based on the GPS, Wi-Fi, and base station location data.
Activity identification: Identifies user motion status through the acceleration sensor, cellular network information, and magnetometer, helping you adjust your app based on user behaviour.
Geofence: Allows you to set an interested area through an API so that your app can receive a notification when a specified action (such as leaving, entering, or lingering in the area) occurs.
Integration
Permissions
First of all we need permissions to access location and physical data.
Create a PermissionHandler instance,add initState() for initialize.
Code:
final PermissionHandler permissionHandler;
@override
void initState() {
permissionHandler = PermissionHandler(); super.initState();
}
Check Permissions
We need to check device has permission or not using hasLocationPermission() method.
Code:
void hasPermission() async {
try {
final bool status = await permissionHandler.hasLocationPermission();
if(status == true){
showToast("Has permission: $status");
}else{
requestPermission();
}
} on PlatformException catch (e) {
showToast(e.toString());
}
}
If device don’t have permission,then request for Permission to use requestLocationPermission() method.
Code:
void requestPermission() async {
try {
final bool status = await permissionHandler.requestLocationPermission();
showToast("Is permission granted");
} on PlatformException catch (e) {
showToast(e.toString());
}
}
Fused Location
Create FusedLocationPrvoiderClient instance using the init() method and use the instance to call location APIs.
Code:
final FusedLocationProviderClient locationService
@override
void initState() {
locationService = FusedLocationProviderClient(); super.initState();
}
getLastLocation()
Code:
void getLastLocation() async {
try {
Location location = await locationService.getLastLocation();
setState(() {
lastlocation = location.toString();
print("print: " + lastlocation);
});
} catch (e) {
setState(() {
print("error: " + e.toString());
});
}
}
getLastLocationWithAddress()
Create LocationRequest instance and set required parameters.
Code:
final LocationRequest locationRequest;
locationRequest = LocationRequest()
..needAddress = true
..interval = 5000;
void _getLastLocationWithAddress() async {
try {
HWLocation location =
await locationService.getLastLocationWithAddress(locationRequest);
setState(() {
String street = location.street;
String city = location.city;
String countryname = location.countryName;
currentAddress = '$street' + ',' + '$city' + ' , ' + '$countryname';
print("res: $location");
});
showToast(currentAddress);
} on PlatformException catch (e) {
showToast(e.toString());
}
}
Location Update using Call back
Create LocationCallback instance and create callback functions in initstate().
Code:
LocationCallback locationCallback;
@override
void initState() {
locationCallback = LocationCallback(
onLocationResult: _onCallbackResult,
onLocationAvailability: _onCallbackResult,
);
super.initState();
}
void requestLocationUpdatesCallback() async {
if (_callbackId == null) {
try {
final int callbackId = await locationService.requestLocationUpdatesExCb(
locationRequest, locationCallback);
_callbackId = callbackId;
} on PlatformException catch (e) {
showToast(e.toString());
}
} else {
showToast("Already requested location updates.");
}
}
void onCallbackResult(result) {
print(result.toString());
showToast(result.toString());
}
I have created Helper class to store user login information in locally using shared Preferences class.
Code:
class StorageUtil {
static StorageUtil _storageUtil;
static SharedPreferences _preferences;
static Future<StorageUtil> getInstance() async {
if (_storageUtil == null) {
var secureStorage = StorageUtil._();
await secureStorage._init();
_storageUtil = secureStorage;
}
return _storageUtil;
}
StorageUtil._();
Future _init() async {
_preferences = await SharedPreferences.getInstance();
}
// get string
static String getString(String key) {
if (_preferences == null) return null;
String result = _preferences.getString(key) ?? null;
print('result,$result');
return result;
}
// put string
static Future<void> putString(String key, String value) {
if (_preferences == null) return null;
print('result $value');
return _preferences.setString(key, value);
}
}
Result
View attachment 5230281
Tips & Tricks
1. Download latest HMS Flutter plugin.
2. To work with mock location we need to add permissions in Manifest.XML.
3. Whenever you updated plugins, click on pug get.
Conclusion
We implemented simple hotel booking application using Location kit in this article. We have learned how to get Lastlocation, getLocationWithAddress and how to use callback method, in flutter how to store data into Shared Preferences in applications.
Thank you for reading and if you have enjoyed this article, I would suggest you to implement this and provide your experience.
Reference
Location Kit URL
Shared Preferences URL
Read full article
@XDARoni
Spoiler: I guess I'm missing the question part?
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}

Categories

Resources