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:
Julia Reynolds
2020-04-06 14:10:15 -04:00
parent df338dd652
commit 94ad6a1959
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() {