Loading packages/ExtServices/src/android/ext/services/notification/Assistant.java +1 −1 Original line number Diff line number Diff line Loading @@ -94,7 +94,7 @@ public class Assistant extends NotificationAssistantService { infile = mFile.openRead(); readXml(infile); } catch (FileNotFoundException e) { // No data yet Log.d(TAG, "File doesn't exist or isn't readable yet"); } catch (IOException e) { Log.e(TAG, "Unable to read channel impressions", e); } catch (NumberFormatException | XmlPullParserException e) { Loading packages/ExtServices/tests/src/android/ext/services/notification/AssistantTest.java +2 −2 Original line number Diff line number Diff line Loading @@ -325,7 +325,8 @@ public class AssistantTest extends ServiceTestCase<Assistant> { int dismiss2 = 777; String key2 = mAssistant.getKey("pkg2", 2, "channel2"); String xml = "<assistant version=\"1\">\n" String xml = "<?xml version='1.0' encoding='utf-8' standalone='yes' ?>" + "<assistant version=\"1\">\n" + "<impression-set key=\"" + key1 + "\" " + "dismisses=\"" + dismiss1 + "\" views=\"" + views1 + "\" streak=\"" + streak1 + "\"/>\n" Loading Loading @@ -377,7 +378,6 @@ public class AssistantTest extends ServiceTestCase<Assistant> { mAssistant.insertImpressions(key2, ci2); mAssistant.insertImpressions(key3, ci3); XmlSerializer serializer = new FastXmlSerializer(); ByteArrayOutputStream baos = new ByteArrayOutputStream(); serializer.setOutput(new BufferedOutputStream(baos), "utf-8"); Loading services/core/java/com/android/server/notification/ManagedServices.java +1 −1 Original line number Diff line number Diff line Loading @@ -771,7 +771,7 @@ abstract public class ManagedServices { * Called whenever packages change, the user switches, or the secure setting * is altered. (For example in response to USER_SWITCHED in our broadcast receiver) */ private void rebindServices(boolean forceRebind) { protected void rebindServices(boolean forceRebind) { if (DEBUG) Slog.d(TAG, "rebindServices"); final int[] userIds = mUserProfiles.getCurrentProfileIds(); final int nUserIds = userIds.length; Loading services/core/java/com/android/server/notification/NotificationManagerService.java +6 −0 Original line number Diff line number Diff line Loading @@ -5687,6 +5687,12 @@ public class NotificationManagerService extends SystemService { mListeners.unregisterService(removed.service, removed.userid); } @Override public void onUserUnlocked(int user) { if (DEBUG) Slog.d(TAG, "onUserUnlocked u=" + user); rebindServices(true); } public void onNotificationEnqueued(final NotificationRecord r) { final StatusBarNotification sbn = r.sbn; TrimCache trimCache = new TrimCache(sbn); Loading Loading
packages/ExtServices/src/android/ext/services/notification/Assistant.java +1 −1 Original line number Diff line number Diff line Loading @@ -94,7 +94,7 @@ public class Assistant extends NotificationAssistantService { infile = mFile.openRead(); readXml(infile); } catch (FileNotFoundException e) { // No data yet Log.d(TAG, "File doesn't exist or isn't readable yet"); } catch (IOException e) { Log.e(TAG, "Unable to read channel impressions", e); } catch (NumberFormatException | XmlPullParserException e) { Loading
packages/ExtServices/tests/src/android/ext/services/notification/AssistantTest.java +2 −2 Original line number Diff line number Diff line Loading @@ -325,7 +325,8 @@ public class AssistantTest extends ServiceTestCase<Assistant> { int dismiss2 = 777; String key2 = mAssistant.getKey("pkg2", 2, "channel2"); String xml = "<assistant version=\"1\">\n" String xml = "<?xml version='1.0' encoding='utf-8' standalone='yes' ?>" + "<assistant version=\"1\">\n" + "<impression-set key=\"" + key1 + "\" " + "dismisses=\"" + dismiss1 + "\" views=\"" + views1 + "\" streak=\"" + streak1 + "\"/>\n" Loading Loading @@ -377,7 +378,6 @@ public class AssistantTest extends ServiceTestCase<Assistant> { mAssistant.insertImpressions(key2, ci2); mAssistant.insertImpressions(key3, ci3); XmlSerializer serializer = new FastXmlSerializer(); ByteArrayOutputStream baos = new ByteArrayOutputStream(); serializer.setOutput(new BufferedOutputStream(baos), "utf-8"); Loading
services/core/java/com/android/server/notification/ManagedServices.java +1 −1 Original line number Diff line number Diff line Loading @@ -771,7 +771,7 @@ abstract public class ManagedServices { * Called whenever packages change, the user switches, or the secure setting * is altered. (For example in response to USER_SWITCHED in our broadcast receiver) */ private void rebindServices(boolean forceRebind) { protected void rebindServices(boolean forceRebind) { if (DEBUG) Slog.d(TAG, "rebindServices"); final int[] userIds = mUserProfiles.getCurrentProfileIds(); final int nUserIds = userIds.length; Loading
services/core/java/com/android/server/notification/NotificationManagerService.java +6 −0 Original line number Diff line number Diff line Loading @@ -5687,6 +5687,12 @@ public class NotificationManagerService extends SystemService { mListeners.unregisterService(removed.service, removed.userid); } @Override public void onUserUnlocked(int user) { if (DEBUG) Slog.d(TAG, "onUserUnlocked u=" + user); rebindServices(true); } public void onNotificationEnqueued(final NotificationRecord r) { final StatusBarNotification sbn = r.sbn; TrimCache trimCache = new TrimCache(sbn); Loading