Merge "Add a provider call to get device friendly name." into jb-ub-mail-ur10
This commit is contained in:
commit
6ceae42b30
@ -130,6 +130,13 @@ public abstract class EmailContent {
|
||||
public static Uri MAILBOX_MOST_RECENT_MESSAGE_URI;
|
||||
public static Uri ACCOUNT_CHECK_URI;
|
||||
|
||||
/**
|
||||
* String for both the EmailProvider call, and the key for the value in the response.
|
||||
* TODO: Eventually this ought to be a device property, not defined by the app.
|
||||
*/
|
||||
public static String DEVICE_FRIENDLY_NAME = "deviceFriendlyName";
|
||||
|
||||
|
||||
public static String PROVIDER_PERMISSION;
|
||||
|
||||
public static synchronized void init(Context context) {
|
||||
|
@ -44,6 +44,7 @@ import android.database.sqlite.SQLiteException;
|
||||
import android.net.Uri;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Binder;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Handler.Callback;
|
||||
@ -1943,6 +1944,15 @@ public class EmailProvider extends ContentProvider {
|
||||
public Bundle call(String method, String arg, Bundle extras) {
|
||||
LogUtils.d(TAG, "EmailProvider#call(%s, %s)", method, arg);
|
||||
|
||||
// Handle queries for the device friendly name.
|
||||
// TODO: This should eventually be a device property, not defined by the app.
|
||||
if (TextUtils.equals(method, EmailContent.DEVICE_FRIENDLY_NAME)) {
|
||||
final Bundle bundle = new Bundle(1);
|
||||
// TODO: For now, just use the model name since we don't yet have a user-supplied name.
|
||||
bundle.putString(EmailContent.DEVICE_FRIENDLY_NAME, Build.MODEL);
|
||||
return bundle;
|
||||
}
|
||||
|
||||
// Handle sync status callbacks.
|
||||
if (TextUtils.equals(method, SYNC_STATUS_CALLBACK_METHOD)) {
|
||||
updateSyncStatus(extras);
|
||||
|
Loading…
Reference in New Issue
Block a user