diff options
Diffstat (limited to 'src/com/android/providers/media/RingtonePickerActivity.java')
-rw-r--r-- | src/com/android/providers/media/RingtonePickerActivity.java | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/com/android/providers/media/RingtonePickerActivity.java b/src/com/android/providers/media/RingtonePickerActivity.java index 872ba41c..c96a647b 100644 --- a/src/com/android/providers/media/RingtonePickerActivity.java +++ b/src/com/android/providers/media/RingtonePickerActivity.java @@ -18,6 +18,9 @@ package com.android.providers.media; import android.content.DialogInterface; import android.content.Intent; +import android.content.pm.PackageManager.NameNotFoundException; +import android.content.res.Resources; +import android.content.res.Resources.Theme; import android.database.Cursor; import android.media.AudioAttributes; import android.media.Ringtone; @@ -135,6 +138,21 @@ public final class RingtonePickerActivity extends AlertActivity implements Intent intent = getIntent(); + // Set custom theme + int themeExtra = intent.getIntExtra(RingtoneManager.EXTRA_RINGTONE_DIALOG_THEME, 0); + if (themeExtra != 0) { + try { + Resources resources = getPackageManager().getResourcesForApplication( + getCallingPackage()); + Theme theme = resources.newTheme(); + theme.applyStyle(themeExtra, true); + getTheme().setTo(theme); + + } catch (NameNotFoundException e) { + // Resource not available. Fall-through default theme + } + } + /* * Get whether to show the 'Default' item, and the URI to play when the * default is clicked |