Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f81c4a53 authored by Josh Guilfoyle's avatar Josh Guilfoyle
Browse files

ESPRESSO-823: Moved buy_ringtones string to tmobile-res.apk.

CR: Dirk Sigurdson
parent e18b1865
Loading
Loading
Loading
Loading
+20 −7
Original line number Diff line number Diff line
@@ -16,11 +16,10 @@

package com.android.internal.app;

import com.android.internal.app.AlertActivity;
import com.android.internal.app.AlertController;

import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.PackageManager.NameNotFoundException;
import android.content.res.Resources;
import android.database.Cursor;
import android.media.Ringtone;
import android.media.RingtoneManager;
@@ -222,17 +221,31 @@ public final class RingtonePickerActivity extends AlertActivity implements
     * @return The position of the inserted item.
     */
    private int addStaticItem(ListView listView, int resId, int textResId) {
        return addStaticItem(listView, resId, getResources().getText(textResId));
    }

    private int addStaticItem(ListView listView, int resId, CharSequence text) {
        TextView textView = (TextView) getLayoutInflater().inflate(resId, listView, false);
        textView.setText(textResId);
        textView.setText(text);
        listView.addHeaderView(textView);
        mStaticItemCount++;
        return listView.getHeaderViewsCount() - 1;
    }

    private int addBuyItem(ListView listView) {
        String buyRingtones = null;
        try {
            Resources res = getPackageManager().getResourcesForApplication("com.tmobile.resources");
            int textResId = res.getIdentifier("buy_ringtones", "string", "com.tmobile.resources");
            if (textResId != 0) {
                return addStaticItem(listView,
                com.android.internal.R.layout.simple_list_item_1,
                com.android.internal.R.string.buy_ringtones);
                        com.android.internal.R.layout.select_dialog_item,
                        res.getText(textResId));
            }
        } catch (NameNotFoundException e) {
            /* Ignore, we just won't the "buy ringtones" option. */
        }
        return -1;
    }

    private int addDefaultRingtoneItem(ListView listView) {
+1 −0
Original line number Diff line number Diff line
@@ -446,6 +446,7 @@
        <attr name="ringtonePreferenceStyle" format="reference" />
        <!-- The preference layout that has the child/tabbed effect. -->
        <attr name="preferenceLayoutChild" format="reference" />

    </declare-styleable>

    <!-- **************************************************************** -->
+0 −16
Original line number Diff line number Diff line
@@ -1215,20 +1215,4 @@
  <public type="attr" name="author" id="0x010102b4" />
  <public type="attr" name="autoStart" id="0x010102b5" />
  

<!-- ===============================================================
     Resources added to support dynamic theming.  id="..." must be adjusted so
     that these entries are placed at the very end of the generated R.java.
     Verify with aapt dump resources
     $ANDROID_PRODUCT_OUT/system/framework/framework-res.apk.
     !!! THIS IS A TEMPORARY SOLUTION !!!
     =============================================================== -->
  <eat-comment />

  <!-- The following have been temporarily added here to avoid any accidental
       modifications to R.attr and R.id.  Will be removed shortly. -->
  <eat-comment />

  <public type="string" name="buy_ringtones" id="0x0104032b" />

</resources>
+0 −2
Original line number Diff line number Diff line
@@ -2106,6 +2106,4 @@
    <string name="l2tp_vpn_description">Layer 2 Tunneling Protocol</string>
    <string name="l2tp_ipsec_psk_vpn_description">Pre-shared key based L2TP/IPSec VPN</string>
    <string name="l2tp_ipsec_crt_vpn_description">Certificate based L2TP/IPSec VPN</string>
    
    <string name="buy_ringtones">Buy Ringtones</string>
</resources>