yashsingh1/xdaforums huggingface dataset:
[8525, TyTN, MDA Vario II, JasJam Software Upgradin] crispy78:
I've downloaded Contacts Menu Extension.cab from PPCGeeks.com and found it a very usefull program/addon....

Normally WM5 storres the contacts als lastname, firstname with this app. you can change it to firstname lastname.
[8525, TyTN, MDA Vario II, JasJam Software Upgradin] vijay555:
FileAsFL.

It's also built into WM6.

V
[Android Q&A, Help & Troubleshooting] ScratMan38:
Hello,

I have been using Profile 4 Tasker to change the user profiles of CyanogenMod with Tasker ; but now with the latest CM change to profiles management in 2015/06/30 nightly, it doesn't work anymore :(

http://review.cyanogenmod.org/#/q/topic:profiles-refactor

I found a task on reddit to set a CM profile with Tasker using Java :

https://www.reddit.com/r/TaskerFiles/comments/38tesw/task_activate_a_cyanogenmod_profile_by_name/

Unfortunately, it does not work on my phone with CM12.1 starting from 2015/06/30 nightly. It works fine on my Galaxy Tab 2 with an older version of CyanogenMod (2015-06-07).

When looking at the commits, it looks like CM removed the "profile" public string from Context.java as shown here : http://review.cyanogenmod.org/#/c/101945/7/core/java/android/content/Context.java

So now when the task tries to run the %exists = ps.profileExists(%par1); it returns an error "Java Function: failed to init target class ps".

It looks like there is no "profileExists" function available in the "ps" class.

I'm not used to code Android, only working on Python, but as far as I understand, the CONTEXT.getSystemService(profile); returns nothing as "profile" is not public anymore and there is no corresponding function. So the returned class is empty.

Is there another way to switch system profiles with Tasker with the new profilemanager ?

As I'm not used to Android and Java coding, I'm not able to digg in the CM code to find a solution myself.

Thanks a lot for your help.
[Android Q&A, Help & Troubleshooting] Nosepull:
Same here, any help?
[Android Q&A, Help & Troubleshooting] ScratMan38:
I found a solution yesterday.

Unfortunately, I still can't change the profile through Tasker, I need to call the Power Menu or go to Quick Settings tiles to change the active profile ; but at least now Tasker detects when there is a profile change, so that I can automate several things at this time.

I attach a zip with some Tasker profiles and tasks I made, you can unzip it to your phone and import it in Tasker to use it as a base.

The profiles are :

- CM Profile Set : this is the main profile, it detects the CM Profile change by listening to the "cyanogenmod.platform.intent.action.PROFILE_SELECTED" intent the system broadcasts when a profile is selected.

- Detect Headset : detects whether a headset with no microphone is plugged in or not.

- Detect Power : detects whether a power source is plugged in or not.

- Profil Automobile : detects if the profile named "Automobile" is active or not, and performs some tasks accordingly.

- Profil Nuit : detects if the profile named "Nuit" is active or not, and performs some tasks accordingly.

The tasks are :

- CMProfileVariableSet : called by "CM Profile Set", this is the main task, it sets the variables %CMProfile and %CMLastProfile with the name of the new CM profile and the name of the previous CM profile, respectively. These variables will be used to activate the corresponding Tasker profiles.

- Automobile Musique : this task is a good example of how to automate the configuration of the phone when a CM profile is selected, depending on if headset and power are plugged in or not. When the CM profile named "Automobile" is selected, it launches the "Kernel Automobile" task to configure the kernel ; if headset is plugged in, it launches the music player and starts playing music ; and if the power source is plugged in it starts Waze for navigation

- Headset No Mic / Headset Out / Power In / Power Out : these tasks set the variables used by other tasks to perform some actions or not.

- Kernel Automobile / Kernel Nuit : when the corresponding Profile is selected in CM, the Tasker profiles run these tasks to send intents to my kernel config app (Boeffla kernel on my S5) to change its configuration.

You may play with the provided profiles and tasks to match your requirements, the main things being "CM Profile Set" and "CMProfileVariableSet", that are setting the variables %CMProfile and %CMLastProfile. By using the two variables, you can then perform whatever you want in you tasks.

