code
stringlengths
11
173k
docstring
stringlengths
2
593k
func_name
stringlengths
2
189
language
stringclasses
1 value
repo
stringclasses
844 values
path
stringlengths
11
294
url
stringlengths
60
339
license
stringclasses
4 values
public int getId() { return mId; }
Returns the port id. @return port id
HdmiPortInfo::getId
java
Reginer/aosp-android-jar
android-31/src/android/hardware/hdmi/HdmiPortInfo.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/hardware/hdmi/HdmiPortInfo.java
MIT
public int getType() { return mType; }
Returns the port type. @return port type
HdmiPortInfo::getType
java
Reginer/aosp-android-jar
android-31/src/android/hardware/hdmi/HdmiPortInfo.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/hardware/hdmi/HdmiPortInfo.java
MIT
public int getAddress() { return mAddress; }
Returns the port address. @return port address
HdmiPortInfo::getAddress
java
Reginer/aosp-android-jar
android-31/src/android/hardware/hdmi/HdmiPortInfo.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/hardware/hdmi/HdmiPortInfo.java
MIT
public boolean isCecSupported() { return mCecSupported; }
Returns {@code true} if the port supports HDMI-CEC signaling. @return {@code true} if the port supports HDMI-CEC signaling.
HdmiPortInfo::isCecSupported
java
Reginer/aosp-android-jar
android-31/src/android/hardware/hdmi/HdmiPortInfo.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/hardware/hdmi/HdmiPortInfo.java
MIT
public boolean isMhlSupported() { return mMhlSupported; }
Returns {@code true} if the port supports MHL signaling. @return {@code true} if the port supports MHL signaling.
HdmiPortInfo::isMhlSupported
java
Reginer/aosp-android-jar
android-31/src/android/hardware/hdmi/HdmiPortInfo.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/hardware/hdmi/HdmiPortInfo.java
MIT
public boolean isArcSupported() { return mArcSupported; }
Returns {@code true} if the port supports audio return channel. @return {@code true} if the port supports audio return channel
HdmiPortInfo::isArcSupported
java
Reginer/aosp-android-jar
android-31/src/android/hardware/hdmi/HdmiPortInfo.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/hardware/hdmi/HdmiPortInfo.java
MIT
MoveInstallArgs(InstallParams params) { super(params); }
Logic to handle movement of existing installed applications. final class MoveInstallArgs extends InstallArgs { private File mCodeFile; /** New install
MoveInstallArgs::MoveInstallArgs
java
Reginer/aosp-android-jar
android-33/src/com/android/server/pm/MoveInstallArgs.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/server/pm/MoveInstallArgs.java
MIT
public void onNotificationPosted(StatusBarNotification sbn) { // optional }
Implement this method to learn about new notifications as they are posted by apps. @param sbn A data structure encapsulating the original {@link android.app.Notification} object as well as its identifying information (tag and id) and source (package name).
NotificationListenerService::onNotificationPosted
java
Reginer/aosp-android-jar
android-34/src/android/service/notification/NotificationListenerService.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/service/notification/NotificationListenerService.java
MIT
public void onNotificationPosted(StatusBarNotification sbn, RankingMap rankingMap) { onNotificationPosted(sbn); }
Implement this method to learn about new notifications as they are posted by apps. @param sbn A data structure encapsulating the original {@link android.app.Notification} object as well as its identifying information (tag and id) and source (package name). @param rankingMap The current ranking map that can be used to retrieve ranking information for active notifications, including the newly posted one.
NotificationListenerService::onNotificationPosted
java
Reginer/aosp-android-jar
android-34/src/android/service/notification/NotificationListenerService.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/service/notification/NotificationListenerService.java
MIT
public void onNotificationRemoved(StatusBarNotification sbn) { // optional }
Implement this method to learn when notifications are removed. <p> This might occur because the user has dismissed the notification using system UI (or another notification listener) or because the app has withdrawn the notification. <p> NOTE: The {@link StatusBarNotification} object you receive will be "light"; that is, the result from {@link StatusBarNotification#getNotification} may be missing some heavyweight fields such as {@link android.app.Notification#contentView} and {@link android.app.Notification#largeIcon}. However, all other fields on {@link StatusBarNotification}, sufficient to match this call with a prior call to {@link #onNotificationPosted(StatusBarNotification)}, will be intact. @param sbn A data structure encapsulating at least the original information (tag and id) and source (package name) used to post the {@link android.app.Notification} that was just removed.
NotificationListenerService::onNotificationRemoved
java
Reginer/aosp-android-jar
android-34/src/android/service/notification/NotificationListenerService.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/service/notification/NotificationListenerService.java
MIT
public void onNotificationRemoved(StatusBarNotification sbn, RankingMap rankingMap) { onNotificationRemoved(sbn); }
Implement this method to learn when notifications are removed. <p> This might occur because the user has dismissed the notification using system UI (or another notification listener) or because the app has withdrawn the notification. <p> NOTE: The {@link StatusBarNotification} object you receive will be "light"; that is, the result from {@link StatusBarNotification#getNotification} may be missing some heavyweight fields such as {@link android.app.Notification#contentView} and {@link android.app.Notification#largeIcon}. However, all other fields on {@link StatusBarNotification}, sufficient to match this call with a prior call to {@link #onNotificationPosted(StatusBarNotification)}, will be intact. @param sbn A data structure encapsulating at least the original information (tag and id) and source (package name) used to post the {@link android.app.Notification} that was just removed. @param rankingMap The current ranking map that can be used to retrieve ranking information for active notifications.
NotificationListenerService::onNotificationRemoved
java
Reginer/aosp-android-jar
android-34/src/android/service/notification/NotificationListenerService.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/service/notification/NotificationListenerService.java
MIT
public void onNotificationRemoved(StatusBarNotification sbn, RankingMap rankingMap, int reason) { onNotificationRemoved(sbn, rankingMap); }
Implement this method to learn when notifications are removed and why. <p> This might occur because the user has dismissed the notification using system UI (or another notification listener) or because the app has withdrawn the notification. <p> NOTE: The {@link StatusBarNotification} object you receive will be "light"; that is, the result from {@link StatusBarNotification#getNotification} may be missing some heavyweight fields such as {@link android.app.Notification#contentView} and {@link android.app.Notification#largeIcon}. However, all other fields on {@link StatusBarNotification}, sufficient to match this call with a prior call to {@link #onNotificationPosted(StatusBarNotification)}, will be intact. @param sbn A data structure encapsulating at least the original information (tag and id) and source (package name) used to post the {@link android.app.Notification} that was just removed. @param rankingMap The current ranking map that can be used to retrieve ranking information for active notifications. @param reason see {@link #REASON_LISTENER_CANCEL}, etc.
NotificationListenerService::onNotificationRemoved
java
Reginer/aosp-android-jar
android-34/src/android/service/notification/NotificationListenerService.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/service/notification/NotificationListenerService.java
MIT
public void onListenerConnected() { // optional }
Implement this method to learn about when the listener is enabled and connected to the notification manager. You are safe to call {@link #getActiveNotifications()} at this time.
NotificationListenerService::onListenerConnected
java
Reginer/aosp-android-jar
android-34/src/android/service/notification/NotificationListenerService.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/service/notification/NotificationListenerService.java
MIT
public void onListenerDisconnected() { // optional }
Implement this method to learn about when the listener is disconnected from the notification manager.You will not receive any events after this call, and may only call {@link #requestRebind(ComponentName)} at this time.
NotificationListenerService::onListenerDisconnected
java
Reginer/aosp-android-jar
android-34/src/android/service/notification/NotificationListenerService.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/service/notification/NotificationListenerService.java
MIT
public void onNotificationRankingUpdate(RankingMap rankingMap) { // optional }
Implement this method to be notified when the notification ranking changes. @param rankingMap The current ranking map that can be used to retrieve ranking information for active notifications.
NotificationListenerService::onNotificationRankingUpdate
java
Reginer/aosp-android-jar
android-34/src/android/service/notification/NotificationListenerService.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/service/notification/NotificationListenerService.java
MIT
public void onListenerHintsChanged(int hints) { // optional }
Implement this method to be notified when the {@link #getCurrentListenerHints() Listener hints} change. @param hints The current {@link #getCurrentListenerHints() listener hints}.
NotificationListenerService::onListenerHintsChanged
java
Reginer/aosp-android-jar
android-34/src/android/service/notification/NotificationListenerService.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/service/notification/NotificationListenerService.java
MIT
public void onSilentStatusBarIconsVisibilityChanged(boolean hideSilentStatusIcons) { // optional }
Implement this method to be notified when the behavior of silent notifications in the status bar changes. See {@link NotificationManager#shouldHideSilentStatusBarIcons()}. @param hideSilentStatusIcons whether or not status bar icons should be hidden for silent notifications
NotificationListenerService::onSilentStatusBarIconsVisibilityChanged
java
Reginer/aosp-android-jar
android-34/src/android/service/notification/NotificationListenerService.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/service/notification/NotificationListenerService.java
MIT
public void onNotificationChannelModified(String pkg, UserHandle user, NotificationChannel channel, @ChannelOrGroupModificationTypes int modificationType) { // optional }
Implement this method to learn about notification channel modifications. <p>The caller must have {@link CompanionDeviceManager#getAssociations() an associated device} in order to receive this callback. @param pkg The package the channel belongs to. @param user The user on which the change was made. @param channel The channel that has changed. @param modificationType One of {@link #NOTIFICATION_CHANNEL_OR_GROUP_ADDED}, {@link #NOTIFICATION_CHANNEL_OR_GROUP_UPDATED}, {@link #NOTIFICATION_CHANNEL_OR_GROUP_DELETED}.
NotificationListenerService::onNotificationChannelModified
java
Reginer/aosp-android-jar
android-34/src/android/service/notification/NotificationListenerService.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/service/notification/NotificationListenerService.java
MIT
public void onNotificationChannelGroupModified(String pkg, UserHandle user, NotificationChannelGroup group, @ChannelOrGroupModificationTypes int modificationType) { // optional }
Implement this method to learn about notification channel group modifications. <p>The caller must have {@link CompanionDeviceManager#getAssociations() an associated device} in order to receive this callback. @param pkg The package the group belongs to. @param user The user on which the change was made. @param group The group that has changed. @param modificationType One of {@link #NOTIFICATION_CHANNEL_OR_GROUP_ADDED}, {@link #NOTIFICATION_CHANNEL_OR_GROUP_UPDATED}, {@link #NOTIFICATION_CHANNEL_OR_GROUP_DELETED}.
NotificationListenerService::onNotificationChannelGroupModified
java
Reginer/aosp-android-jar
android-34/src/android/service/notification/NotificationListenerService.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/service/notification/NotificationListenerService.java
MIT
public void onInterruptionFilterChanged(int interruptionFilter) { // optional }
Implement this method to be notified when the {@link #getCurrentInterruptionFilter() interruption filter} changed. @param interruptionFilter The current {@link #getCurrentInterruptionFilter() interruption filter}.
NotificationListenerService::onInterruptionFilterChanged
java
Reginer/aosp-android-jar
android-34/src/android/service/notification/NotificationListenerService.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/service/notification/NotificationListenerService.java
MIT
public final void cancelNotification(String key) { if (!isBound()) return; try { getNotificationInterface().cancelNotificationsFromListener(mWrapper, new String[] { key }); } catch (android.os.RemoteException ex) { Log.v(TAG, "Unable to contact notification manager", ex); } }
Inform the notification manager about dismissal of a single notification. <p> Use this if your listener has a user interface that allows the user to dismiss individual notifications, similar to the behavior of Android's status bar and notification panel. It should be called after the user dismisses a single notification using your UI; upon being informed, the notification manager will actually remove the notification and you will get an {@link #onNotificationRemoved(StatusBarNotification)} callback. <p> <b>Note:</b> If your listener allows the user to fire a notification's {@link android.app.Notification#contentIntent} by tapping/clicking/etc., you should call this method at that time <i>if</i> the Notification in question has the {@link android.app.Notification#FLAG_AUTO_CANCEL} flag set. <p> <p>The service should wait for the {@link #onListenerConnected()} event before performing this operation. @param key Notification to dismiss from {@link StatusBarNotification#getKey()}.
NotificationListenerService::cancelNotification
java
Reginer/aosp-android-jar
android-34/src/android/service/notification/NotificationListenerService.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/service/notification/NotificationListenerService.java
MIT
public final void cancelAllNotifications() { cancelNotifications(null /*all*/); }
Inform the notification manager about dismissal of all notifications. <p> Use this if your listener has a user interface that allows the user to dismiss all notifications, similar to the behavior of Android's status bar and notification panel. It should be called after the user invokes the "dismiss all" function of your UI; upon being informed, the notification manager will actually remove all active notifications and you will get multiple {@link #onNotificationRemoved(StatusBarNotification)} callbacks. <p>The service should wait for the {@link #onListenerConnected()} event before performing this operation. {@see #cancelNotification(String, String, int)}
NotificationListenerService::cancelAllNotifications
java
Reginer/aosp-android-jar
android-34/src/android/service/notification/NotificationListenerService.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/service/notification/NotificationListenerService.java
MIT
public final void cancelNotifications(String[] keys) { if (!isBound()) return; try { getNotificationInterface().cancelNotificationsFromListener(mWrapper, keys); } catch (android.os.RemoteException ex) { Log.v(TAG, "Unable to contact notification manager", ex); } }
Inform the notification manager about dismissal of specific notifications. <p> Use this if your listener has a user interface that allows the user to dismiss multiple notifications at once. <p>The service should wait for the {@link #onListenerConnected()} event before performing this operation. @param keys Notifications to dismiss, or {@code null} to dismiss all. {@see #cancelNotification(String, String, int)}
NotificationListenerService::cancelNotifications
java
Reginer/aosp-android-jar
android-34/src/android/service/notification/NotificationListenerService.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/service/notification/NotificationListenerService.java
MIT
public final void snoozeNotification(String key, long durationMs) { if (!isBound()) return; try { getNotificationInterface().snoozeNotificationUntilFromListener( mWrapper, key, durationMs); } catch (android.os.RemoteException ex) { Log.v(TAG, "Unable to contact notification manager", ex); } }
Inform the notification manager about snoozing a specific notification. <p> Use this if your listener has a user interface that allows the user to snooze a notification for a time. It should be called after the user snoozes a single notification using your UI; upon being informed, the notification manager will actually remove the notification and you will get an {@link #onNotificationRemoved(StatusBarNotification)} callback. When the snoozing period expires, you will get a {@link #onNotificationPosted(StatusBarNotification, RankingMap)} callback for the notification. @param key The key of the notification to snooze @param durationMs A duration to snooze the notification for, in milliseconds.
NotificationListenerService::snoozeNotification
java
Reginer/aosp-android-jar
android-34/src/android/service/notification/NotificationListenerService.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/service/notification/NotificationListenerService.java
MIT
public final void migrateNotificationFilter(@NotificationFilterTypes int defaultTypes, @Nullable List<String> disallowedPkgs) { if (!isBound()) return; try { getNotificationInterface().migrateNotificationFilter( mWrapper, defaultTypes, disallowedPkgs); } catch (android.os.RemoteException ex) { Log.v(TAG, "Unable to contact notification manager", ex); } }
Lets an app migrate notification filters from its app into the OS. <p>This call will be ignored if the app has already migrated these settings or the user has set filters in the UI. This method is intended for user specific settings; if an app has already specified defaults types in its manifest with {@link #META_DATA_DEFAULT_FILTER_TYPES}, the defaultTypes option will be ignored.</p> @param defaultTypes A value representing the types of notifications that this listener should receive by default @param disallowedPkgs A list of package names whose notifications should not be seen by this listener, by default, because the listener does not process or display them, or because a user had previously disallowed these packages in the listener app's UI
NotificationListenerService::migrateNotificationFilter
java
Reginer/aosp-android-jar
android-34/src/android/service/notification/NotificationListenerService.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/service/notification/NotificationListenerService.java
MIT
public final void setNotificationsShown(String[] keys) { if (!isBound()) return; try { getNotificationInterface().setNotificationsShownFromListener(mWrapper, keys); } catch (android.os.RemoteException ex) { Log.v(TAG, "Unable to contact notification manager", ex); } }
Inform the notification manager that these notifications have been viewed by the user. This should only be called when there is sufficient confidence that the user is looking at the notifications, such as when the notifications appear on the screen due to an explicit user interaction. <p>The service should wait for the {@link #onListenerConnected()} event before performing this operation. @param keys Notifications to mark as seen.
NotificationListenerService::setNotificationsShown
java
Reginer/aosp-android-jar
android-34/src/android/service/notification/NotificationListenerService.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/service/notification/NotificationListenerService.java
MIT
public final void updateNotificationChannel(@NonNull String pkg, @NonNull UserHandle user, @NonNull NotificationChannel channel) { if (!isBound()) return; try { getNotificationInterface().updateNotificationChannelFromPrivilegedListener( mWrapper, pkg, user, channel); } catch (RemoteException e) { Log.v(TAG, "Unable to contact notification manager", e); throw e.rethrowFromSystemServer(); } }
Updates a notification channel for a given package for a given user. This should only be used to reflect changes a user has made to the channel via the listener's user interface. <p>This method will throw a security exception if you don't have access to notifications for the given user.</p> <p>The caller must have {@link CompanionDeviceManager#getAssociations() an associated device} in order to use this method. @param pkg The package the channel belongs to. @param user The user the channel belongs to. @param channel the channel to update.
NotificationListenerService::updateNotificationChannel
java
Reginer/aosp-android-jar
android-34/src/android/service/notification/NotificationListenerService.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/service/notification/NotificationListenerService.java
MIT
public final List<NotificationChannel> getNotificationChannels(@NonNull String pkg, @NonNull UserHandle user) { if (!isBound()) return null; try { return getNotificationInterface().getNotificationChannelsFromPrivilegedListener( mWrapper, pkg, user).getList(); } catch (RemoteException e) { Log.v(TAG, "Unable to contact notification manager", e); throw e.rethrowFromSystemServer(); } }
Returns all notification channels belonging to the given package for a given user. <p>This method will throw a security exception if you don't have access to notifications for the given user.</p> <p>The caller must have {@link CompanionDeviceManager#getAssociations() an associated device} or be the {@link NotificationAssistantService notification assistant} in order to use this method. @param pkg The package to retrieve channels for.
NotificationListenerService::getNotificationChannels
java
Reginer/aosp-android-jar
android-34/src/android/service/notification/NotificationListenerService.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/service/notification/NotificationListenerService.java
MIT
public final List<NotificationChannelGroup> getNotificationChannelGroups(@NonNull String pkg, @NonNull UserHandle user) { if (!isBound()) return null; try { return getNotificationInterface().getNotificationChannelGroupsFromPrivilegedListener( mWrapper, pkg, user).getList(); } catch (RemoteException e) { Log.v(TAG, "Unable to contact notification manager", e); throw e.rethrowFromSystemServer(); } }
Returns all notification channel groups belonging to the given package for a given user. <p>This method will throw a security exception if you don't have access to notifications for the given user.</p> <p>The caller must have {@link CompanionDeviceManager#getAssociations() an associated device} or be the {@link NotificationAssistantService notification assistant} in order to use this method. @param pkg The package to retrieve channel groups for.
NotificationListenerService::getNotificationChannelGroups
java
Reginer/aosp-android-jar
android-34/src/android/service/notification/NotificationListenerService.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/service/notification/NotificationListenerService.java
MIT
public StatusBarNotification[] getActiveNotifications() { StatusBarNotification[] activeNotifications = getActiveNotifications(null, TRIM_FULL); return activeNotifications != null ? activeNotifications : new StatusBarNotification[0]; }
Request the list of outstanding notifications (that is, those that are visible to the current user). Useful when you don't know what's already been posted. <p>The service should wait for the {@link #onListenerConnected()} event before performing this operation. @return An array of active notifications, sorted in natural order.
NotificationListenerService::getActiveNotifications
java
Reginer/aosp-android-jar
android-34/src/android/service/notification/NotificationListenerService.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/service/notification/NotificationListenerService.java
MIT
public final StatusBarNotification[] getSnoozedNotifications() { try { ParceledListSlice<StatusBarNotification> parceledList = getNotificationInterface() .getSnoozedNotificationsFromListener(mWrapper, TRIM_FULL); return cleanUpNotificationList(parceledList); } catch (android.os.RemoteException ex) { Log.v(TAG, "Unable to contact notification manager", ex); } return null; }
Like {@link #getActiveNotifications()}, but returns the list of currently snoozed notifications, for all users this listener has access to. <p>The service should wait for the {@link #onListenerConnected()} event before performing this operation. @return An array of snoozed notifications, sorted in natural order.
NotificationListenerService::getSnoozedNotifications
java
Reginer/aosp-android-jar
android-34/src/android/service/notification/NotificationListenerService.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/service/notification/NotificationListenerService.java
MIT
public StatusBarNotification[] getActiveNotifications(String[] keys) { StatusBarNotification[] activeNotifications = getActiveNotifications(keys, TRIM_FULL); return activeNotifications != null ? activeNotifications : new StatusBarNotification[0]; }
Request one or more notifications by key. Useful if you have been keeping track of notifications but didn't want to retain the bits, and now need to go back and extract more data out of those notifications. <p>The service should wait for the {@link #onListenerConnected()} event before performing this operation. @param keys the keys of the notifications to request @return An array of notifications corresponding to the requested keys, in the same order as the key list.
NotificationListenerService::getActiveNotifications
java
Reginer/aosp-android-jar
android-34/src/android/service/notification/NotificationListenerService.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/service/notification/NotificationListenerService.java
MIT
public final int getCurrentListenerHints() { if (!isBound()) return 0; try { return getNotificationInterface().getHintsFromListener(mWrapper); } catch (android.os.RemoteException ex) { Log.v(TAG, "Unable to contact notification manager", ex); return 0; } }
Gets the set of hints representing current state. <p> The current state may differ from the requested state if the hint represents state shared across all listeners or a feature the notification host does not support or refuses to grant. <p>The service should wait for the {@link #onListenerConnected()} event before performing this operation. @return Zero or more of the HINT_ constants.
NotificationListenerService::getCurrentListenerHints
java
Reginer/aosp-android-jar
android-34/src/android/service/notification/NotificationListenerService.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/service/notification/NotificationListenerService.java
MIT
public final int getCurrentInterruptionFilter() { if (!isBound()) return INTERRUPTION_FILTER_UNKNOWN; try { return getNotificationInterface().getInterruptionFilterFromListener(mWrapper); } catch (android.os.RemoteException ex) { Log.v(TAG, "Unable to contact notification manager", ex); return INTERRUPTION_FILTER_UNKNOWN; } }
Gets the current notification interruption filter active on the host. <p> The interruption filter defines which notifications are allowed to interrupt the user (e.g. via sound &amp; vibration) and is applied globally. Listeners can find out whether a specific notification matched the interruption filter via {@link Ranking#matchesInterruptionFilter()}. <p> The current filter may differ from the previously requested filter if the notification host does not support or refuses to apply the requested filter, or if another component changed the filter in the meantime. <p> Listen for updates using {@link #onInterruptionFilterChanged(int)}. <p>The service should wait for the {@link #onListenerConnected()} event before performing this operation. @return One of the INTERRUPTION_FILTER_ constants, or INTERRUPTION_FILTER_UNKNOWN when unavailable.
NotificationListenerService::getCurrentInterruptionFilter
java
Reginer/aosp-android-jar
android-34/src/android/service/notification/NotificationListenerService.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/service/notification/NotificationListenerService.java
MIT
public final void clearRequestedListenerHints() { if (!isBound()) return; try { getNotificationInterface().clearRequestedListenerHints(mWrapper); } catch (android.os.RemoteException ex) { Log.v(TAG, "Unable to contact notification manager", ex); } }
Clears listener hints set via {@link #getCurrentListenerHints()}. <p>The service should wait for the {@link #onListenerConnected()} event before performing this operation.
NotificationListenerService::clearRequestedListenerHints
java
Reginer/aosp-android-jar
android-34/src/android/service/notification/NotificationListenerService.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/service/notification/NotificationListenerService.java
MIT
public final void requestListenerHints(int hints) { if (!isBound()) return; try { getNotificationInterface().requestHintsFromListener(mWrapper, hints); } catch (android.os.RemoteException ex) { Log.v(TAG, "Unable to contact notification manager", ex); } }
Sets the desired {@link #getCurrentListenerHints() listener hints}. <p> This is merely a request, the host may or may not choose to take action depending on other listener requests or other global state. <p> Listen for updates using {@link #onListenerHintsChanged(int)}. <p>The service should wait for the {@link #onListenerConnected()} event before performing this operation. @param hints One or more of the HINT_ constants.
NotificationListenerService::requestListenerHints
java
Reginer/aosp-android-jar
android-34/src/android/service/notification/NotificationListenerService.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/service/notification/NotificationListenerService.java
MIT
public final void requestInterruptionFilter(int interruptionFilter) { if (!isBound()) return; try { getNotificationInterface() .requestInterruptionFilterFromListener(mWrapper, interruptionFilter); } catch (android.os.RemoteException ex) { Log.v(TAG, "Unable to contact notification manager", ex); } }
Sets the desired {@link #getCurrentInterruptionFilter() interruption filter}. <p> This is merely a request, the host may or may not choose to apply the requested interruption filter depending on other listener requests or other global state. <p> Listen for updates using {@link #onInterruptionFilterChanged(int)}. <p>The service should wait for the {@link #onListenerConnected()} event before performing this operation. @param interruptionFilter One of the INTERRUPTION_FILTER_ constants.
NotificationListenerService::requestInterruptionFilter
java
Reginer/aosp-android-jar
android-34/src/android/service/notification/NotificationListenerService.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/service/notification/NotificationListenerService.java
MIT
public RankingMap getCurrentRanking() { synchronized (mLock) { return mRankingMap; } }
Returns current ranking information. <p> The returned object represents the current ranking snapshot and only applies for currently active notifications. <p> Generally you should use the RankingMap that is passed with events such as {@link #onNotificationPosted(StatusBarNotification, RankingMap)}, {@link #onNotificationRemoved(StatusBarNotification, RankingMap)}, and so on. This method should only be used when needing access outside of such events, for example to retrieve the RankingMap right after initialization. <p>The service should wait for the {@link #onListenerConnected()} event before performing this operation. @return A {@link RankingMap} object providing access to ranking information
NotificationListenerService::getCurrentRanking
java
Reginer/aosp-android-jar
android-34/src/android/service/notification/NotificationListenerService.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/service/notification/NotificationListenerService.java
MIT
public static void requestRebind(ComponentName componentName) { INotificationManager noMan = INotificationManager.Stub.asInterface( ServiceManager.getService(Context.NOTIFICATION_SERVICE)); try { noMan.requestBindListener(componentName); } catch (RemoteException ex) { throw ex.rethrowFromSystemServer(); } }
Request that the listener be rebound, after a previous call to {@link #requestUnbind}. <p>This method will fail for listeners that have not been granted the permission by the user.
NotificationListenerService::requestRebind
java
Reginer/aosp-android-jar
android-34/src/android/service/notification/NotificationListenerService.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/service/notification/NotificationListenerService.java
MIT
public static void requestUnbind(@NonNull ComponentName componentName) { INotificationManager noMan = INotificationManager.Stub.asInterface( ServiceManager.getService(Context.NOTIFICATION_SERVICE)); try { noMan.requestUnbindListenerComponent(componentName); } catch (RemoteException ex) { throw ex.rethrowFromSystemServer(); } }
Request that the service be unbound. <p>This method will fail for components that are not part of the calling app.
NotificationListenerService::requestUnbind
java
Reginer/aosp-android-jar
android-34/src/android/service/notification/NotificationListenerService.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/service/notification/NotificationListenerService.java
MIT
public final void requestUnbind() { if (mWrapper != null) { INotificationManager noMan = getNotificationInterface(); try { noMan.requestUnbindListener(mWrapper); // Disable future messages. isConnected = false; } catch (RemoteException ex) { throw ex.rethrowFromSystemServer(); } } }
Request that the service be unbound. <p>Once this is called, you will no longer receive updates and no method calls are guaranteed to be successful, until you next receive the {@link #onListenerConnected()} event. The service will likely be killed by the system after this call. <p>The service should wait for the {@link #onListenerConnected()} event before performing this operation. I know it's tempting, but you must wait.
NotificationListenerService::requestUnbind
java
Reginer/aosp-android-jar
android-34/src/android/service/notification/NotificationListenerService.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/service/notification/NotificationListenerService.java
MIT
public final void createLegacyIconExtras(Notification n) { if (getContext().getApplicationInfo().targetSdkVersion < Build.VERSION_CODES.M) { Icon smallIcon = n.getSmallIcon(); Icon largeIcon = n.getLargeIcon(); if (smallIcon != null && smallIcon.getType() == Icon.TYPE_RESOURCE) { n.extras.putInt(Notification.EXTRA_SMALL_ICON, smallIcon.getResId()); n.icon = smallIcon.getResId(); } if (largeIcon != null) { Drawable d = largeIcon.loadDrawable(getContext()); if (d != null && d instanceof BitmapDrawable) { final Bitmap largeIconBits = ((BitmapDrawable) d).getBitmap(); n.extras.putParcelable(Notification.EXTRA_LARGE_ICON, largeIconBits); n.largeIcon = largeIconBits; } } } }
Convert new-style Icons to legacy representations for pre-M clients. @hide
NotificationListenerService::createLegacyIconExtras
java
Reginer/aosp-android-jar
android-34/src/android/service/notification/NotificationListenerService.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/service/notification/NotificationListenerService.java
MIT
private void maybePopulateRemoteViews(Notification notification) { if (getContext().getApplicationInfo().targetSdkVersion < Build.VERSION_CODES.N) { Builder builder = Builder.recoverBuilder(getContext(), notification); // Some styles wrap Notification's contentView, bigContentView and headsUpContentView. // First inflate them all, only then set them to avoid recursive wrapping. RemoteViews content = builder.createContentView(); RemoteViews big = builder.createBigContentView(); RemoteViews headsUp = builder.createHeadsUpContentView(); notification.contentView = content; notification.bigContentView = big; notification.headsUpContentView = headsUp; } }
Populates remote views for pre-N targeting apps.
NotificationListenerService::maybePopulateRemoteViews
java
Reginer/aosp-android-jar
android-34/src/android/service/notification/NotificationListenerService.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/service/notification/NotificationListenerService.java
MIT
public RankingMap(Ranking[] rankings) { for (int i = 0; i < rankings.length; i++) { final String key = rankings[i].getKey(); mOrderedKeys.add(key); mRankings.put(key, rankings[i]); } }
@hide
RankingMap::RankingMap
java
Reginer/aosp-android-jar
android-34/src/android/service/notification/NotificationListenerService.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/service/notification/NotificationListenerService.java
MIT
public String[] getOrderedKeys() { return mOrderedKeys.toArray(new String[0]); }
Request the list of notification keys in their current ranking order. @return An array of active notification keys, in their ranking order.
RankingMap::getOrderedKeys
java
Reginer/aosp-android-jar
android-34/src/android/service/notification/NotificationListenerService.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/service/notification/NotificationListenerService.java
MIT
public boolean getRanking(String key, Ranking outRanking) { if (mRankings.containsKey(key)) { outRanking.populate(mRankings.get(key)); return true; } return false; }
Populates outRanking with ranking information for the notification with the given key. @return true if a valid key has been passed and outRanking has been populated; false otherwise
RankingMap::getRanking
java
Reginer/aosp-android-jar
android-34/src/android/service/notification/NotificationListenerService.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/service/notification/NotificationListenerService.java
MIT
public void addArea(RectF area) { mCallbackAreas.add(area); }
This class represents a page of a launcher page used by the wallpaper @hide public class EngineWindowPage { private Bitmap mScreenShot; private volatile long mLastUpdateTime = 0; private Set<RectF> mCallbackAreas = new ArraySet<>(); private Map<RectF, WallpaperColors> mRectFColors = new ArrayMap<>(); /** should be locked extrnally
EngineWindowPage::addArea
java
Reginer/aosp-android-jar
android-35/src/android/service/wallpaper/EngineWindowPage.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/service/wallpaper/EngineWindowPage.java
MIT
public void addWallpaperColors(RectF area, WallpaperColors colors) { mCallbackAreas.add(area); mRectFColors.put(area, colors); }
This class represents a page of a launcher page used by the wallpaper @hide public class EngineWindowPage { private Bitmap mScreenShot; private volatile long mLastUpdateTime = 0; private Set<RectF> mCallbackAreas = new ArraySet<>(); private Map<RectF, WallpaperColors> mRectFColors = new ArrayMap<>(); /** should be locked extrnally public void addArea(RectF area) { mCallbackAreas.add(area); } /** should be locked extrnally
EngineWindowPage::addWallpaperColors
java
Reginer/aosp-android-jar
android-35/src/android/service/wallpaper/EngineWindowPage.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/service/wallpaper/EngineWindowPage.java
MIT
public Bitmap getBitmap() { if (mScreenShot == null || mScreenShot.isRecycled()) return null; return mScreenShot; }
This class represents a page of a launcher page used by the wallpaper @hide public class EngineWindowPage { private Bitmap mScreenShot; private volatile long mLastUpdateTime = 0; private Set<RectF> mCallbackAreas = new ArraySet<>(); private Map<RectF, WallpaperColors> mRectFColors = new ArrayMap<>(); /** should be locked extrnally public void addArea(RectF area) { mCallbackAreas.add(area); } /** should be locked extrnally public void addWallpaperColors(RectF area, WallpaperColors colors) { mCallbackAreas.add(area); mRectFColors.put(area, colors); } /** get screenshot bitmap
EngineWindowPage::getBitmap
java
Reginer/aosp-android-jar
android-35/src/android/service/wallpaper/EngineWindowPage.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/service/wallpaper/EngineWindowPage.java
MIT
public void removeArea(RectF area) { mCallbackAreas.remove(area); mRectFColors.remove(area); }
This class represents a page of a launcher page used by the wallpaper @hide public class EngineWindowPage { private Bitmap mScreenShot; private volatile long mLastUpdateTime = 0; private Set<RectF> mCallbackAreas = new ArraySet<>(); private Map<RectF, WallpaperColors> mRectFColors = new ArrayMap<>(); /** should be locked extrnally public void addArea(RectF area) { mCallbackAreas.add(area); } /** should be locked extrnally public void addWallpaperColors(RectF area, WallpaperColors colors) { mCallbackAreas.add(area); mRectFColors.put(area, colors); } /** get screenshot bitmap public Bitmap getBitmap() { if (mScreenShot == null || mScreenShot.isRecycled()) return null; return mScreenShot; } /** remove callbacks for an area
EngineWindowPage::removeArea
java
Reginer/aosp-android-jar
android-35/src/android/service/wallpaper/EngineWindowPage.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/service/wallpaper/EngineWindowPage.java
MIT
public void setLastUpdateTime(long lastUpdateTime) { mLastUpdateTime = lastUpdateTime; }
This class represents a page of a launcher page used by the wallpaper @hide public class EngineWindowPage { private Bitmap mScreenShot; private volatile long mLastUpdateTime = 0; private Set<RectF> mCallbackAreas = new ArraySet<>(); private Map<RectF, WallpaperColors> mRectFColors = new ArrayMap<>(); /** should be locked extrnally public void addArea(RectF area) { mCallbackAreas.add(area); } /** should be locked extrnally public void addWallpaperColors(RectF area, WallpaperColors colors) { mCallbackAreas.add(area); mRectFColors.put(area, colors); } /** get screenshot bitmap public Bitmap getBitmap() { if (mScreenShot == null || mScreenShot.isRecycled()) return null; return mScreenShot; } /** remove callbacks for an area public void removeArea(RectF area) { mCallbackAreas.remove(area); mRectFColors.remove(area); } /** set the last time the screenshot was updated
EngineWindowPage::setLastUpdateTime
java
Reginer/aosp-android-jar
android-35/src/android/service/wallpaper/EngineWindowPage.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/service/wallpaper/EngineWindowPage.java
MIT
public long getLastUpdateTime() { return mLastUpdateTime; }
This class represents a page of a launcher page used by the wallpaper @hide public class EngineWindowPage { private Bitmap mScreenShot; private volatile long mLastUpdateTime = 0; private Set<RectF> mCallbackAreas = new ArraySet<>(); private Map<RectF, WallpaperColors> mRectFColors = new ArrayMap<>(); /** should be locked extrnally public void addArea(RectF area) { mCallbackAreas.add(area); } /** should be locked extrnally public void addWallpaperColors(RectF area, WallpaperColors colors) { mCallbackAreas.add(area); mRectFColors.put(area, colors); } /** get screenshot bitmap public Bitmap getBitmap() { if (mScreenShot == null || mScreenShot.isRecycled()) return null; return mScreenShot; } /** remove callbacks for an area public void removeArea(RectF area) { mCallbackAreas.remove(area); mRectFColors.remove(area); } /** set the last time the screenshot was updated public void setLastUpdateTime(long lastUpdateTime) { mLastUpdateTime = lastUpdateTime; } /** get last screenshot time
EngineWindowPage::getLastUpdateTime
java
Reginer/aosp-android-jar
android-35/src/android/service/wallpaper/EngineWindowPage.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/service/wallpaper/EngineWindowPage.java
MIT
public WallpaperColors getColors(RectF rect) { return mRectFColors.get(rect); }
This class represents a page of a launcher page used by the wallpaper @hide public class EngineWindowPage { private Bitmap mScreenShot; private volatile long mLastUpdateTime = 0; private Set<RectF> mCallbackAreas = new ArraySet<>(); private Map<RectF, WallpaperColors> mRectFColors = new ArrayMap<>(); /** should be locked extrnally public void addArea(RectF area) { mCallbackAreas.add(area); } /** should be locked extrnally public void addWallpaperColors(RectF area, WallpaperColors colors) { mCallbackAreas.add(area); mRectFColors.put(area, colors); } /** get screenshot bitmap public Bitmap getBitmap() { if (mScreenShot == null || mScreenShot.isRecycled()) return null; return mScreenShot; } /** remove callbacks for an area public void removeArea(RectF area) { mCallbackAreas.remove(area); mRectFColors.remove(area); } /** set the last time the screenshot was updated public void setLastUpdateTime(long lastUpdateTime) { mLastUpdateTime = lastUpdateTime; } /** get last screenshot time public long getLastUpdateTime() { return mLastUpdateTime; } /** get colors for an area
EngineWindowPage::getColors
java
Reginer/aosp-android-jar
android-35/src/android/service/wallpaper/EngineWindowPage.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/service/wallpaper/EngineWindowPage.java
MIT
public void setBitmap(Bitmap screenShot) { mScreenShot = screenShot; }
This class represents a page of a launcher page used by the wallpaper @hide public class EngineWindowPage { private Bitmap mScreenShot; private volatile long mLastUpdateTime = 0; private Set<RectF> mCallbackAreas = new ArraySet<>(); private Map<RectF, WallpaperColors> mRectFColors = new ArrayMap<>(); /** should be locked extrnally public void addArea(RectF area) { mCallbackAreas.add(area); } /** should be locked extrnally public void addWallpaperColors(RectF area, WallpaperColors colors) { mCallbackAreas.add(area); mRectFColors.put(area, colors); } /** get screenshot bitmap public Bitmap getBitmap() { if (mScreenShot == null || mScreenShot.isRecycled()) return null; return mScreenShot; } /** remove callbacks for an area public void removeArea(RectF area) { mCallbackAreas.remove(area); mRectFColors.remove(area); } /** set the last time the screenshot was updated public void setLastUpdateTime(long lastUpdateTime) { mLastUpdateTime = lastUpdateTime; } /** get last screenshot time public long getLastUpdateTime() { return mLastUpdateTime; } /** get colors for an area public WallpaperColors getColors(RectF rect) { return mRectFColors.get(rect); } /** set the new bitmap version
EngineWindowPage::setBitmap
java
Reginer/aosp-android-jar
android-35/src/android/service/wallpaper/EngineWindowPage.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/service/wallpaper/EngineWindowPage.java
MIT
public Set<RectF> getAreas() { return mCallbackAreas; }
This class represents a page of a launcher page used by the wallpaper @hide public class EngineWindowPage { private Bitmap mScreenShot; private volatile long mLastUpdateTime = 0; private Set<RectF> mCallbackAreas = new ArraySet<>(); private Map<RectF, WallpaperColors> mRectFColors = new ArrayMap<>(); /** should be locked extrnally public void addArea(RectF area) { mCallbackAreas.add(area); } /** should be locked extrnally public void addWallpaperColors(RectF area, WallpaperColors colors) { mCallbackAreas.add(area); mRectFColors.put(area, colors); } /** get screenshot bitmap public Bitmap getBitmap() { if (mScreenShot == null || mScreenShot.isRecycled()) return null; return mScreenShot; } /** remove callbacks for an area public void removeArea(RectF area) { mCallbackAreas.remove(area); mRectFColors.remove(area); } /** set the last time the screenshot was updated public void setLastUpdateTime(long lastUpdateTime) { mLastUpdateTime = lastUpdateTime; } /** get last screenshot time public long getLastUpdateTime() { return mLastUpdateTime; } /** get colors for an area public WallpaperColors getColors(RectF rect) { return mRectFColors.get(rect); } /** set the new bitmap version public void setBitmap(Bitmap screenShot) { mScreenShot = screenShot; } /** get areas of interest
EngineWindowPage::getAreas
java
Reginer/aosp-android-jar
android-35/src/android/service/wallpaper/EngineWindowPage.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/service/wallpaper/EngineWindowPage.java
MIT
public void removeColor(RectF colorArea) { mRectFColors.remove(colorArea); }
This class represents a page of a launcher page used by the wallpaper @hide public class EngineWindowPage { private Bitmap mScreenShot; private volatile long mLastUpdateTime = 0; private Set<RectF> mCallbackAreas = new ArraySet<>(); private Map<RectF, WallpaperColors> mRectFColors = new ArrayMap<>(); /** should be locked extrnally public void addArea(RectF area) { mCallbackAreas.add(area); } /** should be locked extrnally public void addWallpaperColors(RectF area, WallpaperColors colors) { mCallbackAreas.add(area); mRectFColors.put(area, colors); } /** get screenshot bitmap public Bitmap getBitmap() { if (mScreenShot == null || mScreenShot.isRecycled()) return null; return mScreenShot; } /** remove callbacks for an area public void removeArea(RectF area) { mCallbackAreas.remove(area); mRectFColors.remove(area); } /** set the last time the screenshot was updated public void setLastUpdateTime(long lastUpdateTime) { mLastUpdateTime = lastUpdateTime; } /** get last screenshot time public long getLastUpdateTime() { return mLastUpdateTime; } /** get colors for an area public WallpaperColors getColors(RectF rect) { return mRectFColors.get(rect); } /** set the new bitmap version public void setBitmap(Bitmap screenShot) { mScreenShot = screenShot; } /** get areas of interest public Set<RectF> getAreas() { return mCallbackAreas; } /** nullify the area color
EngineWindowPage::removeColor
java
Reginer/aosp-android-jar
android-35/src/android/service/wallpaper/EngineWindowPage.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/android/service/wallpaper/EngineWindowPage.java
MIT
public IpPrefix(@NonNull byte[] address, @IntRange(from = 0, to = 128) int prefixLength) { this.address = address.clone(); this.prefixLength = prefixLength; checkAndMaskAddressAndPrefixLength(); }
Constructs a new {@code IpPrefix} from a byte array containing an IPv4 or IPv6 address in network byte order and a prefix length. Silently truncates the address to the prefix length, so for example {@code 192.0.2.1/24} is silently converted to {@code 192.0.2.0/24}. @param address the IP address. Must be non-null and exactly 4 or 16 bytes long. @param prefixLength the prefix length. Must be &gt;= 0 and &lt;= (32 or 128) (IPv4 or IPv6). @hide
IpPrefix::IpPrefix
java
Reginer/aosp-android-jar
android-34/src/android/net/IpPrefix.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/net/IpPrefix.java
MIT
public IpPrefix(@NonNull InetAddress address, @IntRange(from = 0, to = 128) int prefixLength) { // We don't reuse the (byte[], int) constructor because it calls clone() on the byte array, // which is unnecessary because getAddress() already returns a clone. this.address = address.getAddress(); this.prefixLength = prefixLength; checkAndMaskAddressAndPrefixLength(); }
Constructs a new {@code IpPrefix} from an IPv4 or IPv6 address and a prefix length. Silently truncates the address to the prefix length, so for example {@code 192.0.2.1/24} is silently converted to {@code 192.0.2.0/24}. @param address the IP address. Must be non-null. @param prefixLength the prefix length. Must be &gt;= 0 and &lt;= (32 or 128) (IPv4 or IPv6).
IpPrefix::IpPrefix
java
Reginer/aosp-android-jar
android-34/src/android/net/IpPrefix.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/net/IpPrefix.java
MIT
public @NonNull InetAddress getAddress() { try { return InetAddress.getByAddress(address); } catch (UnknownHostException e) { // Cannot happen. InetAddress.getByAddress can only throw an exception if the byte // array is the wrong length, but we check that in the constructor. throw new IllegalArgumentException("Address is invalid"); } }
Returns a copy of the first IP address in the prefix. Modifying the returned object does not change this object's contents. @return the address in the form of a byte array.
IpPrefix::getAddress
java
Reginer/aosp-android-jar
android-34/src/android/net/IpPrefix.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/net/IpPrefix.java
MIT
public @NonNull byte[] getRawAddress() { return address.clone(); }
Returns a copy of the IP address bytes in network order (the highest order byte is the zeroth element). Modifying the returned array does not change this object's contents. @return the address in the form of a byte array.
IpPrefix::getRawAddress
java
Reginer/aosp-android-jar
android-34/src/android/net/IpPrefix.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/net/IpPrefix.java
MIT
public boolean contains(@NonNull InetAddress address) { byte[] addrBytes = address.getAddress(); if (addrBytes == null || addrBytes.length != this.address.length) { return false; } NetUtils.maskRawAddress(addrBytes, prefixLength); return Arrays.equals(this.address, addrBytes); }
Determines whether the prefix contains the specified address. @param address An {@link InetAddress} to test. @return {@code true} if the prefix covers the given address. {@code false} otherwise.
IpPrefix::contains
java
Reginer/aosp-android-jar
android-34/src/android/net/IpPrefix.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/net/IpPrefix.java
MIT
public boolean containsPrefix(@NonNull IpPrefix otherPrefix) { if (otherPrefix.getPrefixLength() < prefixLength) return false; final byte[] otherAddress = otherPrefix.getRawAddress(); NetUtils.maskRawAddress(otherAddress, prefixLength); return Arrays.equals(otherAddress, address); }
Returns whether the specified prefix is entirely contained in this prefix. Note this is mathematical inclusion, so a prefix is always contained within itself. @param otherPrefix the prefix to test @hide
IpPrefix::containsPrefix
java
Reginer/aosp-android-jar
android-34/src/android/net/IpPrefix.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/net/IpPrefix.java
MIT
public boolean isIPv6() { return getAddress() instanceof Inet6Address; }
@hide
IpPrefix::isIPv6
java
Reginer/aosp-android-jar
android-34/src/android/net/IpPrefix.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/net/IpPrefix.java
MIT
public boolean isIPv4() { return getAddress() instanceof Inet4Address; }
@hide
IpPrefix::isIPv4
java
Reginer/aosp-android-jar
android-34/src/android/net/IpPrefix.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/net/IpPrefix.java
MIT
public String toString() { try { return InetAddress.getByAddress(address).getHostAddress() + "/" + prefixLength; } catch(UnknownHostException e) { // Cosmic rays? throw new IllegalStateException("IpPrefix with invalid address! Shouldn't happen.", e); } }
Returns a string representation of this {@code IpPrefix}. @return a string such as {@code "192.0.2.0/24"} or {@code "2001:db8:1:2::/64"}.
IpPrefix::toString
java
Reginer/aosp-android-jar
android-34/src/android/net/IpPrefix.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/net/IpPrefix.java
MIT
public int describeContents() { return 0; }
Implement the Parcelable interface.
IpPrefix::describeContents
java
Reginer/aosp-android-jar
android-34/src/android/net/IpPrefix.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/net/IpPrefix.java
MIT
public void writeToParcel(Parcel dest, int flags) { dest.writeByteArray(address); dest.writeInt(prefixLength); }
Implement the Parcelable interface.
IpPrefix::writeToParcel
java
Reginer/aosp-android-jar
android-34/src/android/net/IpPrefix.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/net/IpPrefix.java
MIT
public static Comparator<IpPrefix> lengthComparator() { return new Comparator<IpPrefix>() { @Override public int compare(IpPrefix prefix1, IpPrefix prefix2) { if (prefix1.isIPv4()) { if (prefix2.isIPv6()) return -1; } else { if (prefix2.isIPv4()) return 1; } final int p1len = prefix1.getPrefixLength(); final int p2len = prefix2.getPrefixLength(); if (p1len < p2len) return -1; if (p2len < p1len) return 1; final byte[] a1 = prefix1.address; final byte[] a2 = prefix2.address; final int len = a1.length < a2.length ? a1.length : a2.length; for (int i = 0; i < len; ++i) { if (a1[i] < a2[i]) return -1; if (a1[i] > a2[i]) return 1; } if (a2.length < len) return 1; if (a1.length < len) return -1; return 0; } }; }
Returns a comparator ordering IpPrefixes by length, shorter to longer. Contents of the address will break ties. @hide
IpPrefix::lengthComparator
java
Reginer/aosp-android-jar
android-34/src/android/net/IpPrefix.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/net/IpPrefix.java
MIT
public NoSuchFieldError() { super(); }
Constructs a <code>NoSuchFieldError</code> with no detail message.
NoSuchFieldError::NoSuchFieldError
java
Reginer/aosp-android-jar
android-33/src/java/lang/NoSuchFieldError.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/java/lang/NoSuchFieldError.java
MIT
public NoSuchFieldError(String s) { super(s); }
Constructs a <code>NoSuchFieldError</code> with the specified detail message. @param s the detail message.
NoSuchFieldError::NoSuchFieldError
java
Reginer/aosp-android-jar
android-33/src/java/lang/NoSuchFieldError.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/java/lang/NoSuchFieldError.java
MIT
private DatatypeConstants() { }
<p>Private constructor to prevent instantiation.</p>
DatatypeConstants::DatatypeConstants
java
Reginer/aosp-android-jar
android-32/src/javax/xml/datatype/DatatypeConstants.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/javax/xml/datatype/DatatypeConstants.java
MIT
private Field(final String str, final int id) { this.str = str; this.id = id; }
<p>Construct a <code>Field</code> with specified values.</p> @param str <code>String</code> representation of <code>Field</code> @param id <code>int</code> representation of <code>Field</code>
Field::Field
java
Reginer/aosp-android-jar
android-32/src/javax/xml/datatype/DatatypeConstants.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/javax/xml/datatype/DatatypeConstants.java
MIT
public String toString() { return str; }
Returns a field name in English. This method is intended to be used for debugging/diagnosis and not for display to end-users. @return a non-null valid String constant.
Field::toString
java
Reginer/aosp-android-jar
android-32/src/javax/xml/datatype/DatatypeConstants.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/javax/xml/datatype/DatatypeConstants.java
MIT
public int getId() { return id; }
<p>Get id of this Field.</p> @return Id of field.
Field::getId
java
Reginer/aosp-android-jar
android-32/src/javax/xml/datatype/DatatypeConstants.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/javax/xml/datatype/DatatypeConstants.java
MIT
public void setOnRatingBarChangeListener(OnRatingBarChangeListener listener) { mOnRatingBarChangeListener = listener; }
Sets the listener to be called when the rating changes. @param listener The listener.
RatingBar::setOnRatingBarChangeListener
java
Reginer/aosp-android-jar
android-31/src/android/widget/RatingBar.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/widget/RatingBar.java
MIT
public OnRatingBarChangeListener getOnRatingBarChangeListener() { return mOnRatingBarChangeListener; }
@return The listener (may be null) that is listening for rating change events.
RatingBar::getOnRatingBarChangeListener
java
Reginer/aosp-android-jar
android-31/src/android/widget/RatingBar.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/widget/RatingBar.java
MIT
public void setIsIndicator(boolean isIndicator) { mIsUserSeekable = !isIndicator; if (isIndicator) { setFocusable(FOCUSABLE_AUTO); } else { setFocusable(FOCUSABLE); } }
Whether this rating bar should only be an indicator (thus non-changeable by the user). @param isIndicator Whether it should be an indicator. @attr ref android.R.styleable#RatingBar_isIndicator
RatingBar::setIsIndicator
java
Reginer/aosp-android-jar
android-31/src/android/widget/RatingBar.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/widget/RatingBar.java
MIT
public void setNumStars(final int numStars) { if (numStars <= 0) { return; } mNumStars = numStars; // This causes the width to change, so re-layout requestLayout(); }
Sets the number of stars to show. In order for these to be shown properly, it is recommended the layout width of this widget be wrap content. @param numStars The number of stars.
RatingBar::setNumStars
java
Reginer/aosp-android-jar
android-31/src/android/widget/RatingBar.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/widget/RatingBar.java
MIT
public void setRating(float rating) { setProgress(Math.round(rating * getProgressPerStar())); }
Sets the rating (the number of stars filled). @param rating The rating to set.
RatingBar::setRating
java
Reginer/aosp-android-jar
android-31/src/android/widget/RatingBar.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/widget/RatingBar.java
MIT
public void setStepSize(float stepSize) { if (stepSize <= 0) { return; } final float newMax = mNumStars / stepSize; final int newProgress = (int) (newMax / getMax() * getProgress()); setMax((int) newMax); setProgress(newProgress); }
Sets the step size (granularity) of this rating bar. @param stepSize The step size of this rating bar. For example, if half-star granularity is wanted, this would be 0.5.
RatingBar::setStepSize
java
Reginer/aosp-android-jar
android-31/src/android/widget/RatingBar.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/widget/RatingBar.java
MIT
private float getProgressPerStar() { if (mNumStars > 0) { return 1f * getMax() / mNumStars; } else { return 1; } }
@return The amount of progress that fits into a star
RatingBar::getProgressPerStar
java
Reginer/aosp-android-jar
android-31/src/android/widget/RatingBar.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/widget/RatingBar.java
MIT
private void updateSecondaryProgress(int progress) { final float ratio = getProgressPerStar(); if (ratio > 0) { final float progressInStars = progress / ratio; final int secondaryProgress = (int) (Math.ceil(progressInStars) * ratio); setSecondaryProgress(secondaryProgress); } }
The secondary progress is used to differentiate the background of a partially filled star. This method keeps the secondary progress in sync with the progress. @param progress The primary progress level.
RatingBar::updateSecondaryProgress
java
Reginer/aosp-android-jar
android-31/src/android/widget/RatingBar.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/widget/RatingBar.java
MIT
public final InputDevice getDevice() { return InputDevice.getDevice(getDeviceId()); }
Gets the device that this event came from. @return The device, or null if unknown.
InputEvent::getDevice
java
Reginer/aosp-android-jar
android-34/src/android/view/InputEvent.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/view/InputEvent.java
MIT
public boolean isFromSource(int source) { return (getSource() & source) == source; }
Determines whether the event is from the given source. @param source The input source to check against. This can be a specific device type, such as {@link InputDevice#SOURCE_TOUCH_NAVIGATION}, or a more generic device class, such as {@link InputDevice#SOURCE_CLASS_POINTER}. @return Whether the event is from the given source.
InputEvent::isFromSource
java
Reginer/aosp-android-jar
android-34/src/android/view/InputEvent.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/view/InputEvent.java
MIT
public void recycle() { if (TRACK_RECYCLED_LOCATION) { if (mRecycledLocation != null) { throw new RuntimeException(toString() + " recycled twice!", mRecycledLocation); } mRecycledLocation = new RuntimeException("Last recycled here"); } else { if (mRecycled) { throw new RuntimeException(toString() + " recycled twice!"); } mRecycled = true; } }
Recycles the event. This method should only be used by the system since applications do not expect {@link KeyEvent} objects to be recycled, although {@link MotionEvent} objects are fine. See {@link KeyEvent#recycle()} for details. @hide
InputEvent::recycle
java
Reginer/aosp-android-jar
android-34/src/android/view/InputEvent.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/view/InputEvent.java
MIT
public void recycleIfNeededAfterDispatch() { recycle(); }
Conditionally recycled the event if it is appropriate to do so after dispatching the event to an application. If the event is a {@link MotionEvent} then it is recycled. If the event is a {@link KeyEvent} then it is NOT recycled, because applications expect key events to be immutable so once the event has been dispatched to the application we can no longer recycle it. @hide
InputEvent::recycleIfNeededAfterDispatch
java
Reginer/aosp-android-jar
android-34/src/android/view/InputEvent.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/view/InputEvent.java
MIT
protected void prepareForReuse() { mRecycled = false; mRecycledLocation = null; mSeq = mNextSeq.getAndIncrement(); }
Reinitializes the event on reuse (after recycling). @hide
InputEvent::prepareForReuse
java
Reginer/aosp-android-jar
android-34/src/android/view/InputEvent.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/view/InputEvent.java
MIT
public long getPhysicalDisplayId() { return mPhysicalDisplayId; }
Stable display ID combining port and model. @return An ID in the range [0, 2^64) interpreted as signed. @see SurfaceControl#getPhysicalDisplayIds
Physical::getPhysicalDisplayId
java
Reginer/aosp-android-jar
android-33/src/android/view/DisplayAddress.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/DisplayAddress.java
MIT
public int getPort() { return (int) (mPhysicalDisplayId & 0xFF); }
Physical port to which the display is connected. @return A port in the range [0, 255].
Physical::getPort
java
Reginer/aosp-android-jar
android-33/src/android/view/DisplayAddress.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/view/DisplayAddress.java
MIT
public Summary getPendingStats() { Summary s = pendingSummary; pendingSummary = null; if (s != null) { summary.merge(s); } return s; }
Get currently pending Summary statistics, if any, for this NetworkMetrics, merge them into the long running Summary statistics of this NetworkMetrics, and also clear them.
NetworkMetrics::getPendingStats
java
Reginer/aosp-android-jar
android-32/src/android/net/metrics/NetworkMetrics.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/android/net/metrics/NetworkMetrics.java
MIT
public void addDnsResult(int eventType, int returnCode, int latencyMs) { if (pendingSummary == null) { pendingSummary = new Summary(netId, transports); } boolean isSuccess = dnsMetrics.addResult((byte) eventType, (byte) returnCode, latencyMs); pendingSummary.dnsLatencies.count(latencyMs); pendingSummary.dnsErrorRate.count(isSuccess ? 0 : 1); }
Get currently pending Summary statistics, if any, for this NetworkMetrics, merge them into the long running Summary statistics of this NetworkMetrics, and also clear them. public Summary getPendingStats() { Summary s = pendingSummary; pendingSummary = null; if (s != null) { summary.merge(s); } return s; } /** Accumulate a dns query result reported by netd.
NetworkMetrics::addDnsResult
java
Reginer/aosp-android-jar
android-32/src/android/net/metrics/NetworkMetrics.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/android/net/metrics/NetworkMetrics.java
MIT
public void addConnectResult(int error, int latencyMs, String ipAddr) { if (pendingSummary == null) { pendingSummary = new Summary(netId, transports); } boolean isSuccess = connectMetrics.addEvent(error, latencyMs, ipAddr); pendingSummary.connectErrorRate.count(isSuccess ? 0 : 1); if (ConnectStats.isNonBlocking(error)) { pendingSummary.connectLatencies.count(latencyMs); } }
Get currently pending Summary statistics, if any, for this NetworkMetrics, merge them into the long running Summary statistics of this NetworkMetrics, and also clear them. public Summary getPendingStats() { Summary s = pendingSummary; pendingSummary = null; if (s != null) { summary.merge(s); } return s; } /** Accumulate a dns query result reported by netd. public void addDnsResult(int eventType, int returnCode, int latencyMs) { if (pendingSummary == null) { pendingSummary = new Summary(netId, transports); } boolean isSuccess = dnsMetrics.addResult((byte) eventType, (byte) returnCode, latencyMs); pendingSummary.dnsLatencies.count(latencyMs); pendingSummary.dnsErrorRate.count(isSuccess ? 0 : 1); } /** Accumulate a connect query result reported by netd.
NetworkMetrics::addConnectResult
java
Reginer/aosp-android-jar
android-32/src/android/net/metrics/NetworkMetrics.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/android/net/metrics/NetworkMetrics.java
MIT
public void addTcpStatsResult(int sent, int lost, int rttUs, int sentAckDiffMs) { if (pendingSummary == null) { pendingSummary = new Summary(netId, transports); } pendingSummary.tcpLossRate.count(lost, sent); pendingSummary.roundTripTimeUs.count(rttUs); pendingSummary.sentAckTimeDiffenceMs.count(sentAckDiffMs); }
Get currently pending Summary statistics, if any, for this NetworkMetrics, merge them into the long running Summary statistics of this NetworkMetrics, and also clear them. public Summary getPendingStats() { Summary s = pendingSummary; pendingSummary = null; if (s != null) { summary.merge(s); } return s; } /** Accumulate a dns query result reported by netd. public void addDnsResult(int eventType, int returnCode, int latencyMs) { if (pendingSummary == null) { pendingSummary = new Summary(netId, transports); } boolean isSuccess = dnsMetrics.addResult((byte) eventType, (byte) returnCode, latencyMs); pendingSummary.dnsLatencies.count(latencyMs); pendingSummary.dnsErrorRate.count(isSuccess ? 0 : 1); } /** Accumulate a connect query result reported by netd. public void addConnectResult(int error, int latencyMs, String ipAddr) { if (pendingSummary == null) { pendingSummary = new Summary(netId, transports); } boolean isSuccess = connectMetrics.addEvent(error, latencyMs, ipAddr); pendingSummary.connectErrorRate.count(isSuccess ? 0 : 1); if (ConnectStats.isNonBlocking(error)) { pendingSummary.connectLatencies.count(latencyMs); } } /** Accumulate a single netd sock_diag poll result reported by netd.
NetworkMetrics::addTcpStatsResult
java
Reginer/aosp-android-jar
android-32/src/android/net/metrics/NetworkMetrics.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/android/net/metrics/NetworkMetrics.java
MIT
private void resurrectSessionsLocked() { final int numSessions = mSessionInfos.size(); if (isDebug()) { Slog.d(TAG, "Resurrecting remote service (" + mRemoteService + ") on " + numSessions + " sessions."); } for (SearchSessionInfo sessionInfo : mSessionInfos.values()) { sessionInfo.resurrectSessionLocked(this, sessionInfo.mToken); } }
Called after the remote service connected, it's used to restore state from a 'zombie' service (i.e., after it died).
getSimpleName::resurrectSessionsLocked
java
Reginer/aosp-android-jar
android-31/src/com/android/server/searchui/SearchUiPerUserService.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/server/searchui/SearchUiPerUserService.java
MIT
public importNode09(final DOMTestDocumentBuilderFactory factory) throws org.w3c.domts.DOMTestIncompatibleException { super(factory); // // check if loaded documents are supported for content type // String contentType = getContentType(); preload(contentType, "staffNS", true); preload(contentType, "staffNS", true); }
Constructor. @param factory document factory, may not be null @throws org.w3c.domts.DOMTestIncompatibleException Thrown if test is not compatible with parser configuration
importNode09::importNode09
java
Reginer/aosp-android-jar
android-33/src/org/w3c/domts/level2/core/importNode09.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/org/w3c/domts/level2/core/importNode09.java
MIT
public void runTest() throws Throwable { Document doc; Document aNewDoc; DocumentType doc1Type; NamedNodeMap entityList; Entity entity2; Entity entity1; Document ownerDocument; DocumentType docType; String system; String entityName; String publicVal; String notationName; doc = (Document) load("staffNS", true); aNewDoc = (Document) load("staffNS", true); docType = aNewDoc.getDoctype(); entityList = docType.getEntities(); assertNotNull("entitiesNotNull", entityList); entity2 = (Entity) entityList.getNamedItem("ent6"); entity1 = (Entity) doc.importNode(entity2, false); ownerDocument = entity1.getOwnerDocument(); docType = ownerDocument.getDoctype(); system = docType.getSystemId(); assertURIEquals("dtdSystemId", null, null, null, "staffNS.dtd", null, null, null, null, system); entityName = entity1.getNodeName(); assertEquals("entityName", "ent6", entityName); publicVal = entity1.getPublicId(); assertEquals("entityPublicId", "uri", publicVal); system = entity1.getSystemId(); assertURIEquals("entitySystemId", null, null, null, "file", null, null, null, null, system); notationName = entity1.getNotationName(); assertEquals("notationName", "notation2", notationName); }
Runs the test case. @throws Throwable Any uncaught exception causes test to fail
importNode09::runTest
java
Reginer/aosp-android-jar
android-33/src/org/w3c/domts/level2/core/importNode09.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/org/w3c/domts/level2/core/importNode09.java
MIT
public String getTargetURI() { return "http://www.w3.org/2001/DOM-Test-Suite/level2/core/importNode09"; }
Gets URI that identifies the test. @return uri identifier of test
importNode09::getTargetURI
java
Reginer/aosp-android-jar
android-33/src/org/w3c/domts/level2/core/importNode09.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/org/w3c/domts/level2/core/importNode09.java
MIT
public static void main(final String[] args) { DOMTestCase.doMain(importNode09.class, args); }
Runs this test from the command line. @param args command line arguments
importNode09::main
java
Reginer/aosp-android-jar
android-33/src/org/w3c/domts/level2/core/importNode09.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/org/w3c/domts/level2/core/importNode09.java
MIT
public Byte2(Byte2 source) { this.x = source.x; this.y = source.y; }
Class for exposing the native RenderScript byte2 type back to the Android system. @deprecated Renderscript has been deprecated in API level 31. Please refer to the <a href="https://developer.android.com/guide/topics/renderscript/migration-guide">migration guide</a> for the proposed alternatives. @Deprecated public class Byte2 { public byte x; public byte y; public Byte2() { } public Byte2(byte initX, byte initY) { x = initX; y = initY; } /** @hide
Byte2::Byte2
java
Reginer/aosp-android-jar
android-31/src/android/renderscript/Byte2.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/renderscript/Byte2.java
MIT
public void add(Byte2 a) { this.x += a.x; this.y += a.y; }
@hide Vector add @param a
Byte2::add
java
Reginer/aosp-android-jar
android-31/src/android/renderscript/Byte2.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/renderscript/Byte2.java
MIT