Search in sources :

Example 1 with MtpClient

use of com.android.gallery3d.ingest.data.MtpClient in project android_packages_apps_Gallery2 by LineageOS.

the class IngestService method onCreate.

@Override
public void onCreate() {
    super.onCreate();
    mScannerClient = new ScannerClient(this);
    mNotificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
    mNotificationBuilder = new NotificationCompat.Builder(this);
    // TODO(georgescu): Use a better drawable for the notificaton?
    mNotificationBuilder.setSmallIcon(android.R.drawable.stat_notify_sync).setContentIntent(PendingIntent.getActivity(this, 0, new Intent(this, IngestActivity.class), 0));
    mIndex = MtpDeviceIndex.getInstance();
    mIndex.setProgressListener(this);
    mClient = new MtpClient(getApplicationContext());
    List<MtpDevice> devices = mClient.getDeviceList();
    if (!devices.isEmpty()) {
        setDevice(devices.get(0));
    }
    mClient.addListener(this);
}
Also used : MtpDevice(android.mtp.MtpDevice) NotificationCompat(android.support.v4.app.NotificationCompat) Intent(android.content.Intent) PendingIntent(android.app.PendingIntent) MtpClient(com.android.gallery3d.ingest.data.MtpClient)

Aggregations

PendingIntent (android.app.PendingIntent)1 Intent (android.content.Intent)1 MtpDevice (android.mtp.MtpDevice)1 NotificationCompat (android.support.v4.app.NotificationCompat)1 MtpClient (com.android.gallery3d.ingest.data.MtpClient)1