I will continue to check how I can trigger a CM profile change directly with Tasker, for example to set a CM profile everyday at the same hour.
[Android Q&A, Help & Troubleshooting] morckx:
I have written and attached a little app that can activate a CM profile from Tasker on today's nightly. Start CMSetProfile with "Launch App" having the profile name in the "Data" argument.
[Android Q&A, Help & Troubleshooting] ScratMan38:
Thanks, it works fine.

Unfortunately, since 1st August niglthy, my method above with listening of intent does not work anymore. It looks like the platform does not send the intent anymore when the profile is selected. :crying:

At least I can switch profiles with tasker thanks to your app.
[Android Q&A, Help & Troubleshooting] morckx:
Yes, there is a bug in CMProfileService: it activates the new profile, but crashes doing that here before the cyanogenmod.platform.intent.action.PROFILE_SELECTED can be broadcasted.

08-11 10:55:12.724 1572-2958/system_process D/CMProfileService﹕ Set active profile to: 06b50f53-8fb6-408f-8dbf-7bc7a9dd70cc - Night
08-11 10:55:12.780 1572-2958/system_process E/JavaBinder﹕ *** Uncaught remote exception! (Exceptions are not yet supported across processes.)
java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()
at android.os.Handler.(Handler.java:200)
at android.os.Handler.(Handler.java:114)
at com.android.internal.policy.impl.BarController.(BarController.java:71)
at com.android.internal.policy.impl.PhoneWindowManager.(PhoneWindowManager.java:968)
at com.android.internal.policy.impl.Policy.makeNewWindowManager(Policy.java:68)
at com.android.internal.policy.PolicyManager.makeNewWindowManager(PolicyManager.java:65)
at cyanogenmod.profiles.LockSettings.processOverride(LockSettings.java:107)
at cyanogenmod.app.Profile.doSelect(Profile.java:1194)
at org.cyanogenmod.platform.internal.ProfileManagerService.setActiveProfileInternal(ProfileManagerService.java:591)
at org.cyanogenmod.platform.internal.ProfileManagerService.setActiveProfileInternal(ProfileManagerService.java:562)
at org.cyanogenmod.platform.internal.ProfileManagerService.access$600(ProfileManagerService.java:58)
at org.cyanogenmod.platform.internal.ProfileManagerService$2.setActiveProfile(ProfileManagerService.java:201)
at cyanogenmod.app.IProfileManager$Stub.onTransact(IProfileManager.java:56)
at android.os.Binder.execTransact(Binder.java:446)

EDIT: There is already a fix, not yet merged, but on it's way: http://review.cyanogenmod.org/#/c/105589/

It's working for me.

EDIT2: It's merged. Profile intents should be broadcasted again.
[Android Q&A, Help & Troubleshooting] ScratMan38:
With the fix the intent is correctly broadcasted, thanks. Now I can easily detect the profile change in Tasker.

Do you know if there is a way to call the CM profile picker ? to have a list to select the profile, as we could call it with Power Menu > Profile before devs decided to remove the profiles from power menu.
[Android Q&A, Help & Troubleshooting] Kwbmm:
Hi! I'm Kwbmm reddit user that posted the solution you can see in the comments for switching profiles in CM 12.1

Unfortunately, that method doesn't work anymore.

I tried the app posted by [MENTION=3458465]morckx[/MENTION] and it works, but I'm still wondering if we can fix my task, as I think it's a cleaner way to change the profile. However, after some digging, I wasn't able to understand what should be changed in my task to make it work correctly again. If (maybe) [MENTION=3458465]morckx[/MENTION] can give us a suggestion, as I believe it's a matter of copying the function calls that are made by his app into tasker, this could be solved easily.
[Android Q&A, Help & Troubleshooting] jobinmaxime:
Kwbmm, could you fix your task? I'm also looking for a cleaner solution
[Android Q&A, Help & Troubleshooting] Kwbmm:
I didn't manage to fix it. In the end I resorted to use CMSetProfile app which was posted some posts before

