diff options
author | Mike Lockwood <lockwood@android.com> | 2011-03-15 16:04:12 -0400 |
---|---|---|
committer | Mike Lockwood <lockwood@android.com> | 2011-03-15 16:23:40 -0400 |
commit | ad5f83e91b6812a6dee4fea7646fa9061d9f9597 (patch) | |
tree | fe8baecc1a33a2e071c8887317413c4b327d1674 /packages/SystemUI/src | |
parent | b0f72de87d1abdfec0cd188f277c48f65f7011a8 (diff) | |
download | frameworks_base-ad5f83e91b6812a6dee4fea7646fa9061d9f9597.zip frameworks_base-ad5f83e91b6812a6dee4fea7646fa9061d9f9597.tar.gz frameworks_base-ad5f83e91b6812a6dee4fea7646fa9061d9f9597.tar.bz2 |
USB Manager string clean up:
- Use "Cancel" instead of "Ignore"
- Customize the text for the "always use" checkbox for devices and accessories
- Clean up strings for AccessoryChat test program
Bug: 4074719
Change-Id: Ideec838e4c1f1a82ef4ae411c9124417ffb63165
Signed-off-by: Mike Lockwood <lockwood@android.com>
Diffstat (limited to 'packages/SystemUI/src')
4 files changed, 27 insertions, 7 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/usb/UsbAccessoryUriActivity.java b/packages/SystemUI/src/com/android/systemui/usb/UsbAccessoryUriActivity.java index eefb1c6..5007cf4 100644 --- a/packages/SystemUI/src/com/android/systemui/usb/UsbAccessoryUriActivity.java +++ b/packages/SystemUI/src/com/android/systemui/usb/UsbAccessoryUriActivity.java @@ -76,7 +76,7 @@ public class UsbAccessoryUriActivity extends AlertActivity } ap.mMessage = getString(R.string.usb_accessory_uri_prompt, mUri); ap.mPositiveButtonText = getString(R.string.label_view); - ap.mNegativeButtonText = getString(R.string.label_ignore); + ap.mNegativeButtonText = getString(android.R.string.cancel); ap.mPositiveButtonListener = this; ap.mNegativeButtonListener = this; diff --git a/packages/SystemUI/src/com/android/systemui/usb/UsbConfirmActivity.java b/packages/SystemUI/src/com/android/systemui/usb/UsbConfirmActivity.java index 2781246..030a261 100644 --- a/packages/SystemUI/src/com/android/systemui/usb/UsbConfirmActivity.java +++ b/packages/SystemUI/src/com/android/systemui/usb/UsbConfirmActivity.java @@ -80,8 +80,8 @@ public class UsbConfirmActivity extends AlertActivity ap.mMessage = getString(R.string.usb_device_confirm_prompt, appName); mDisconnectedReceiver = new UsbDisconnectedReceiver(this, mDevice); } - ap.mPositiveButtonText = getString(com.android.internal.R.string.ok); - ap.mNegativeButtonText = getString(com.android.internal.R.string.cancel); + ap.mPositiveButtonText = getString(android.R.string.ok); + ap.mNegativeButtonText = getString(android.R.string.cancel); ap.mPositiveButtonListener = this; ap.mNegativeButtonListener = this; @@ -90,7 +90,11 @@ public class UsbConfirmActivity extends AlertActivity Context.LAYOUT_INFLATER_SERVICE); ap.mView = inflater.inflate(com.android.internal.R.layout.always_use_checkbox, null); mAlwaysUse = (CheckBox)ap.mView.findViewById(com.android.internal.R.id.alwaysUse); - mAlwaysUse.setText(com.android.internal.R.string.alwaysUse); + if (mDevice == null) { + mAlwaysUse.setText(R.string.always_use_accessory); + } else { + mAlwaysUse.setText(R.string.always_use_device); + } mAlwaysUse.setOnCheckedChangeListener(this); mClearDefaultHint = (TextView)ap.mView.findViewById( com.android.internal.R.id.clearDefaultHint); diff --git a/packages/SystemUI/src/com/android/systemui/usb/UsbPermissionActivity.java b/packages/SystemUI/src/com/android/systemui/usb/UsbPermissionActivity.java index 27cce6d..c384f50 100644 --- a/packages/SystemUI/src/com/android/systemui/usb/UsbPermissionActivity.java +++ b/packages/SystemUI/src/com/android/systemui/usb/UsbPermissionActivity.java @@ -91,8 +91,8 @@ public class UsbPermissionActivity extends AlertActivity ap.mMessage = getString(R.string.usb_device_permission_prompt, appName); mDisconnectedReceiver = new UsbDisconnectedReceiver(this, mDevice); } - ap.mPositiveButtonText = getString(com.android.internal.R.string.ok); - ap.mNegativeButtonText = getString(com.android.internal.R.string.cancel); + ap.mPositiveButtonText = getString(android.R.string.ok); + ap.mNegativeButtonText = getString(android.R.string.cancel); ap.mPositiveButtonListener = this; ap.mNegativeButtonListener = this; @@ -101,7 +101,11 @@ public class UsbPermissionActivity extends AlertActivity Context.LAYOUT_INFLATER_SERVICE); ap.mView = inflater.inflate(com.android.internal.R.layout.always_use_checkbox, null); mAlwaysUse = (CheckBox)ap.mView.findViewById(com.android.internal.R.id.alwaysUse); - mAlwaysUse.setText(com.android.internal.R.string.alwaysUse); + if (mDevice == null) { + mAlwaysUse.setText(R.string.always_use_accessory); + } else { + mAlwaysUse.setText(R.string.always_use_device); + } mAlwaysUse.setOnCheckedChangeListener(this); mClearDefaultHint = (TextView)ap.mView.findViewById( com.android.internal.R.id.clearDefaultHint); diff --git a/packages/SystemUI/src/com/android/systemui/usb/UsbResolverActivity.java b/packages/SystemUI/src/com/android/systemui/usb/UsbResolverActivity.java index 7c63820..f61ecb1 100644 --- a/packages/SystemUI/src/com/android/systemui/usb/UsbResolverActivity.java +++ b/packages/SystemUI/src/com/android/systemui/usb/UsbResolverActivity.java @@ -31,6 +31,9 @@ import android.os.Parcelable; import android.os.RemoteException; import android.os.ServiceManager; import android.util.Log; +import android.widget.CheckBox; + +import com.android.systemui.R; import java.util.ArrayList; @@ -58,6 +61,15 @@ public class UsbResolverActivity extends ResolverActivity { super.onCreate(savedInstanceState, target, title, null, rList, true /* Set alwaysUseOption to true to enable "always use this app" checkbox. */ ); + CheckBox alwaysUse = (CheckBox)findViewById(com.android.internal.R.id.alwaysUse); + if (alwaysUse != null) { + if (mDevice == null) { + alwaysUse.setText(R.string.always_use_accessory); + } else { + alwaysUse.setText(R.string.always_use_device); + } + } + mDevice = (UsbDevice)target.getParcelableExtra(UsbManager.EXTRA_DEVICE); if (mDevice != null) { mDisconnectedReceiver = new UsbDisconnectedReceiver(this, mDevice); |