Merge "Adjust tap targets in history" into rvc-dev am: 7c4557bec8 am: ceac4f44b9

Change-Id: Ib835a71df1f54be8544e4d85f872dd9e43defcba
This commit is contained in:
TreeHugger Robot
2020-04-07 14:40:27 +00:00
committed by Automerger Merge Worker
3 changed files with 65 additions and 70 deletions

View File

@@ -17,6 +17,7 @@
package com.android.settings.notification.history;
import android.app.PendingIntent;
import android.content.ActivityNotFoundException;
import android.content.Intent;
import android.graphics.drawable.Drawable;
import android.os.UserHandle;
@@ -91,10 +92,14 @@ public class NotificationSbnViewHolder extends RecyclerView.ViewHolder {
Slog.e(TAG, "Could not launch", e);
}
} else {
Intent appIntent = new Intent(Intent.ACTION_MAIN)
.setPackage(pkg);
Intent appIntent = itemView.getContext().getPackageManager()
.getLaunchIntentForPackage(pkg);
appIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
itemView.getContext().startActivityAsUser(appIntent, UserHandle.of(userId));
try {
itemView.getContext().startActivityAsUser(appIntent, UserHandle.of(userId));
} catch (ActivityNotFoundException e) {
Slog.e(TAG, "no launch activity", e);
}
}
});
ViewCompat.setAccessibilityDelegate(itemView, new AccessibilityDelegateCompat() {