Merge "Fix NPE in MtpDocumentsProviderTests" into oc-dev
am: ebb6e998d5
Change-Id: I8973b62b103f4f40275bc5681f54b5957385ecb1
This commit is contained in:
@@ -23,6 +23,7 @@ import android.app.NotificationManager;
|
|||||||
import android.content.ComponentName;
|
import android.content.ComponentName;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
import com.android.internal.annotations.VisibleForTesting;
|
||||||
import com.android.internal.util.Preconditions;
|
import com.android.internal.util.Preconditions;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -30,7 +31,7 @@ import com.android.internal.util.Preconditions;
|
|||||||
*/
|
*/
|
||||||
class ServiceIntentSender {
|
class ServiceIntentSender {
|
||||||
private final static String CHANNEL_ID = "device_notification_channel";
|
private final static String CHANNEL_ID = "device_notification_channel";
|
||||||
private Context mContext;
|
private final Context mContext;
|
||||||
|
|
||||||
ServiceIntentSender(Context context) {
|
ServiceIntentSender(Context context) {
|
||||||
mContext = context;
|
mContext = context;
|
||||||
@@ -46,6 +47,11 @@ class ServiceIntentSender {
|
|||||||
notificationManager.createNotificationChannel(mChannel);
|
notificationManager.createNotificationChannel(mChannel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@VisibleForTesting
|
||||||
|
protected ServiceIntentSender() {
|
||||||
|
mContext = null;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Notify the change of opened device set.
|
* Notify the change of opened device set.
|
||||||
* @param records List of opened devices. Can be empty.
|
* @param records List of opened devices. Can be empty.
|
||||||
|
|||||||
@@ -17,10 +17,6 @@
|
|||||||
package com.android.mtp;
|
package com.android.mtp;
|
||||||
|
|
||||||
class TestServiceIntentSender extends ServiceIntentSender {
|
class TestServiceIntentSender extends ServiceIntentSender {
|
||||||
TestServiceIntentSender() {
|
|
||||||
super(null);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
void sendUpdateNotificationIntent(MtpDeviceRecord[] record) {}
|
void sendUpdateNotificationIntent(MtpDeviceRecord[] record) {}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user