[APP][CM9/CM10] Profile Switcher

Search This thread

seamusph

Member
Apr 21, 2012
26
57
I was talking about backing up the system profiles...

ahh... that make more sense :) I've read that you can backup the XML file (/data/system/profiles.xml) and restore it later. I haven't tried it myself but I should be updating to the lastest release soon and I let you know how it goes. This is how I've backed mine up
Code:
$ adb shell
shell@android:/ $ su
shell@android:/ # cp /data/system/profiles.xml /sdcard/profiles.xml_20121122
 

seamusph

Member
Apr 21, 2012
26
57
I have uploaded a new version. The changes are minor.
  • I have changed how the buttons work on the timed profile dialog. It should be alot more intuitive now.
  • When you start the TimedProfile dialog, the default profile is now 'Silent'. If there is no profile called 'Silent', it will pick the first one.
  • I have also added an icon
 

GoJo ^^

Senior Member
Dec 2, 2011
3,474
175
Great but really hope you'll add an import export profile feature next...


Sent from my GT-I9100G using xda premium
 

seamusph

Member
Apr 21, 2012
26
57
ahh... that make more sense :) I've read that you can backup the XML file (/data/system/profiles.xml) and restore it later. I haven't tried it myself but I should be updating to the lastest release soon and I let you know how it goes. This is how I've backed mine up
Code:
$ adb shell
shell@android:/ $ su
shell@android:/ # cp /data/system/profiles.xml /sdcard/profiles.xml_20121122

I have just upgraded from cm-10-20120818-NIGHTLY to CM-10 stable and copying profiles.xml back worked. I still had to set the default ringtone in the standard settings since that is not part of profiles.

When I restored the app, I had to run it once so that it would be sent the 'BOOT_COMPLETED' event (as expected).
 

creeve4

Senior Member
Jan 5, 2011
2,871
596
Bountiful
Found a bug in 0.2:

I have a Work profile which has independent volume levels for ringtone and notification.
When the Work profile is activated by Profile Switcher, the ringtone volume level is correctly set, but the notification volume level remains at the level set by the previous profile (it is not changed to the level set for the Work profile).

When the Work profile is switched to manually through the Power Menu, the notification volume level is correctly set.
 

seamusph

Member
Apr 21, 2012
26
57
Found a bug in 0.2:

I have a Work profile which has independent volume levels for ringtone and notification.
When the Work profile is activated by Profile Switcher, the ringtone volume level is correctly set, but the notification volume level remains at the level set by the previous profile (it is not changed to the level set for the Work profile).

When the Work profile is switched to manually through the Power Menu, the notification volume level is correctly set.

Thanks for the bug report. This is very odd. The code that sets the profiles is a one-liner that call the CyanogenMod ProfileManager service (most of the code is managing the scheduling/alarm manager). I don't see anything that could cause the symptoms that you describe. The only thing that I can think of is if you had plugged/unplugged a headset (without the headset reset profile option turned on), then the prior volume settings would be restored. How easy is this to reproduce?
 

creeve4

Senior Member
Jan 5, 2011
2,871
596
Bountiful
Thanks for the bug report. This is very odd. The code that sets the profiles is a one-liner that call the CyanogenMod ProfileManager service (most of the code is managing the scheduling/alarm manager). I don't see anything that could cause the symptoms that you describe. The only thing that I can think of is if you had plugged/unplugged a headset (without the headset reset profile option turned on), then the prior volume settings would be restored. How easy is this to reproduce?

I was able to reproduce it at will yesterday. Now it is working perfectly. I cannot reproduce it anymore. Maybe a glitch with my phone? I will let you know if it happens again.

Does the app create a log?
 
Last edited:

seamusph

Member
Apr 21, 2012
26
57
I was able to reproduce it at will yesterday. Now it is working perfectly. I cannot reproduce it anymore. Maybe a glitch with my phone? I will let you know if it happens again.

Does the app create a log?

There is quite a bit of information in the logcat (search for "ProfileSwitcher" in the log). Most of the logging however is related to the calculation of which profile to switch to. There is a debug mode in the menu, but that does not add much more to the log.
 
  • Like
Reactions: creeve4

dexter1123

Senior Member
Aug 22, 2012
399
37
Redmi Note 8
Hi,

This app allows you to setup schedules to switch profiles. This will only work on a ROM that has a profile manager (e.g. CM9 & CM10). Features also include resetting the profile when headphones are pluged/unplugged and the ability to set a once-off 'timed profile' (similar to the old Nokias).

Update 2012/11/22: Version 0.2 uploaded.

How to use:
Create schedules for when you want your phone to automatically change profiles. To create a schedule, chose "New schedule" in the menu. Choose the profile you want to switch, the time of day (24 hour clock) and which days of the week.
For example: Imagine you have profiles Work, Home and Night. You could have the following schedules.

Work @ 08:00 on Monday, Tuesday, Wednesday, Thursday & Friday
Home @ 10:30 on Saturday & Sunday
Home @ 17:30 on Monday, Tuesday, Wednesday, Thursday & Friday
Night @ 23:30 on Monday, Tuesday, Wednesday, Thursday, Friday, Saturday & Sunday

Version history:
Version 0.2
2012/11/22
Minor changes to Timed Profile dialog
Added icon

Version 0.1
2012/07/19 - Initial version

Thanks,
Seamus.

Seems to be a nice app, hopefully it works on my Sony LWW and it's not resource hungry !!!


