am 3b7871c2: Merge "USB Manager string clean up:" into honeycomb-mr1

* commit '3b7871c242bea5834c657c25fbb89c382566f66f':
  USB Manager string clean up:
This commit is contained in:
Mike Lockwood
2011-03-15 13:42:44 -07:00
committed by Android Git Automerger
7 changed files with 39 additions and 16 deletions

View File

@ -17,7 +17,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android.accessorychat">
<application>
<application android:label="Accessory Chat">
<uses-library android:name="com.android.future.usb.accessory" />
<activity android:name="AccessoryChat" android:label="Accessory Chat">

View File

@ -67,11 +67,11 @@ static void* write_thread(void* arg) {
}
static void milli_sleep(int millis) {
struct timespec tm;
struct timespec tm;
tm.tv_sec = 0;
tm.tv_nsec = millis * 1000000;
nanosleep(&tm, NULL);
tm.tv_sec = 0;
tm.tv_nsec = millis * 1000000;
nanosleep(&tm, NULL);
}
static void send_string(struct usb_device *device, int index, const char* string) {
@ -155,7 +155,7 @@ static int usb_device_added(const char *devname, void* client_data) {
send_string(device, ACCESSORY_STRING_MANUFACTURER, "Google, Inc.");
send_string(device, ACCESSORY_STRING_MODEL, "AccessoryChat");
send_string(device, ACCESSORY_STRING_DESCRIPTION, "Sample Program");
send_string(device, ACCESSORY_STRING_DESCRIPTION, "Accessory Chat");
send_string(device, ACCESSORY_STRING_VERSION, "1.0");
send_string(device, ACCESSORY_STRING_URI, "http://www.android.com");
send_string(device, ACCESSORY_STRING_SERIAL, "1234567890");

View File

@ -129,7 +129,7 @@
<string name="usb_accessory_confirm_prompt">Open %1$s when this USB accessory is connected?</string>
<!-- Prompt for the USB accessory URI dialog [CHAR LIMIT=80] -->
<string name="usb_accessory_uri_prompt">Additional information for this device may be found at: %1$s</string>
<string name="usb_accessory_uri_prompt">Additional information for this USB accessory may be found at: %1$s</string>
<!-- Title for USB accessory dialog. Used when the name of the accessory cannot be determined. [CHAR LIMIT=50] -->
<string name="title_usb_accessory">USB accessory</string>
@ -137,7 +137,10 @@
<!-- View button label for USB dialogs. [CHAR LIMIT=15] -->
<string name="label_view">View</string>
<!-- Ignore button label for USB dialogs. [CHAR LIMIT=15] -->
<string name="label_ignore">Ignore</string>
<!-- Checkbox label for USB device dialogs. [CHAR LIMIT=50] -->
<string name="always_use_device">Use by default for this USB device</string>
<!-- Checkbox label for USB accessory dialogs. [CHAR LIMIT=50] -->
<string name="always_use_accessory">Use by default for this USB accessory</string>
</resources>

View File

@ -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;

View File

@ -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);

View File

@ -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);

View File

@ -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);