Inviato dal mio GT-I9505 utilizzando Tapatalk
[Android Q&A, Help & Troubleshooting] jobinmaxime:
Is it seamless or you see the app opening?
[Android Q&A, Help & Troubleshooting] Kwbmm:
The app opens and closes immediately after
[Android Q&A, Help & Troubleshooting] jobinmaxime:
Ok thanks. I'll probably try updating your task based on this app, I'll let you know if I find something.
[Android Q&A, Help & Troubleshooting] stevekind:
Working!

Thanks so much, thought I had to rearrange everything, but now all is well again!
[Android Q&A, Help & Troubleshooting] voidzero:
[MENTION=3458465]morckx[/MENTION] thanks for the app. Will you be able to get rid of the quick flash? Or maybe change it from white to black, if that's possible. Thanks all the same, I'm glad that my Tasker profile switcher works again. :victory:
[Android Q&A, Help & Troubleshooting] morckx:
Attached a new version that should display no GUI, otherwise unchanged. Please have a look, Source Code is here: https://github.com/morckx/CMProfiles
[Android Q&A, Help & Troubleshooting] ScratMan38:
Thanks, new version is working PERFECT
[Android Q&A, Help & Troubleshooting] Nosepull:
Thanks! Little App which is essential for me!
[Android Q&A, Help & Troubleshooting] voidzero:
Fantastic. Thanks for both!
[Android Q&A, Help & Troubleshooting] ScratMan38:
[MENTION=3458465]morckx[/MENTION], I made some search on the ProfileManager, and I can successfully select a profile or detect a profile change using intents, in order to automate everything with Tasker, thanks to your app. However, I'm not happy with the method I'm using to select the profile I want directly from the home screen, may I ask you some help ?

I made a Tasker menu to display a choice of profiles, but the issue is that it's ugly, it doesn't match the system, and when I add or remove a profile, I need to edit the menu in Tasker to make it match.

I've seen that there is a "Profile Picker" in CM, which opens a system menu listing all my available profiles.

I managed to make a task which retrieves the active profile UUID and sets it to variable %cm_active_profile_uuid, then send an intent :

Action = cyanogenmod.platform.intent.action.PROFILE_PICKER

Cat = Default

Extra = cyanogenmod.platform.intent.extra.profile.SHOW_NONE:false (this removes the 'None' entry at the top of the list)

Extra = cyanogenmod.platform.intent.extra.profile.EXISTING_UUID:%cm_active_profile_uuid (this allows the profile picker to display which one is active)

This displays the following :

I can then select the profile I want to apply, and click OK.

But then, I'm lost.

I can't find a way to get the feed back from the Profile Picker. It does not change the active profile, and it seems it broadcasts no intent.

I tried to monitor the intent cyanogenmod.platform.intent.extra.profile.PICKED_UUID with Tasker, but it doesn't work.

According to the wiki : http://cyanogenmod.github.io/cm_platform_sdk/reference/cyanogenmod/app/ProfileManager.html

the profile picker should return the UUID of the selected profile, but I can't find how to retrieve it.

May I ask for your support please ?

Thanks
[Android Q&A, Help & Troubleshooting] Dulcet_Man:
Thank you so much for this little app.
[Android Q&A, Help & Troubleshooting] guilhem_h:
Hi,

