Adjust tap targets in history
- Fix a crash if an app couldn't be launched - Fix the height of tap targets and overlap of text Fixes: 152977855 Fixes: 153199215 Change-Id: Id623f942c7663c977c61df3d1188fe498cab8acc
This commit is contained in:
@@ -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() {
|
||||
|
Reference in New Issue
Block a user