Thanks!!!
 
Last edited:

doggydog2

Senior Member
Hi. Thanks for app. I'm looking for something light to control those CM profiles. This app takes 45MB :eek: I have I9001 phone with just 512MB memory and every little memory saving helps. Can the app work based on events instead of staying in memory? I wonder can you add location based switching?
 

seamusph

Member
Apr 21, 2012
26
57
Hi. Thanks for app. I'm looking for something light to control those CM profiles. This app takes 45MB :eek: I have I9001 phone with just 512MB memory and every little memory saving helps. Can the app work based on events instead of staying in memory? I wonder can you add location based switching?

The app doesn't stay in memory - it uses the Android AlarmManager to trigger switching (it also uses events for the plug/unplug of the headphones). I won't be adding location based switching - sorry.

cheers
seamus.
 

creeve4

Senior Member
Jan 5, 2011
2,871
596
Bountiful
Could you add a rule check on reboot?
Sometimes I have my phone turned off when a profile switch is scheduled. It would be great if any scheduled profiles were activated when the phone boots.
 

Tuholator

New member
Apr 25, 2013
1
0
Brilliant

Your profile switcher is just what my samsung I5500/CM10.1 needed. It only has 180MB of memory so every bit counts. Theres not much eye candy in your app, but it does what it's supposed to do. And without a memory resident part. Excellent.

Thanks seamusph :good:
 

seamusph

Member
Apr 21, 2012
26
57
Thanks for this app.

Is there a way to make it open source ?

Thanks again

Of course there it's a way, the question is will he make it open source

How about open-sourcing the app and let the community implement this two wonderful features? ;)

Hi all. To answer the questions..
Can I? Yes - all the code is mine.
Will I? Yes - I always intended to open source the code. After putting in all the effort, it would be a pity not to.
New features? Any changes are always welcome.

I have to add a licence to the code and remove some of the dead code. When that is done, I put it on github. If I am a bit tardy, feel free to give a gentle nudge.

cheers,
seamus.
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 36
    Hi,

    This app allows you to setup schedules to switch profiles. This will only work on a ROM that has a profile manager (e.g. CM9 & CM10). Features also include resetting the profile when headphones are pluged/unplugged and the ability to set a once-off 'timed profile' (similar to the old Nokias).

    Update 2012/11/22: Version 0.2 uploaded.

    How to use:
    Create schedules for when you want your phone to automatically change profiles. To create a schedule, chose "New schedule" in the menu. Choose the profile you want to switch, the time of day (24 hour clock) and which days of the week.
    For example: Imagine you have profiles Work, Home and Night. You could have the following schedules.

    Work @ 08:00 on Monday, Tuesday, Wednesday, Thursday & Friday
    Home @ 10:30 on Saturday & Sunday
    Home @ 17:30 on Monday, Tuesday, Wednesday, Thursday & Friday
    Night @ 23:30 on Monday, Tuesday, Wednesday, Thursday, Friday, Saturday & Sunday

    Version history:
    Version 0.2
    2012/11/22
    Minor changes to Timed Profile dialog
    Added icon

    Version 0.1
    2012/07/19 - Initial version

    Thanks,
    Seamus.
    6
    Hi all. To answer the questions..
    Can I? Yes - all the code is mine.
    Will I? Yes - I always intended to open source the code. After putting in all the effort, it would be a pity not to.
    New features? Any changes are always welcome.

    I have to add a licence to the code and remove some of the dead code. When that is done, I put it on github. If I am a bit tardy, feel free to give a gentle nudge.

    cheers,
    seamus.

    ok.. so it has been a while (over a month:) ) but the code has been released.. It's now on github at https://github.com/seamusphelan/ProfileSwitcher. Instructions on compiling are in the readme. If you have problems compiling the CyanogenMod sources (for the framework JAR file), I have attached the JAR file it produces here for convenience.

    cheers,
    Seamus.
    6
    Hopefully I am not stepping on anyone's toes but I spent some time and upgraded the application for the new CyanogenMod SDK which was added in the 12.1 06/30/15 nightly. They moved the location of the profiles and so the old 0.2 version would no longer work. I also updated the layout a little. I figured I would share in case anyone else was upset that their automatic profile switching stopped working ;)

    Thanks as always to Seamus for originally writing the application.

    This version (0.3) will only work on CM 12.1 with the new CM SDK. Use 0.2 unless you have a CM build newer than 06/30/2015.
    You will have to uninstall 0.2 before installing 0.3.

    Version 0.3
    2015/07/10
    -Migrated to use the CM SDK
    -Upgraded Icons
    -Upgraded Layout
    -Added Floating Activator for Add
    5
    Looks like they broke it again with the 08/01/15 nightly. Here is a new revision:

    Version 0.4.2
    2015/08/01
    -Quick update to deal with CMSDK changes on 08/01/15 nightly

    Edit: got permissions to post attachments again.
    3
    Profile Switcher 1.1 apk attached. (Only works in Marshmallow. Use v 0.4.2 for cm 12)
    Changelog.
    1. Updated for marshmallow permission scheme. A dialogue box will appear on app launch requesting to allow 'change system settings' permissions.
    2. Depreciated shared preferences replaced with android tray (https://github.com/grandcentrix/tray)
    3. Changes to handle doze mode.
    4. Updated UI (FABs)

    Source: https://github.com/theapu/CMProfileSwitcher