I'm looking for a script witch would give me a variable corresponding to the CM profile I'm running... Is it possible with your app ?
[Android Q&A, Help & Troubleshooting] morckx:
Apparently, with the latest cm-13.0 nightlies the original, purely tasker based method (https://www.reddit.com/r/TaskerFiles/comments/38tesw/task_activate_a_cyanogenmod_profile_by_name/) for setting and getting profiles works again.
[Android Q&A, Help & Troubleshooting] guilhem_h:
Thanx ! Unfortunatly I'm running CM12.1 at the time ^^
[Android Q&A, Help & Troubleshooting] ScratMan38:
You need to use Tasker, and create a new tasker profile triggerer by an event (an intent received), and in the 'Action' field of the intent, you need to specify cyanogenmod.platform.intent.action.PROFILE_SELECTED

This profile would then launch a task that will read the variable returned by the intent and save it in a user defined variable. The intent returns the variables %name which is the name of the selected profile, and %lastname with the name of the previous profile used. So in your Tasker task, you can for example set a variable %CM_ACTIVE_PROFILE to %name
[Android Q&A, Help & Troubleshooting] guilhem_h:
I'm really pleased you take time to answer me... And I feel bad not to achieve thoses tasks !!

Here is my test profile (as you explained to me)

Profil: Profile Test (60)
Evénement: Intent reçu [ Action:cyanogenmod.platform.intent.action.PROFILE_SELECTED Cat:None Cat:None Plan:* Type Mime:* ]
Entrée: Anon (61)
A1: Affecter une variable [ Nom:%CM_PROFILE_PREVIOUS A:%lastname Faire des Maths:Désactivé Ajouter:Désactivé ]
A2: Affecter une variable [ Nom:%CM_PROFILE_ACTIVE A:%name Faire des Maths:Désactivé Ajouter:Désactivé ]

I tested it by showing a flash.... Whitch gives me a "%name" instead of the profile name. What went wrong ? (me ? Haha)
[Android Q&A, Help & Troubleshooting] ScratMan38:
I've seen that when creating a new profile using intent, it doesn't work until you either reboot the phone, or stop and exit Tasker before restarting it :

- Long click on the Tasker icon in the top left edge of the app

- Open the menu and select Exit, select to save changes first if asked

- Open Tasker again

- Long click on the greyed Tasker icon in the top left edge to enable it

The intent should then be received. Try it by changing the CM profile using quick settings tile.
[Android Q&A, Help & Troubleshooting] guilhem_h:
I'm so frustrated I can't make this profile working...... Grrrrr

I tried your way desactivating / reactivating Tasker, I tried rebooting my device. It seems that no intent is being received. Even if I manually switch the cm profile. :(
[Android Q&A, Help & Troubleshooting] ScratMan38:
Try to import the attached profile and task.
[Android Q&A, Help & Troubleshooting] guilhem_h:
This isn't working, the task and profile are exactly the same as mine.

So I thought the problem is me... And Iwent to the setup of my device, wich is not running CM12.1 but Cyanogen OS (build YOG4PAS3JL). Does it change something for me ?

EDIT : yes it changed something.... Just flashed a new ROM and now it's working with the CMSetProfile.apk !!
[Android Q&A, Help & Troubleshooting] dae3:
Working Tasker-only solution on CM12.1

I have a working solution to change profiles and query the current profile on CM12.1 (tested on [MENTION=4439705]winxuser[/MENTION] unofficial build for the i9305 but no reason it shouldn't work on official builds).

Setting and querying the profile uses Tasker Java calls to the new cyanogenmod.app.ProfileManager API. The query task sets a Tasker global variable but that's just as an example.

The Intent trigger is also working for me to detect a profile change.

Sorry, I'm too new to attach or link. Code below.

<TaskerData sr="" dvi="1" tv="4.8u1m">
<Task sr="task4">
<cdate>1436909350225</cdate>
<edate>1454723961213</edate>
<id>4</id>
<nme>CM profile change demo for XDA</nme>
<pri>100</pri>
<Action sr="act0" ve="7">
<code>664</code>
<Str sr="arg0" ve="3">pm</Str>
<Str sr="arg1" ve="3">cyanogenmod.app.ProfileManager</Str>
<Str sr="arg2" ve="3">getInstance
{cyanogenmod.app.ProfileManager} (Context)</Str>
<Str sr="arg3" ve="3">CONTEXT</Str>
<Str sr="arg4" ve="3"/>
<Str sr="arg5" ve="3"/>
<Str sr="arg6" ve="3"/>
<Str sr="arg7" ve="3"/>
<Str sr="arg8" ve="3"/>
<Str sr="arg9" ve="3"/>
</Action>
<Action sr="act1" ve="7">
<code>664</code>
<Str sr="arg0" ve="3"/>
<Str sr="arg1" ve="3">pm</Str>
<Str sr="arg2" ve="3">setActiveProfile {} (String)</Str>
<Str sr="arg3" ve="3">Profilename</Str>
<Str sr="arg4" ve="3"/>
<Str sr="arg5" ve="3"/>
<Str sr="arg6" ve="3"/>
<Str sr="arg7" ve="3"/>
<Str sr="arg8" ve="3"/>
<Str sr="arg9" ve="3"/>
</Action>
</Task>
</TaskerData>

<TaskerData sr="" dvi="1" tv="4.8u1m">
<Task sr="task5">
<cdate>1437469893990</cdate>
<edate>1454723987441</edate>
<id>5</id>
<nme>Get current profile demo for XDA</nme>
<pri>100</pri>
<Action sr="act0" ve="7">
<code>664</code>
<Str sr="arg0" ve="3">pm</Str>
<Str sr="arg1" ve="3">cyanogenmod.app.ProfileManager</Str>
<Str sr="arg2" ve="3">getInstance
{cyanogenmod.app.ProfileManager} (Context)</Str>
<Str sr="arg3" ve="3">CONTEXT</Str>
<Str sr="arg4" ve="3"/>
<Str sr="arg5" ve="3"/>
<Str sr="arg6" ve="3"/>
<Str sr="arg7" ve="3"/>
<Str sr="arg8" ve="3"/>
<Str sr="arg9" ve="3"/>
</Action>
<Action sr="act1" ve="7">
<code>664</code>
<Str sr="arg0" ve="3">pr</Str>
<Str sr="arg1" ve="3">pm</Str>
<Str sr="arg2" ve="3">getActiveProfile {cyanogenmod.app.Profile} ()</Str>
<Str sr="arg3" ve="3">Default</Str>
<Str sr="arg4" ve="3"/>
<Str sr="arg5" ve="3"/>
<Str sr="arg6" ve="3"/>
<Str sr="arg7" ve="3"/>
<Str sr="arg8" ve="3"/>
<Str sr="arg9" ve="3"/>
</Action>
<Action sr="act2" ve="7">
<code>664</code>
<Str sr="arg0" ve="3">%CMprofile</Str>
<Str sr="arg1" ve="3">pr</Str>
<Str sr="arg2" ve="3">getName {String}()</Str>
<Str sr="arg3" ve="3"/>
<Str sr="arg4" ve="3"/>
<Str sr="arg5" ve="3"/>
<Str sr="arg6" ve="3"/>
<Str sr="arg7" ve="3"/>
<Str sr="arg8" ve="3"/>
<Str sr="arg9" ve="3"/>
</Action>
</Task>
</TaskerData>
[Android Q&A, Help & Troubleshooting] GPSMapper:
That's cool, thanks.

While Profile 4 Tasker has stopped working for me recently (after ROM update), I've switched to cmsetprofile.apk from http://xdaforums.com/showpost.php?p=64054862&postcount=16

It was doing the job, but sometimes was not very stable (profile was not always changed under certain condifitions I was unable to replicate)

Now I have imported your java-based tasks and have configured to call them from my main Tasker profile instead.

Will see if this will be more stable...
[Android Q&A, Help & Troubleshooting] voidzero:
Looking forward to hearing results.
[Android Q&A, Help & Troubleshooting] GPSMapper:
So far everything was fine and stable with the profile change by the tasks mentioned above.
[Android Q&A, Help & Troubleshooting] guilhem_h:
I'm facing a problem with CMSetProfile.apk : my phone sometimes freezes on a black screen (with status bar visible at the top), forces me to reboot the phone.

I'd like to use the script above but I can't import it in tasker.....

I pasted the script in notepad++, saved it as a XML file, but tasker won't see it when I try to import it ...

What am I doing wrong ?
[Android Q&A, Help & Troubleshooting] ScratMan38:
In notepad++, if you're on Windows, make sure to convert the end of lines to UNIX format before saving file and transferring it to the phone.
[Android Q&A, Help & Troubleshooting] guilhem_h:
Just done what you suggested and it still doesn't work. When I choose "import" it opens the folder view and the folder in witch I pasted the file seems empty ..... Oo
[Android Q&A, Help & Troubleshooting] ScratMan38:
Try to reboot the phone, sometimes the media scanner is not correctly detecting newly copied files through MTP.
[Android Q&A, Help & Troubleshooting] guilhem_h:
I managed to find my file, but when I try to import it I get this error message:

"no %1$s found" (in french but I think you'll understand my translation ^^)
[Android Q&A, Help & Troubleshooting] Rajkharibam:
This is awesome, I have been looking for this ever since profiletasker stopped working. please continue working on this and i hope to see this app on playstore soon. This is still working on CM13, let me know if there is any new updated version of this app.

thanks a Ton.
[Android Q&A, Help & Troubleshooting] ScratMan38:
Hello

Your app doesn't work anymore on CM14.1, it force closes without changing the Profile :(

And I still can't get the Profile Picker to work nor java functions calling Profile Manager methods in Tasker.
[Android Q&A, Help & Troubleshooting] caned_monkey:
Can anyone please advise on how to get the xml code provided by dae3 into a working Task file? I've tried copying the text into notepad and changing the extension to tsk.xml but whenever I try to import it, Tasker crashes.

What do I need to do?
[Android Q&A, Help & Troubleshooting] Mint86:
Do you've any news with CM14.1?
[Android Q&A, Help & Troubleshooting] marius.onofrei:
Hello,

Any chance of getting the app compatible with CM/LineageOS 14? It crashes probably because the underlying APIs have changed.

Thanks,
[Android Q&A, Help & Troubleshooting] ScratMan38:
Set SELinux to Permissive.
[Android Q&A, Help & Troubleshooting] morckx:
I don't think the app is really still necessary because you can also switch profiles with Tasker Java Functions again , but anyway, here you go. The app should work again now. I have also updated the source https://github.com/morckx/CMProfiles .
[Android Q&A, Help & Troubleshooting] marius.onofrei:
Thanks, tried the Java functions by following an example for CM13 and was getting an Invalid Function error when setting up the task, will try with the code in your app to see if I get any further.
[Android Q&A, Help & Troubleshooting] morckx:
Here is my tasker java function...
[Android Q&A, Help & Troubleshooting] marius.onofrei:
Thanks, managed to get it working, I was using the dialog wrong (had to add the namespace+class/instance to the appropriate field and not dump it all to the function field). As an extra I've added shells to disable/re-enable SELinux before and after the execution. All cool! Thanks for your time.
[Sony Xperia E3] Ruri88:
hey, i have a question.

how to make Recent App look like Lollipop,

i have one screenshot, i get it from android development thread :3

anyone know how to make like that?
[Sony Xperia E3] PJMOR:
Just flash Vinay's Nitrogen ROM.
[Galaxy S 4 Q&A, Help & Troubleshooting] DAN1926:
Hi guys, i got a problem with my S4 and I need your help please!

I recently flashed Liquidsmooth v3.1 4.4 on it, LS its a great rom but i noticed that the kernel that comes with it (POKernel), its not that great beacuase of some lags here and there, so I decided to flash a new kernel and I picked the KToonsez one for aosp but when i flashed it the first time the phone went in bootloop so I decided to reflash it a second time but getting the same bad result

So my question is, What did I do wrong? Did i choose the wrong file?

I Also tried to flash another kernel, Chronic Aosp, and the flash went well so I really don'know what's the problem with the KT one can you help me please?
[Kindle Fire HDX 7" & 8.9" Q&A, Help & Troubleshoot] bigwario:
Hi,I have a HDX 7"，Fire OS 4.5.2, and used safestrap v4.01.

I decide to wipe away Fire OS 4.5.2,and use CM-11 instead in the Stock ROM.

I am not sure the correct method,can I make my ulimate goal with following steps?

1. reboot HDX to safestrap recovery,activate the Stock ROM.

2.go to Wipe ->andvanced Wipe,then select Dalvik Cache,data,cache,system,and Swipe to Wipe.

3.install the Thor CM-11 Rom Created by ggow which can be downloaded from

http://xdaforums.com/kindle-fire-hdx/development/rom-cm-11-safestrap-20150628-unofficial-t3145547

Any tips would be much appreciated.
[Kindle Fire HDX 7" & 8.9" Q&A, Help & Troubleshoot] DB126:
Yup - looks good. The only addition is to preform a factory reset from within Safestrap

after

flashing CM-11 (clears cache,data,dalvik only). Also - thanks for doing your homework before posting. Much appreciated! :good:
[Kindle Fire HDX 7" & 8.9" Q&A, Help & Troubleshoot] EncryptedCurse:
Remember to make a backup.