Example usage for android.mtp MtpDeviceInfo getModel

List of usage examples for android.mtp MtpDeviceInfo getModel

Introduction

In this page you can find the example usage for android.mtp MtpDeviceInfo getModel.

Prototype

public final @NonNull String getModel() 

Source Link

Document

Returns the model name for the MTP device

Usage

From source file:com.android.gallery3d2.ingest.IngestService.java

private void setDevice(MtpDevice device) {
    if (mDevice == device)
        return;//  w ww  .j  a v a2 s  .c om
    mRedeliverImportFinish = false;
    mRedeliverObjectsNotImported = null;
    mRedeliverNotifyIndexChanged = false;
    mRedeliverIndexFinish = false;
    mDevice = device;
    mIndex.setDevice(mDevice);
    if (mDevice != null) {
        MtpDeviceInfo deviceInfo = mDevice.getDeviceInfo();
        if (deviceInfo == null) {
            setDevice(null);
            return;
        } else {
            mDevicePrettyName = deviceInfo.getModel();
            mNotificationBuilder.setContentTitle(mDevicePrettyName);
            new Thread(mIndex.getIndexRunnable()).start();
        }
    } else {
        mDevicePrettyName = null;
    }
    if (mClientActivity != null) {
        mClientActivity.notifyIndexChanged();
    } else {
        mRedeliverNotifyIndexChanged = true;
    }
}

From source file:com.android.gallery3d.ingest.IngestService.java

private void setDevice(MtpDevice device) {
    if (mDevice == device) {
        return;//from  ww  w .  j  ava2  s .c om
    }
    mRedeliverImportFinish = false;
    mRedeliverObjectsNotImported = null;
    mRedeliverNotifyIndexChanged = false;
    mRedeliverIndexFinish = false;
    mDevice = device;
    mIndex.setDevice(mDevice);
    if (mDevice != null) {
        MtpDeviceInfo deviceInfo = mDevice.getDeviceInfo();
        if (deviceInfo == null) {
            setDevice(null);
            return;
        } else {
            mDevicePrettyName = deviceInfo.getModel();
            mNotificationBuilder.setContentTitle(mDevicePrettyName);
            new Thread(mIndex.getIndexRunnable()).start();
        }
    } else {
        mDevicePrettyName = null;
    }
    if (mClientActivity != null) {
        mClientActivity.notifyIndexChanged();
    } else {
        mRedeliverNotifyIndexChanged = true;
    }
}