code
stringlengths
11
173k
docstring
stringlengths
2
593k
func_name
stringlengths
2
189
language
stringclasses
1 value
repo
stringclasses
833 values
path
stringlengths
11
294
url
stringlengths
60
339
license
stringclasses
4 values
public void addEnums(int tag, int... values) { if (KeymasterDefs.getTagType(tag) != KeymasterDefs.KM_ENUM_REP) { throw new IllegalArgumentException("Not a repeating enum tag: " + tag); } for (int value : values) { addEnumTag(tag, value); } }
Adds a repeated enum tag with the provided values. @throws IllegalArgumentException if {@code tag} is not a repeating enum tag.
KeymasterArguments::addEnums
java
Reginer/aosp-android-jar
android-34/src/android/security/keymaster/KeymasterArguments.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/security/keymaster/KeymasterArguments.java
MIT
public int getEnum(int tag, int defaultValue) { if (KeymasterDefs.getTagType(tag) != KeymasterDefs.KM_ENUM) { throw new IllegalArgumentException("Not an enum tag: " + tag); } KeymasterArgument arg = getArgumentByTag(tag); if (arg == null) { return defaultValue; } return getEnumTagValue(arg); }
Returns the value of the specified enum tag or {@code defaultValue} if the tag is not present. @throws IllegalArgumentException if {@code tag} is not an enum tag.
KeymasterArguments::getEnum
java
Reginer/aosp-android-jar
android-34/src/android/security/keymaster/KeymasterArguments.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/security/keymaster/KeymasterArguments.java
MIT
public List<Integer> getEnums(int tag) { if (KeymasterDefs.getTagType(tag) != KeymasterDefs.KM_ENUM_REP) { throw new IllegalArgumentException("Not a repeating enum tag: " + tag); } List<Integer> values = new ArrayList<Integer>(); for (KeymasterArgument arg : mArguments) { if (arg.tag == tag) { values.add(getEnumTagValue(arg)); } } return values; }
Returns all values of the specified repeating enum tag. throws IllegalArgumentException if {@code tag} is not a repeating enum tag.
KeymasterArguments::getEnums
java
Reginer/aosp-android-jar
android-34/src/android/security/keymaster/KeymasterArguments.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/security/keymaster/KeymasterArguments.java
MIT
public long getUnsignedInt(int tag, long defaultValue) { if (KeymasterDefs.getTagType(tag) != KeymasterDefs.KM_UINT) { throw new IllegalArgumentException("Not an int tag: " + tag); } KeymasterArgument arg = getArgumentByTag(tag); if (arg == null) { return defaultValue; } // Keymaster's KM_UINT is unsigned 32 bit. return ((KeymasterIntArgument) arg).value & 0xffffffffL; }
Returns the value of the specified unsigned 32-bit int tag or {@code defaultValue} if the tag is not present. @throws IllegalArgumentException if {@code tag} is not an unsigned 32-bit int tag.
KeymasterArguments::getUnsignedInt
java
Reginer/aosp-android-jar
android-34/src/android/security/keymaster/KeymasterArguments.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/security/keymaster/KeymasterArguments.java
MIT
public List<BigInteger> getUnsignedLongs(int tag) { if (KeymasterDefs.getTagType(tag) != KeymasterDefs.KM_ULONG_REP) { throw new IllegalArgumentException("Tag is not a repeating long: " + tag); } List<BigInteger> values = new ArrayList<BigInteger>(); for (KeymasterArgument arg : mArguments) { if (arg.tag == tag) { values.add(getLongTagValue(arg)); } } return values; }
Returns all values of the specified repeating unsigned 64-bit long tag. @throws IllegalArgumentException if {@code tag} is not a repeating unsigned 64-bit long tag.
KeymasterArguments::getUnsignedLongs
java
Reginer/aosp-android-jar
android-34/src/android/security/keymaster/KeymasterArguments.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/security/keymaster/KeymasterArguments.java
MIT
public void addBoolean(int tag) { if (KeymasterDefs.getTagType(tag) != KeymasterDefs.KM_BOOL) { throw new IllegalArgumentException("Not a boolean tag: " + tag); } mArguments.add(new KeymasterBooleanArgument(tag)); }
Adds the provided boolean tag. Boolean tags are considered to be set to {@code true} if present and {@code false} if absent. @throws IllegalArgumentException if {@code tag} is not a boolean tag.
KeymasterArguments::addBoolean
java
Reginer/aosp-android-jar
android-34/src/android/security/keymaster/KeymasterArguments.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/security/keymaster/KeymasterArguments.java
MIT
public boolean getBoolean(int tag) { if (KeymasterDefs.getTagType(tag) != KeymasterDefs.KM_BOOL) { throw new IllegalArgumentException("Not a boolean tag: " + tag); } KeymasterArgument arg = getArgumentByTag(tag); if (arg == null) { return false; } return true; }
Returns {@code true} if the provided boolean tag is present, {@code false} if absent. @throws IllegalArgumentException if {@code tag} is not a boolean tag.
KeymasterArguments::getBoolean
java
Reginer/aosp-android-jar
android-34/src/android/security/keymaster/KeymasterArguments.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/security/keymaster/KeymasterArguments.java
MIT
public void addBytes(int tag, byte[] value) { if (KeymasterDefs.getTagType(tag) != KeymasterDefs.KM_BYTES) { throw new IllegalArgumentException("Not a bytes tag: " + tag); } if (value == null) { throw new NullPointerException("value == nulll"); } mArguments.add(new KeymasterBlobArgument(tag, value)); }
Adds a bytes tag with the provided value. @throws IllegalArgumentException if {@code tag} is not a bytes tag.
KeymasterArguments::addBytes
java
Reginer/aosp-android-jar
android-34/src/android/security/keymaster/KeymasterArguments.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/security/keymaster/KeymasterArguments.java
MIT
public byte[] getBytes(int tag, byte[] defaultValue) { if (KeymasterDefs.getTagType(tag) != KeymasterDefs.KM_BYTES) { throw new IllegalArgumentException("Not a bytes tag: " + tag); } KeymasterArgument arg = getArgumentByTag(tag); if (arg == null) { return defaultValue; } return ((KeymasterBlobArgument) arg).blob; }
Returns the value of the specified bytes tag or {@code defaultValue} if the tag is not present. @throws IllegalArgumentException if {@code tag} is not a bytes tag.
KeymasterArguments::getBytes
java
Reginer/aosp-android-jar
android-34/src/android/security/keymaster/KeymasterArguments.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/security/keymaster/KeymasterArguments.java
MIT
public void addDate(int tag, Date value) { if (KeymasterDefs.getTagType(tag) != KeymasterDefs.KM_DATE) { throw new IllegalArgumentException("Not a date tag: " + tag); } if (value == null) { throw new NullPointerException("value == nulll"); } // Keymaster's KM_DATE is unsigned, but java.util.Date is signed, thus preventing us from // using values larger than 2^63 - 1. if (value.getTime() < 0) { throw new IllegalArgumentException("Date tag value out of range: " + value); } mArguments.add(new KeymasterDateArgument(tag, value)); }
Adds a date tag with the provided value. @throws IllegalArgumentException if {@code tag} is not a date tag or if {@code value} is before the start of Unix epoch.
KeymasterArguments::addDate
java
Reginer/aosp-android-jar
android-34/src/android/security/keymaster/KeymasterArguments.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/security/keymaster/KeymasterArguments.java
MIT
public void addDateIfNotNull(int tag, Date value) { if (KeymasterDefs.getTagType(tag) != KeymasterDefs.KM_DATE) { throw new IllegalArgumentException("Not a date tag: " + tag); } if (value != null) { addDate(tag, value); } }
Adds a date tag with the provided value, if the value is not {@code null}. Does nothing if the {@code value} is null. @throws IllegalArgumentException if {@code tag} is not a date tag or if {@code value} is before the start of Unix epoch.
KeymasterArguments::addDateIfNotNull
java
Reginer/aosp-android-jar
android-34/src/android/security/keymaster/KeymasterArguments.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/security/keymaster/KeymasterArguments.java
MIT
public Date getDate(int tag, Date defaultValue) { if (KeymasterDefs.getTagType(tag) != KeymasterDefs.KM_DATE) { throw new IllegalArgumentException("Tag is not a date type: " + tag); } KeymasterArgument arg = getArgumentByTag(tag); if (arg == null) { return defaultValue; } Date result = ((KeymasterDateArgument) arg).date; // Keymaster's KM_DATE is unsigned, but java.util.Date is signed, thus preventing us from // using values larger than 2^63 - 1. if (result.getTime() < 0) { throw new IllegalArgumentException("Tag value too large. Tag: " + tag); } return result; }
Returns the value of the specified date tag or {@code defaultValue} if the tag is not present. @throws IllegalArgumentException if {@code tag} is not a date tag or if the tag's value represents a time instant which is after {@code 2^63 - 1} milliseconds since Unix epoch.
KeymasterArguments::getDate
java
Reginer/aosp-android-jar
android-34/src/android/security/keymaster/KeymasterArguments.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/security/keymaster/KeymasterArguments.java
MIT
public static BigInteger toUint64(long value) { if (value >= 0) { return BigInteger.valueOf(value); } else { return BigInteger.valueOf(value).add(UINT64_RANGE); } }
Converts the provided value to non-negative {@link BigInteger}, treating the sign bit of the provided value as the most significant bit of the result.
KeymasterArguments::toUint64
java
Reginer/aosp-android-jar
android-34/src/android/security/keymaster/KeymasterArguments.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/security/keymaster/KeymasterArguments.java
MIT
public int getTableId() { return mTableId; }
Gets table ID.
SectionSettingsWithTableInfo::getTableId
java
Reginer/aosp-android-jar
android-33/src/android/media/tv/tuner/filter/SectionSettingsWithTableInfo.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/media/tv/tuner/filter/SectionSettingsWithTableInfo.java
MIT
public int getVersion() { return mVersion; }
Gets version.
SectionSettingsWithTableInfo::getVersion
java
Reginer/aosp-android-jar
android-33/src/android/media/tv/tuner/filter/SectionSettingsWithTableInfo.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/media/tv/tuner/filter/SectionSettingsWithTableInfo.java
MIT
public NotificationRemoteInputManager( Context context, NotifPipelineFlags notifPipelineFlags, NotificationLockscreenUserManager lockscreenUserManager, SmartReplyController smartReplyController, NotificationVisibilityProvider visibilityProvider, NotificationEntryManager notificationEntryManager, RemoteInputNotificationRebuilder rebuilder, Lazy<Optional<CentralSurfaces>> centralSurfacesOptionalLazy, StatusBarStateController statusBarStateController, @Main Handler mainHandler, RemoteInputUriController remoteInputUriController, NotificationClickNotifier clickNotifier, ActionClickLogger logger, DumpManager dumpManager) { mContext = context; mNotifPipelineFlags = notifPipelineFlags; mLockscreenUserManager = lockscreenUserManager; mSmartReplyController = smartReplyController; mVisibilityProvider = visibilityProvider; mEntryManager = notificationEntryManager; mCentralSurfacesOptionalLazy = centralSurfacesOptionalLazy; mMainHandler = mainHandler; mLogger = logger; mBarService = IStatusBarService.Stub.asInterface( ServiceManager.getService(Context.STATUS_BAR_SERVICE)); mUserManager = (UserManager) mContext.getSystemService(Context.USER_SERVICE); mRebuilder = rebuilder; if (!mNotifPipelineFlags.isNewPipelineEnabled()) { mRemoteInputListener = createLegacyRemoteInputLifetimeExtender(mainHandler, notificationEntryManager, smartReplyController); } mKeyguardManager = context.getSystemService(KeyguardManager.class); mStatusBarStateController = statusBarStateController; mRemoteInputUriController = remoteInputUriController; mClickNotifier = clickNotifier; dumpManager.registerDumpable(this); notificationEntryManager.addNotificationEntryListener(new NotificationEntryListener() { @Override public void onPreEntryUpdated(NotificationEntry entry) { // Mark smart replies as sent whenever a notification is updated - otherwise the // smart replies are never marked as sent. mSmartReplyController.stopSending(entry); } @Override public void onEntryRemoved( @Nullable NotificationEntry entry, NotificationVisibility visibility, boolean removedByUser, int reason) { // We're removing the notification, the smart controller can forget about it. mSmartReplyController.stopSending(entry); if (removedByUser && entry != null) { onPerformRemoveNotification(entry, entry.getKey()); } } }); }
Injected constructor. See {@link CentralSurfacesDependenciesModule}.
NotificationRemoteInputManager::NotificationRemoteInputManager
java
Reginer/aosp-android-jar
android-33/src/com/android/systemui/statusbar/NotificationRemoteInputManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/systemui/statusbar/NotificationRemoteInputManager.java
MIT
public void setRemoteInputListener(@NonNull RemoteInputListener remoteInputListener) { if (mNotifPipelineFlags.isNewPipelineEnabled()) { if (mRemoteInputListener != null) { throw new IllegalStateException("mRemoteInputListener is already set"); } mRemoteInputListener = remoteInputListener; if (mRemoteInputController != null) { mRemoteInputListener.setRemoteInputController(mRemoteInputController); } } }
Injected constructor. See {@link CentralSurfacesDependenciesModule}. public NotificationRemoteInputManager( Context context, NotifPipelineFlags notifPipelineFlags, NotificationLockscreenUserManager lockscreenUserManager, SmartReplyController smartReplyController, NotificationVisibilityProvider visibilityProvider, NotificationEntryManager notificationEntryManager, RemoteInputNotificationRebuilder rebuilder, Lazy<Optional<CentralSurfaces>> centralSurfacesOptionalLazy, StatusBarStateController statusBarStateController, @Main Handler mainHandler, RemoteInputUriController remoteInputUriController, NotificationClickNotifier clickNotifier, ActionClickLogger logger, DumpManager dumpManager) { mContext = context; mNotifPipelineFlags = notifPipelineFlags; mLockscreenUserManager = lockscreenUserManager; mSmartReplyController = smartReplyController; mVisibilityProvider = visibilityProvider; mEntryManager = notificationEntryManager; mCentralSurfacesOptionalLazy = centralSurfacesOptionalLazy; mMainHandler = mainHandler; mLogger = logger; mBarService = IStatusBarService.Stub.asInterface( ServiceManager.getService(Context.STATUS_BAR_SERVICE)); mUserManager = (UserManager) mContext.getSystemService(Context.USER_SERVICE); mRebuilder = rebuilder; if (!mNotifPipelineFlags.isNewPipelineEnabled()) { mRemoteInputListener = createLegacyRemoteInputLifetimeExtender(mainHandler, notificationEntryManager, smartReplyController); } mKeyguardManager = context.getSystemService(KeyguardManager.class); mStatusBarStateController = statusBarStateController; mRemoteInputUriController = remoteInputUriController; mClickNotifier = clickNotifier; dumpManager.registerDumpable(this); notificationEntryManager.addNotificationEntryListener(new NotificationEntryListener() { @Override public void onPreEntryUpdated(NotificationEntry entry) { // Mark smart replies as sent whenever a notification is updated - otherwise the // smart replies are never marked as sent. mSmartReplyController.stopSending(entry); } @Override public void onEntryRemoved( @Nullable NotificationEntry entry, NotificationVisibility visibility, boolean removedByUser, int reason) { // We're removing the notification, the smart controller can forget about it. mSmartReplyController.stopSending(entry); if (removedByUser && entry != null) { onPerformRemoveNotification(entry, entry.getKey()); } } }); } /** Add a listener for various remote input events. Works with NEW pipeline only.
NotificationRemoteInputManager::setRemoteInputListener
java
Reginer/aosp-android-jar
android-33/src/com/android/systemui/statusbar/NotificationRemoteInputManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/systemui/statusbar/NotificationRemoteInputManager.java
MIT
public void setUpWithCallback(Callback callback, RemoteInputController.Delegate delegate) { mCallback = callback; mRemoteInputController = new RemoteInputController(delegate, mRemoteInputUriController); if (mRemoteInputListener != null) { mRemoteInputListener.setRemoteInputController(mRemoteInputController); } // Register all stored callbacks from before the Controller was initialized. for (RemoteInputController.Callback cb : mControllerCallbacks) { mRemoteInputController.addCallback(cb); } mControllerCallbacks.clear(); mRemoteInputController.addCallback(new RemoteInputController.Callback() { @Override public void onRemoteInputSent(NotificationEntry entry) { if (mRemoteInputListener != null) { mRemoteInputListener.onRemoteInputSent(entry); } try { mBarService.onNotificationDirectReplied(entry.getSbn().getKey()); if (entry.editedSuggestionInfo != null) { boolean modifiedBeforeSending = !TextUtils.equals(entry.remoteInputText, entry.editedSuggestionInfo.originalText); mBarService.onNotificationSmartReplySent( entry.getSbn().getKey(), entry.editedSuggestionInfo.index, entry.editedSuggestionInfo.originalText, NotificationLogger .getNotificationLocation(entry) .toMetricsEventEnum(), modifiedBeforeSending); } } catch (RemoteException e) { // Nothing to do, system going down } } }); if (!mNotifPipelineFlags.isNewPipelineEnabled()) { mSmartReplyController.setCallback((entry, reply) -> { StatusBarNotification newSbn = mRebuilder.rebuildForSendingSmartReply(entry, reply); mEntryManager.updateNotification(newSbn, null /* ranking */); }); } }
Injected constructor. See {@link CentralSurfacesDependenciesModule}. public NotificationRemoteInputManager( Context context, NotifPipelineFlags notifPipelineFlags, NotificationLockscreenUserManager lockscreenUserManager, SmartReplyController smartReplyController, NotificationVisibilityProvider visibilityProvider, NotificationEntryManager notificationEntryManager, RemoteInputNotificationRebuilder rebuilder, Lazy<Optional<CentralSurfaces>> centralSurfacesOptionalLazy, StatusBarStateController statusBarStateController, @Main Handler mainHandler, RemoteInputUriController remoteInputUriController, NotificationClickNotifier clickNotifier, ActionClickLogger logger, DumpManager dumpManager) { mContext = context; mNotifPipelineFlags = notifPipelineFlags; mLockscreenUserManager = lockscreenUserManager; mSmartReplyController = smartReplyController; mVisibilityProvider = visibilityProvider; mEntryManager = notificationEntryManager; mCentralSurfacesOptionalLazy = centralSurfacesOptionalLazy; mMainHandler = mainHandler; mLogger = logger; mBarService = IStatusBarService.Stub.asInterface( ServiceManager.getService(Context.STATUS_BAR_SERVICE)); mUserManager = (UserManager) mContext.getSystemService(Context.USER_SERVICE); mRebuilder = rebuilder; if (!mNotifPipelineFlags.isNewPipelineEnabled()) { mRemoteInputListener = createLegacyRemoteInputLifetimeExtender(mainHandler, notificationEntryManager, smartReplyController); } mKeyguardManager = context.getSystemService(KeyguardManager.class); mStatusBarStateController = statusBarStateController; mRemoteInputUriController = remoteInputUriController; mClickNotifier = clickNotifier; dumpManager.registerDumpable(this); notificationEntryManager.addNotificationEntryListener(new NotificationEntryListener() { @Override public void onPreEntryUpdated(NotificationEntry entry) { // Mark smart replies as sent whenever a notification is updated - otherwise the // smart replies are never marked as sent. mSmartReplyController.stopSending(entry); } @Override public void onEntryRemoved( @Nullable NotificationEntry entry, NotificationVisibility visibility, boolean removedByUser, int reason) { // We're removing the notification, the smart controller can forget about it. mSmartReplyController.stopSending(entry); if (removedByUser && entry != null) { onPerformRemoveNotification(entry, entry.getKey()); } } }); } /** Add a listener for various remote input events. Works with NEW pipeline only. public void setRemoteInputListener(@NonNull RemoteInputListener remoteInputListener) { if (mNotifPipelineFlags.isNewPipelineEnabled()) { if (mRemoteInputListener != null) { throw new IllegalStateException("mRemoteInputListener is already set"); } mRemoteInputListener = remoteInputListener; if (mRemoteInputController != null) { mRemoteInputListener.setRemoteInputController(mRemoteInputController); } } } @NonNull @VisibleForTesting protected LegacyRemoteInputLifetimeExtender createLegacyRemoteInputLifetimeExtender( Handler mainHandler, NotificationEntryManager notificationEntryManager, SmartReplyController smartReplyController) { return new LegacyRemoteInputLifetimeExtender(); } /** Initializes this component with the provided dependencies.
NotificationRemoteInputManager::setUpWithCallback
java
Reginer/aosp-android-jar
android-33/src/com/android/systemui/statusbar/NotificationRemoteInputManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/systemui/statusbar/NotificationRemoteInputManager.java
MIT
public boolean activateRemoteInput(View view, RemoteInput[] inputs, RemoteInput input, PendingIntent pendingIntent, @Nullable EditedSuggestionInfo editedSuggestionInfo) { return activateRemoteInput(view, inputs, input, pendingIntent, editedSuggestionInfo, null /* userMessageContent */, null /* authBypassCheck */); }
Activates a given {@link RemoteInput} @param view The view of the action button or suggestion chip that was tapped. @param inputs The remote inputs that need to be sent to the app. @param input The remote input that needs to be activated. @param pendingIntent The pending intent to be sent to the app. @param editedSuggestionInfo The smart reply that should be inserted in the remote input, or {@code null} if the user is not editing a smart reply. @return Whether the {@link RemoteInput} was activated.
NotificationRemoteInputManager::activateRemoteInput
java
Reginer/aosp-android-jar
android-33/src/com/android/systemui/statusbar/NotificationRemoteInputManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/systemui/statusbar/NotificationRemoteInputManager.java
MIT
public boolean activateRemoteInput(View view, RemoteInput[] inputs, RemoteInput input, PendingIntent pendingIntent, @Nullable EditedSuggestionInfo editedSuggestionInfo, @Nullable String userMessageContent, @Nullable AuthBypassPredicate authBypassCheck) { ViewParent p = view.getParent(); RemoteInputView riv = null; ExpandableNotificationRow row = null; while (p != null) { if (p instanceof View) { View pv = (View) p; if (pv.isRootNamespace()) { riv = findRemoteInputView(pv); row = (ExpandableNotificationRow) pv.getTag(R.id.row_tag_for_content_view); break; } } p = p.getParent(); } if (row == null) { return false; } row.setUserExpanded(true); final boolean deferBouncer = authBypassCheck != null; if (!deferBouncer && showBouncerForRemoteInput(view, pendingIntent, row)) { return true; } if (riv != null && !riv.isAttachedToWindow()) { // the remoteInput isn't attached to the window anymore :/ Let's focus on the expanded // one instead if it's available riv = null; } if (riv == null) { riv = findRemoteInputView(row.getPrivateLayout().getExpandedChild()); if (riv == null) { return false; } } if (riv == row.getPrivateLayout().getExpandedRemoteInput() && !row.getPrivateLayout().getExpandedChild().isShown()) { // The expanded layout is selected, but it's not shown yet, let's wait on it to // show before we do the animation. mCallback.onMakeExpandedVisibleForRemoteInput(row, view, deferBouncer, () -> { activateRemoteInput(view, inputs, input, pendingIntent, editedSuggestionInfo, userMessageContent, authBypassCheck); }); return true; } if (!riv.isAttachedToWindow()) { // if we still didn't find a view that is attached, let's abort. return false; } int width = view.getWidth(); if (view instanceof TextView) { // Center the reveal on the text which might be off-center from the TextView TextView tv = (TextView) view; if (tv.getLayout() != null) { int innerWidth = (int) tv.getLayout().getLineWidth(0); innerWidth += tv.getCompoundPaddingLeft() + tv.getCompoundPaddingRight(); width = Math.min(width, innerWidth); } } int cx = view.getLeft() + width / 2; int cy = view.getTop() + view.getHeight() / 2; int w = riv.getWidth(); int h = riv.getHeight(); int r = Math.max( Math.max(cx + cy, cx + (h - cy)), Math.max((w - cx) + cy, (w - cx) + (h - cy))); riv.getController().setRevealParams(new RemoteInputView.RevealParams(cx, cy, r)); riv.getController().setPendingIntent(pendingIntent); riv.getController().setRemoteInput(input); riv.getController().setRemoteInputs(inputs); riv.getController().setEditedSuggestionInfo(editedSuggestionInfo); riv.focusAnimated(); if (userMessageContent != null) { riv.setEditTextContent(userMessageContent); } if (deferBouncer) { final ExpandableNotificationRow finalRow = row; riv.getController().setBouncerChecker(() -> !authBypassCheck.canSendRemoteInputWithoutBouncer() && showBouncerForRemoteInput(view, pendingIntent, finalRow)); } return true; }
Activates a given {@link RemoteInput} @param view The view of the action button or suggestion chip that was tapped. @param inputs The remote inputs that need to be sent to the app. @param input The remote input that needs to be activated. @param pendingIntent The pending intent to be sent to the app. @param editedSuggestionInfo The smart reply that should be inserted in the remote input, or {@code null} if the user is not editing a smart reply. @param userMessageContent User-entered text with which to initialize the remote input view. @param authBypassCheck Optional auth bypass check associated with this remote input activation. If {@code null}, we never bypass. @return Whether the {@link RemoteInput} was activated.
NotificationRemoteInputManager::activateRemoteInput
java
Reginer/aosp-android-jar
android-33/src/com/android/systemui/statusbar/NotificationRemoteInputManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/systemui/statusbar/NotificationRemoteInputManager.java
MIT
public void cleanUpRemoteInputForUserRemoval(NotificationEntry entry) { if (isRemoteInputActive(entry)) { entry.mRemoteEditImeVisible = false; mRemoteInputController.removeRemoteInput(entry, null); } }
Disable remote input on the entry and remove the remote input view. This should be called when a user dismisses a notification that won't be lifetime extended.
NotificationRemoteInputManager::cleanUpRemoteInputForUserRemoval
java
Reginer/aosp-android-jar
android-33/src/com/android/systemui/statusbar/NotificationRemoteInputManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/systemui/statusbar/NotificationRemoteInputManager.java
MIT
public void onPanelCollapsed() { if (mRemoteInputListener != null) { mRemoteInputListener.onPanelCollapsed(); } }
Disable remote input on the entry and remove the remote input view. This should be called when a user dismisses a notification that won't be lifetime extended. public void cleanUpRemoteInputForUserRemoval(NotificationEntry entry) { if (isRemoteInputActive(entry)) { entry.mRemoteEditImeVisible = false; mRemoteInputController.removeRemoteInput(entry, null); } } /** Informs the remote input system that the panel has collapsed
NotificationRemoteInputManager::onPanelCollapsed
java
Reginer/aosp-android-jar
android-33/src/com/android/systemui/statusbar/NotificationRemoteInputManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/systemui/statusbar/NotificationRemoteInputManager.java
MIT
public boolean isNotificationKeptForRemoteInputHistory(String key) { return mRemoteInputListener != null && mRemoteInputListener.isNotificationKeptForRemoteInputHistory(key); }
Disable remote input on the entry and remove the remote input view. This should be called when a user dismisses a notification that won't be lifetime extended. public void cleanUpRemoteInputForUserRemoval(NotificationEntry entry) { if (isRemoteInputActive(entry)) { entry.mRemoteEditImeVisible = false; mRemoteInputController.removeRemoteInput(entry, null); } } /** Informs the remote input system that the panel has collapsed public void onPanelCollapsed() { if (mRemoteInputListener != null) { mRemoteInputListener.onPanelCollapsed(); } } /** Returns whether the given notification is lifetime extended because of remote input
NotificationRemoteInputManager::isNotificationKeptForRemoteInputHistory
java
Reginer/aosp-android-jar
android-33/src/com/android/systemui/statusbar/NotificationRemoteInputManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/systemui/statusbar/NotificationRemoteInputManager.java
MIT
public boolean shouldKeepForRemoteInputHistory(NotificationEntry entry) { if (!FORCE_REMOTE_INPUT_HISTORY) { return false; } return isSpinning(entry.getKey()) || entry.hasJustSentRemoteInput(); }
Disable remote input on the entry and remove the remote input view. This should be called when a user dismisses a notification that won't be lifetime extended. public void cleanUpRemoteInputForUserRemoval(NotificationEntry entry) { if (isRemoteInputActive(entry)) { entry.mRemoteEditImeVisible = false; mRemoteInputController.removeRemoteInput(entry, null); } } /** Informs the remote input system that the panel has collapsed public void onPanelCollapsed() { if (mRemoteInputListener != null) { mRemoteInputListener.onPanelCollapsed(); } } /** Returns whether the given notification is lifetime extended because of remote input public boolean isNotificationKeptForRemoteInputHistory(String key) { return mRemoteInputListener != null && mRemoteInputListener.isNotificationKeptForRemoteInputHistory(key); } /** Returns whether the notification should be lifetime extended for remote input history
NotificationRemoteInputManager::shouldKeepForRemoteInputHistory
java
Reginer/aosp-android-jar
android-33/src/com/android/systemui/statusbar/NotificationRemoteInputManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/systemui/statusbar/NotificationRemoteInputManager.java
MIT
private void releaseNotificationIfKeptForRemoteInputHistory(NotificationEntry entry) { if (entry == null) { return; } if (mRemoteInputListener != null) { mRemoteInputListener.releaseNotificationIfKeptForRemoteInputHistory(entry); } }
Checks if the notification is being kept due to the user sending an inline reply, and if so, releases that hold. This is called anytime an action on the notification is dispatched (after unlock, if applicable), and will then wait a short time to allow the app to update the notification in response to the action.
NotificationRemoteInputManager::releaseNotificationIfKeptForRemoteInputHistory
java
Reginer/aosp-android-jar
android-33/src/com/android/systemui/statusbar/NotificationRemoteInputManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/systemui/statusbar/NotificationRemoteInputManager.java
MIT
public boolean shouldKeepForSmartReplyHistory(NotificationEntry entry) { if (!FORCE_REMOTE_INPUT_HISTORY) { return false; } return mSmartReplyController.isSendingSmartReply(entry.getKey()); }
Checks if the notification is being kept due to the user sending an inline reply, and if so, releases that hold. This is called anytime an action on the notification is dispatched (after unlock, if applicable), and will then wait a short time to allow the app to update the notification in response to the action. private void releaseNotificationIfKeptForRemoteInputHistory(NotificationEntry entry) { if (entry == null) { return; } if (mRemoteInputListener != null) { mRemoteInputListener.releaseNotificationIfKeptForRemoteInputHistory(entry); } } /** Returns whether the notification should be lifetime extended for smart reply history
NotificationRemoteInputManager::shouldKeepForSmartReplyHistory
java
Reginer/aosp-android-jar
android-33/src/com/android/systemui/statusbar/NotificationRemoteInputManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/systemui/statusbar/NotificationRemoteInputManager.java
MIT
public RemoteViews.InteractionHandler getRemoteViewsOnClickHandler() { return mInteractionHandler; }
Return on-click handler for notification remote views @return on-click handler
NotificationRemoteInputManager::getRemoteViewsOnClickHandler
java
Reginer/aosp-android-jar
android-33/src/com/android/systemui/statusbar/NotificationRemoteInputManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/systemui/statusbar/NotificationRemoteInputManager.java
MIT
protected void addLifetimeExtenders() { mLifetimeExtenders.add(new RemoteInputHistoryExtender()); mLifetimeExtenders.add(new SmartReplyHistoryExtender()); mLifetimeExtenders.add(new RemoteInputActiveExtender()); }
Adds all the notification lifetime extenders. Each extender represents a reason for the NotificationRemoteInputManager to keep a notification lifetime extended.
LegacyRemoteInputLifetimeExtender::addLifetimeExtenders
java
Reginer/aosp-android-jar
android-33/src/com/android/systemui/statusbar/NotificationRemoteInputManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/com/android/systemui/statusbar/NotificationRemoteInputManager.java
MIT
public NanoAppRpcService(long serviceId, int serviceVersion) { mServiceId = serviceId; mServiceVersion = serviceVersion; }
@param serviceId The unique ID of this service, see {#getId()}. @param serviceVersion The software version of this service, see {#getVersion()}.
NanoAppRpcService::NanoAppRpcService
java
Reginer/aosp-android-jar
android-34/src/android/hardware/location/NanoAppRpcService.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/hardware/location/NanoAppRpcService.java
MIT
public long getId() { return mServiceId; }
The unique 64-bit ID of an RPC service published by a nanoapp. Note that the uniqueness is only required within the nanoapp's domain (i.e. the combination of the nanoapp ID and service id must be unique). This ID must remain the same for the given nanoapp RPC service once published on Android (i.e. must never change). @return The service ID.
NanoAppRpcService::getId
java
Reginer/aosp-android-jar
android-34/src/android/hardware/location/NanoAppRpcService.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/hardware/location/NanoAppRpcService.java
MIT
public int getVersion() { return mServiceVersion; }
The software version of this service, which follows the sematic versioning scheme (see semver.org). It follows the format major.minor.patch, where major and minor versions take up one byte each, and the patch version takes up the final 2 (lower) bytes. I.e. the version is encoded as 0xMMmmpppp, where MM, mm, pppp are the major, minor, patch versions, respectively. @return The service version.
NanoAppRpcService::getVersion
java
Reginer/aosp-android-jar
android-34/src/android/hardware/location/NanoAppRpcService.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/hardware/location/NanoAppRpcService.java
MIT
private int getMajorVersion() { return (mServiceVersion & 0xFF000000) >>> 24; }
@return The service's major version.
NanoAppRpcService::getMajorVersion
java
Reginer/aosp-android-jar
android-34/src/android/hardware/location/NanoAppRpcService.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/hardware/location/NanoAppRpcService.java
MIT
private int getMinorVersion() { return (mServiceVersion & 0x00FF0000) >>> 16; }
@return The service's minor version.
NanoAppRpcService::getMinorVersion
java
Reginer/aosp-android-jar
android-34/src/android/hardware/location/NanoAppRpcService.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/hardware/location/NanoAppRpcService.java
MIT
private int getPatchVersion() { return mServiceVersion & 0x0000FFFF; }
@return The service's patch version.
NanoAppRpcService::getPatchVersion
java
Reginer/aosp-android-jar
android-34/src/android/hardware/location/NanoAppRpcService.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/android/hardware/location/NanoAppRpcService.java
MIT
public GenerateRkpKeyException() { }
Constructs a new {@code GenerateRkpKeyException}.
GenerateRkpKeyException::GenerateRkpKeyException
java
Reginer/aosp-android-jar
android-31/src/android/security/GenerateRkpKeyException.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/security/GenerateRkpKeyException.java
MIT
void scheduleTransactionItemNow(@NonNull IApplicationThread client, @NonNull ClientTransactionItem transactionItem) throws RemoteException { final ClientTransaction clientTransaction = ClientTransaction.obtain(client); clientTransaction.addTransactionItem(transactionItem); scheduleTransaction(clientTransaction); }
Similar to {@link #scheduleTransactionItem}, but it sends the transaction immediately and it can be called without WM lock. @see WindowProcessController#setReportedProcState(int)
ClientLifecycleManager::scheduleTransactionItemNow
java
Reginer/aosp-android-jar
android-35/src/com/android/server/wm/ClientLifecycleManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/com/android/server/wm/ClientLifecycleManager.java
MIT
void scheduleTransactionItem(@NonNull IApplicationThread client, @NonNull ClientTransactionItem transactionItem) throws RemoteException { // The behavior is different depending on the flag. // When flag is on, we wait until RootWindowContainer#performSurfacePlacementNoTrace to // dispatch all pending transactions at once. if (Flags.bundleClientTransactionFlag()) { final ClientTransaction clientTransaction = getOrCreatePendingTransaction(client); clientTransaction.addTransactionItem(transactionItem); onClientTransactionItemScheduled(clientTransaction, false /* shouldDispatchImmediately */); } else { // TODO(b/260873529): cleanup after launch. final ClientTransaction clientTransaction = ClientTransaction.obtain(client); clientTransaction.addTransactionItem(transactionItem); scheduleTransaction(clientTransaction); } }
Schedules a single transaction item, either a callback or a lifecycle request, delivery to client application. @throws RemoteException @see ClientTransactionItem
ClientLifecycleManager::scheduleTransactionItem
java
Reginer/aosp-android-jar
android-35/src/com/android/server/wm/ClientLifecycleManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/com/android/server/wm/ClientLifecycleManager.java
MIT
void scheduleTransactionAndLifecycleItems(@NonNull IApplicationThread client, @NonNull ClientTransactionItem transactionItem, @NonNull ActivityLifecycleItem lifecycleItem, boolean shouldDispatchImmediately) throws RemoteException { // The behavior is different depending on the flag. // When flag is on, we wait until RootWindowContainer#performSurfacePlacementNoTrace to // dispatch all pending transactions at once. if (Flags.bundleClientTransactionFlag()) { final ClientTransaction clientTransaction = getOrCreatePendingTransaction(client); clientTransaction.addTransactionItem(transactionItem); clientTransaction.addTransactionItem(lifecycleItem); onClientTransactionItemScheduled(clientTransaction, shouldDispatchImmediately); } else { // TODO(b/260873529): cleanup after launch. final ClientTransaction clientTransaction = ClientTransaction.obtain(client); clientTransaction.addTransactionItem(transactionItem); clientTransaction.addTransactionItem(lifecycleItem); scheduleTransaction(clientTransaction); } }
Schedules a single transaction item with a lifecycle request, delivery to client application. @param shouldDispatchImmediately whether or not to dispatch the transaction immediately. This should only be {@code true} when it is important to know the result of dispatching immediately. For example, when cold launches an app, the server needs to know if the transaction is dispatched successfully, and may restart the process if not. @throws RemoteException @see ClientTransactionItem
ClientLifecycleManager::scheduleTransactionAndLifecycleItems
java
Reginer/aosp-android-jar
android-35/src/com/android/server/wm/ClientLifecycleManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/com/android/server/wm/ClientLifecycleManager.java
MIT
void dispatchPendingTransactions() { if (!Flags.bundleClientTransactionFlag() || mPendingTransactions.isEmpty()) { return; } Trace.traceBegin(Trace.TRACE_TAG_WINDOW_MANAGER, "clientTransactionsDispatched"); final int size = mPendingTransactions.size(); for (int i = 0; i < size; i++) { final ClientTransaction transaction = mPendingTransactions.valueAt(i); try { scheduleTransaction(transaction); } catch (RemoteException e) { Slog.e(TAG, "Failed to deliver pending transaction", e); // TODO(b/323801078): apply cleanup for individual transaction item if needed. } } mPendingTransactions.clear(); Trace.traceEnd(Trace.TRACE_TAG_WINDOW_MANAGER); }
Schedules a single transaction item with a lifecycle request, delivery to client application. @param shouldDispatchImmediately whether or not to dispatch the transaction immediately. This should only be {@code true} when it is important to know the result of dispatching immediately. For example, when cold launches an app, the server needs to know if the transaction is dispatched successfully, and may restart the process if not. @throws RemoteException @see ClientTransactionItem void scheduleTransactionAndLifecycleItems(@NonNull IApplicationThread client, @NonNull ClientTransactionItem transactionItem, @NonNull ActivityLifecycleItem lifecycleItem, boolean shouldDispatchImmediately) throws RemoteException { // The behavior is different depending on the flag. // When flag is on, we wait until RootWindowContainer#performSurfacePlacementNoTrace to // dispatch all pending transactions at once. if (Flags.bundleClientTransactionFlag()) { final ClientTransaction clientTransaction = getOrCreatePendingTransaction(client); clientTransaction.addTransactionItem(transactionItem); clientTransaction.addTransactionItem(lifecycleItem); onClientTransactionItemScheduled(clientTransaction, shouldDispatchImmediately); } else { // TODO(b/260873529): cleanup after launch. final ClientTransaction clientTransaction = ClientTransaction.obtain(client); clientTransaction.addTransactionItem(transactionItem); clientTransaction.addTransactionItem(lifecycleItem); scheduleTransaction(clientTransaction); } } /** Executes all the pending transactions.
ClientLifecycleManager::dispatchPendingTransactions
java
Reginer/aosp-android-jar
android-35/src/com/android/server/wm/ClientLifecycleManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/com/android/server/wm/ClientLifecycleManager.java
MIT
void dispatchPendingTransaction(@NonNull IApplicationThread client) { if (!Flags.bundleClientTransactionFlag()) { return; } final ClientTransaction pendingTransaction = mPendingTransactions.remove(client.asBinder()); if (pendingTransaction != null) { try { scheduleTransaction(pendingTransaction); } catch (RemoteException e) { Slog.e(TAG, "Failed to deliver pending transaction", e); // TODO(b/323801078): apply cleanup for individual transaction item if needed. } } }
Schedules a single transaction item with a lifecycle request, delivery to client application. @param shouldDispatchImmediately whether or not to dispatch the transaction immediately. This should only be {@code true} when it is important to know the result of dispatching immediately. For example, when cold launches an app, the server needs to know if the transaction is dispatched successfully, and may restart the process if not. @throws RemoteException @see ClientTransactionItem void scheduleTransactionAndLifecycleItems(@NonNull IApplicationThread client, @NonNull ClientTransactionItem transactionItem, @NonNull ActivityLifecycleItem lifecycleItem, boolean shouldDispatchImmediately) throws RemoteException { // The behavior is different depending on the flag. // When flag is on, we wait until RootWindowContainer#performSurfacePlacementNoTrace to // dispatch all pending transactions at once. if (Flags.bundleClientTransactionFlag()) { final ClientTransaction clientTransaction = getOrCreatePendingTransaction(client); clientTransaction.addTransactionItem(transactionItem); clientTransaction.addTransactionItem(lifecycleItem); onClientTransactionItemScheduled(clientTransaction, shouldDispatchImmediately); } else { // TODO(b/260873529): cleanup after launch. final ClientTransaction clientTransaction = ClientTransaction.obtain(client); clientTransaction.addTransactionItem(transactionItem); clientTransaction.addTransactionItem(lifecycleItem); scheduleTransaction(clientTransaction); } } /** Executes all the pending transactions. void dispatchPendingTransactions() { if (!Flags.bundleClientTransactionFlag() || mPendingTransactions.isEmpty()) { return; } Trace.traceBegin(Trace.TRACE_TAG_WINDOW_MANAGER, "clientTransactionsDispatched"); final int size = mPendingTransactions.size(); for (int i = 0; i < size; i++) { final ClientTransaction transaction = mPendingTransactions.valueAt(i); try { scheduleTransaction(transaction); } catch (RemoteException e) { Slog.e(TAG, "Failed to deliver pending transaction", e); // TODO(b/323801078): apply cleanup for individual transaction item if needed. } } mPendingTransactions.clear(); Trace.traceEnd(Trace.TRACE_TAG_WINDOW_MANAGER); } /** Executes the pending transaction for the given client process.
ClientLifecycleManager::dispatchPendingTransaction
java
Reginer/aosp-android-jar
android-35/src/com/android/server/wm/ClientLifecycleManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/com/android/server/wm/ClientLifecycleManager.java
MIT
void onLayoutContinued() { if (shouldDispatchPendingTransactionsImmediately()) { // Dispatch the pending transactions immediately if there is no ongoing/scheduled layout dispatchPendingTransactions(); } }
Called to when {@link WindowSurfacePlacer#continueLayout}. Dispatches all pending transactions unless there is an ongoing/scheduled layout, in which case the pending transactions will be dispatched in {@link RootWindowContainer#performSurfacePlacementNoTrace}.
ClientLifecycleManager::onLayoutContinued
java
Reginer/aosp-android-jar
android-35/src/com/android/server/wm/ClientLifecycleManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/com/android/server/wm/ClientLifecycleManager.java
MIT
private void onClientTransactionItemScheduled( @NonNull ClientTransaction clientTransaction, boolean shouldDispatchImmediately) throws RemoteException { if (shouldDispatchImmediately || shouldDispatchPendingTransactionsImmediately()) { // Dispatch the pending transaction immediately. mPendingTransactions.remove(clientTransaction.getClient().asBinder()); scheduleTransaction(clientTransaction); } }
Called to when {@link WindowSurfacePlacer#continueLayout}. Dispatches all pending transactions unless there is an ongoing/scheduled layout, in which case the pending transactions will be dispatched in {@link RootWindowContainer#performSurfacePlacementNoTrace}. void onLayoutContinued() { if (shouldDispatchPendingTransactionsImmediately()) { // Dispatch the pending transactions immediately if there is no ongoing/scheduled layout dispatchPendingTransactions(); } } /** Must only be called with WM lock. @NonNull private ClientTransaction getOrCreatePendingTransaction(@NonNull IApplicationThread client) { final IBinder clientBinder = client.asBinder(); final ClientTransaction pendingTransaction = mPendingTransactions.get(clientBinder); if (pendingTransaction != null) { return pendingTransaction; } // Create new transaction if there is no existing. final ClientTransaction transaction = ClientTransaction.obtain(client); mPendingTransactions.put(clientBinder, transaction); return transaction; } /** Must only be called with WM lock.
ClientLifecycleManager::onClientTransactionItemScheduled
java
Reginer/aosp-android-jar
android-35/src/com/android/server/wm/ClientLifecycleManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/com/android/server/wm/ClientLifecycleManager.java
MIT
private boolean shouldDispatchPendingTransactionsImmediately() { if (mWms == null) { return true; } // Do not dispatch when // 1. Layout deferred. // 2. Layout requested. // 3. Layout in process. // The pending transactions will be dispatched during layout in // RootWindowContainer#performSurfacePlacementNoTrace. return !mWms.mWindowPlacerLocked.isLayoutDeferred() && !mWms.mWindowPlacerLocked.isTraversalScheduled() && !mWms.mWindowPlacerLocked.isInLayout(); }
Called to when {@link WindowSurfacePlacer#continueLayout}. Dispatches all pending transactions unless there is an ongoing/scheduled layout, in which case the pending transactions will be dispatched in {@link RootWindowContainer#performSurfacePlacementNoTrace}. void onLayoutContinued() { if (shouldDispatchPendingTransactionsImmediately()) { // Dispatch the pending transactions immediately if there is no ongoing/scheduled layout dispatchPendingTransactions(); } } /** Must only be called with WM lock. @NonNull private ClientTransaction getOrCreatePendingTransaction(@NonNull IApplicationThread client) { final IBinder clientBinder = client.asBinder(); final ClientTransaction pendingTransaction = mPendingTransactions.get(clientBinder); if (pendingTransaction != null) { return pendingTransaction; } // Create new transaction if there is no existing. final ClientTransaction transaction = ClientTransaction.obtain(client); mPendingTransactions.put(clientBinder, transaction); return transaction; } /** Must only be called with WM lock. private void onClientTransactionItemScheduled( @NonNull ClientTransaction clientTransaction, boolean shouldDispatchImmediately) throws RemoteException { if (shouldDispatchImmediately || shouldDispatchPendingTransactionsImmediately()) { // Dispatch the pending transaction immediately. mPendingTransactions.remove(clientTransaction.getClient().asBinder()); scheduleTransaction(clientTransaction); } } /** Must only be called with WM lock.
ClientLifecycleManager::shouldDispatchPendingTransactionsImmediately
java
Reginer/aosp-android-jar
android-35/src/com/android/server/wm/ClientLifecycleManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/com/android/server/wm/ClientLifecycleManager.java
MIT
static boolean shouldDispatchLaunchActivityItemIndependently( @NonNull String appPackageName, int appUid) { return !CompatChanges.isChangeEnabled(ENABLE_BUNDLE_LAUNCH_ACTIVITY_ITEM, appPackageName, UserHandle.getUserHandleForUid(appUid)); }
Called to when {@link WindowSurfacePlacer#continueLayout}. Dispatches all pending transactions unless there is an ongoing/scheduled layout, in which case the pending transactions will be dispatched in {@link RootWindowContainer#performSurfacePlacementNoTrace}. void onLayoutContinued() { if (shouldDispatchPendingTransactionsImmediately()) { // Dispatch the pending transactions immediately if there is no ongoing/scheduled layout dispatchPendingTransactions(); } } /** Must only be called with WM lock. @NonNull private ClientTransaction getOrCreatePendingTransaction(@NonNull IApplicationThread client) { final IBinder clientBinder = client.asBinder(); final ClientTransaction pendingTransaction = mPendingTransactions.get(clientBinder); if (pendingTransaction != null) { return pendingTransaction; } // Create new transaction if there is no existing. final ClientTransaction transaction = ClientTransaction.obtain(client); mPendingTransactions.put(clientBinder, transaction); return transaction; } /** Must only be called with WM lock. private void onClientTransactionItemScheduled( @NonNull ClientTransaction clientTransaction, boolean shouldDispatchImmediately) throws RemoteException { if (shouldDispatchImmediately || shouldDispatchPendingTransactionsImmediately()) { // Dispatch the pending transaction immediately. mPendingTransactions.remove(clientTransaction.getClient().asBinder()); scheduleTransaction(clientTransaction); } } /** Must only be called with WM lock. private boolean shouldDispatchPendingTransactionsImmediately() { if (mWms == null) { return true; } // Do not dispatch when // 1. Layout deferred. // 2. Layout requested. // 3. Layout in process. // The pending transactions will be dispatched during layout in // RootWindowContainer#performSurfacePlacementNoTrace. return !mWms.mWindowPlacerLocked.isLayoutDeferred() && !mWms.mWindowPlacerLocked.isTraversalScheduled() && !mWms.mWindowPlacerLocked.isInLayout(); } /** Guards bundling {@link LaunchActivityItem} with targetSDK.
ClientLifecycleManager::shouldDispatchLaunchActivityItemIndependently
java
Reginer/aosp-android-jar
android-35/src/com/android/server/wm/ClientLifecycleManager.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/com/android/server/wm/ClientLifecycleManager.java
MIT
public AssertionError() { }
Constructs an AssertionError with no detail message.
AssertionError::AssertionError
java
Reginer/aosp-android-jar
android-32/src/java/lang/AssertionError.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/java/lang/AssertionError.java
MIT
private AssertionError(String detailMessage) { super(detailMessage); }
This internal constructor does no processing on its string argument, even if it is a null reference. The public constructors will never call this constructor with a null argument.
AssertionError::AssertionError
java
Reginer/aosp-android-jar
android-32/src/java/lang/AssertionError.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/java/lang/AssertionError.java
MIT
public AssertionError(Object detailMessage) { this(String.valueOf(detailMessage)); if (detailMessage instanceof Throwable) initCause((Throwable) detailMessage); }
Constructs an AssertionError with its detail message derived from the specified object, which is converted to a string as defined in section 15.18.1.1 of <cite>The Java&trade; Language Specification</cite>. <p> If the specified object is an instance of {@code Throwable}, it becomes the <i>cause</i> of the newly constructed assertion error. @param detailMessage value to be used in constructing detail message @see Throwable#getCause()
AssertionError::AssertionError
java
Reginer/aosp-android-jar
android-32/src/java/lang/AssertionError.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/java/lang/AssertionError.java
MIT
public AssertionError(boolean detailMessage) { this(String.valueOf(detailMessage)); }
Constructs an AssertionError with its detail message derived from the specified <code>boolean</code>, which is converted to a string as defined in section 15.18.1.1 of <cite>The Java&trade; Language Specification</cite>. @param detailMessage value to be used in constructing detail message
AssertionError::AssertionError
java
Reginer/aosp-android-jar
android-32/src/java/lang/AssertionError.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/java/lang/AssertionError.java
MIT
public AssertionError(char detailMessage) { this(String.valueOf(detailMessage)); }
Constructs an AssertionError with its detail message derived from the specified <code>char</code>, which is converted to a string as defined in section 15.18.1.1 of <cite>The Java&trade; Language Specification</cite>. @param detailMessage value to be used in constructing detail message
AssertionError::AssertionError
java
Reginer/aosp-android-jar
android-32/src/java/lang/AssertionError.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/java/lang/AssertionError.java
MIT
public AssertionError(int detailMessage) { this(String.valueOf(detailMessage)); }
Constructs an AssertionError with its detail message derived from the specified <code>int</code>, which is converted to a string as defined in section 15.18.1.1 of <cite>The Java&trade; Language Specification</cite>. @param detailMessage value to be used in constructing detail message
AssertionError::AssertionError
java
Reginer/aosp-android-jar
android-32/src/java/lang/AssertionError.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/java/lang/AssertionError.java
MIT
public AssertionError(long detailMessage) { this(String.valueOf(detailMessage)); }
Constructs an AssertionError with its detail message derived from the specified <code>long</code>, which is converted to a string as defined in section 15.18.1.1 of <cite>The Java&trade; Language Specification</cite>. @param detailMessage value to be used in constructing detail message
AssertionError::AssertionError
java
Reginer/aosp-android-jar
android-32/src/java/lang/AssertionError.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/java/lang/AssertionError.java
MIT
public AssertionError(float detailMessage) { this(String.valueOf(detailMessage)); }
Constructs an AssertionError with its detail message derived from the specified <code>float</code>, which is converted to a string as defined in section 15.18.1.1 of <cite>The Java&trade; Language Specification</cite>. @param detailMessage value to be used in constructing detail message
AssertionError::AssertionError
java
Reginer/aosp-android-jar
android-32/src/java/lang/AssertionError.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/java/lang/AssertionError.java
MIT
public AssertionError(double detailMessage) { this(String.valueOf(detailMessage)); }
Constructs an AssertionError with its detail message derived from the specified <code>double</code>, which is converted to a string as defined in section 15.18.1.1 of <cite>The Java&trade; Language Specification</cite>. @param detailMessage value to be used in constructing detail message
AssertionError::AssertionError
java
Reginer/aosp-android-jar
android-32/src/java/lang/AssertionError.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/java/lang/AssertionError.java
MIT
public AssertionError(String message, Throwable cause) { super(message, cause); }
Constructs a new {@code AssertionError} with the specified detail message and cause. <p>Note that the detail message associated with {@code cause} is <i>not</i> automatically incorporated in this error's detail message. @param message the detail message, may be {@code null} @param cause the cause, may be {@code null} @since 1.7
AssertionError::AssertionError
java
Reginer/aosp-android-jar
android-32/src/java/lang/AssertionError.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/java/lang/AssertionError.java
MIT
public PointFEvaluator() { }
Construct a PointFEvaluator that returns a new PointF on every evaluate call. To avoid creating an object for each evaluate call, {@link PointFEvaluator#PointFEvaluator(android.graphics.PointF)} should be used whenever possible.
PointFEvaluator::PointFEvaluator
java
Reginer/aosp-android-jar
android-31/src/android/animation/PointFEvaluator.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/animation/PointFEvaluator.java
MIT
public PointFEvaluator(PointF reuse) { mPoint = reuse; }
Constructs a PointFEvaluator that modifies and returns <code>reuse</code> in {@link #evaluate(float, android.graphics.PointF, android.graphics.PointF)} calls. The value returned from {@link #evaluate(float, android.graphics.PointF, android.graphics.PointF)} should not be cached because it will change over time as the object is reused on each call. @param reuse A PointF to be modified and returned by evaluate.
PointFEvaluator::PointFEvaluator
java
Reginer/aosp-android-jar
android-31/src/android/animation/PointFEvaluator.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/animation/PointFEvaluator.java
MIT
BiometricContextSessionInfo(@NonNull InstanceId id) { mId = id; }
/* Copyright (C) 2022 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. package com.android.server.biometrics.log; import android.annotation.NonNull; import com.android.internal.logging.InstanceId; import java.util.concurrent.atomic.AtomicInteger; /** State for an authentication session {@see com.android.internal.statusbar.ISessionListener}. class BiometricContextSessionInfo { private final InstanceId mId; private final AtomicInteger mOrder = new AtomicInteger(0); /** Wrap a session id with the initial state.
BiometricContextSessionInfo::BiometricContextSessionInfo
java
Reginer/aosp-android-jar
android-34/src/com/android/server/biometrics/log/BiometricContextSessionInfo.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/com/android/server/biometrics/log/BiometricContextSessionInfo.java
MIT
public int getId() { return mId.getId(); }
/* Copyright (C) 2022 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. package com.android.server.biometrics.log; import android.annotation.NonNull; import com.android.internal.logging.InstanceId; import java.util.concurrent.atomic.AtomicInteger; /** State for an authentication session {@see com.android.internal.statusbar.ISessionListener}. class BiometricContextSessionInfo { private final InstanceId mId; private final AtomicInteger mOrder = new AtomicInteger(0); /** Wrap a session id with the initial state. BiometricContextSessionInfo(@NonNull InstanceId id) { mId = id; } /** Get the session id.
BiometricContextSessionInfo::getId
java
Reginer/aosp-android-jar
android-34/src/com/android/server/biometrics/log/BiometricContextSessionInfo.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/com/android/server/biometrics/log/BiometricContextSessionInfo.java
MIT
public int getOrder() { return mOrder.get(); }
/* Copyright (C) 2022 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. package com.android.server.biometrics.log; import android.annotation.NonNull; import com.android.internal.logging.InstanceId; import java.util.concurrent.atomic.AtomicInteger; /** State for an authentication session {@see com.android.internal.statusbar.ISessionListener}. class BiometricContextSessionInfo { private final InstanceId mId; private final AtomicInteger mOrder = new AtomicInteger(0); /** Wrap a session id with the initial state. BiometricContextSessionInfo(@NonNull InstanceId id) { mId = id; } /** Get the session id. public int getId() { return mId.getId(); } /** Gets the current order counter for the session.
BiometricContextSessionInfo::getOrder
java
Reginer/aosp-android-jar
android-34/src/com/android/server/biometrics/log/BiometricContextSessionInfo.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/com/android/server/biometrics/log/BiometricContextSessionInfo.java
MIT
public int getOrderAndIncrement() { return mOrder.getAndIncrement(); }
Gets the current order counter for the session and increment the counter. This should be called by the framework after processing any logged events, such as success / failure, to preserve the order each event was processed in.
BiometricContextSessionInfo::getOrderAndIncrement
java
Reginer/aosp-android-jar
android-34/src/com/android/server/biometrics/log/BiometricContextSessionInfo.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-34/src/com/android/server/biometrics/log/BiometricContextSessionInfo.java
MIT
public CrossProcessCursorWrapper(Cursor cursor) { super(cursor); }
Creates a cross process cursor wrapper. @param cursor The underlying cursor to wrap.
CrossProcessCursorWrapper::CrossProcessCursorWrapper
java
Reginer/aosp-android-jar
android-33/src/android/database/CrossProcessCursorWrapper.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-33/src/android/database/CrossProcessCursorWrapper.java
MIT
public TimingsTraceAndSlog() { this(SYSTEM_SERVER_TIMING_TAG); }
Default constructor using {@code system_server} tags.
TimingsTraceAndSlog::TimingsTraceAndSlog
java
Reginer/aosp-android-jar
android-35/src/com/android/server/utils/TimingsTraceAndSlog.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/com/android/server/utils/TimingsTraceAndSlog.java
MIT
public TimingsTraceAndSlog(@NonNull String tag) { this(tag, Trace.TRACE_TAG_SYSTEM_SERVER); }
Custom constructor using {@code system_server} trace tag. @param tag {@code logcat} tag
TimingsTraceAndSlog::TimingsTraceAndSlog
java
Reginer/aosp-android-jar
android-35/src/com/android/server/utils/TimingsTraceAndSlog.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/com/android/server/utils/TimingsTraceAndSlog.java
MIT
public TimingsTraceAndSlog(@NonNull String tag, long traceTag) { super(tag, traceTag); mTag = tag; }
Custom constructor. @param tag {@code logcat} tag @param traceTag {@code atrace} tag
TimingsTraceAndSlog::TimingsTraceAndSlog
java
Reginer/aosp-android-jar
android-35/src/com/android/server/utils/TimingsTraceAndSlog.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/com/android/server/utils/TimingsTraceAndSlog.java
MIT
public TimingsTraceAndSlog(@NonNull TimingsTraceAndSlog other) { super(other); this.mTag = other.mTag; }
@see TimingsTraceLog#TimingsTraceLog(TimingsTraceLog)
TimingsTraceAndSlog::TimingsTraceAndSlog
java
Reginer/aosp-android-jar
android-35/src/com/android/server/utils/TimingsTraceAndSlog.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-35/src/com/android/server/utils/TimingsTraceAndSlog.java
MIT
protected CellIdentity(@Nullable String tag, int type, @Nullable String mcc, @Nullable String mnc, @Nullable String alphal, @Nullable String alphas) { mTag = tag; mType = type; // Only allow INT_MAX if unknown string mcc/mnc if (mcc == null || isMcc(mcc)) { mMccStr = mcc; } else if (mcc.isEmpty() || mcc.equals(String.valueOf(Integer.MAX_VALUE))) { // If the mccStr is empty or unknown, set it as null. mMccStr = null; } else { // TODO: b/69384059 Should throw IllegalArgumentException for the invalid MCC format // after the bug got fixed. mMccStr = null; log("invalid MCC format: " + mcc); } if (mnc == null || isMnc(mnc)) { mMncStr = mnc; } else if (mnc.isEmpty() || mnc.equals(String.valueOf(Integer.MAX_VALUE))) { // If the mncStr is empty or unknown, set it as null. mMncStr = null; } else { // TODO: b/69384059 Should throw IllegalArgumentException for the invalid MNC format // after the bug got fixed. mMncStr = null; log("invalid MNC format: " + mnc); } if ((mMccStr != null && mMncStr == null) || (mMccStr == null && mMncStr != null)) { AnomalyReporter.reportAnomaly( UUID.fromString("a3ab0b9d-f2aa-4baf-911d-7096c0d4645a"), "CellIdentity Missing Half of PLMN ID"); } mAlphaLong = alphal; mAlphaShort = alphas; }
parameters for validation @hide public static final int MCC_LENGTH = 3; /** @hide public static final int MNC_MIN_LENGTH = 2; /** @hide public static final int MNC_MAX_LENGTH = 3; // Log tag /** @hide protected final String mTag; // Cell identity type /** @hide protected final int mType; // 3-digit Mobile Country Code in string format. Null for CDMA cell identity. /** @hide protected final String mMccStr; // 2 or 3-digit Mobile Network Code in string format. Null for CDMA cell identity. /** @hide protected final String mMncStr; // long alpha Operator Name String or Enhanced Operator Name String /** @hide protected String mAlphaLong; // short alpha Operator Name String or Enhanced Operator Name String /** @hide protected String mAlphaShort; // Cell Global, 3GPP TS 23.003 /** @hide protected String mGlobalCellId; /** @hide
CellIdentity::CellIdentity
java
Reginer/aosp-android-jar
android-31/src/android/telephony/CellIdentity.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/telephony/CellIdentity.java
MIT
public @CellInfo.Type int getType() { return mType; }
@hide @return The type of the cell identity
CellIdentity::getType
java
Reginer/aosp-android-jar
android-31/src/android/telephony/CellIdentity.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/telephony/CellIdentity.java
MIT
public String getMccString() { return mMccStr; }
@return MCC or null for CDMA @hide
CellIdentity::getMccString
java
Reginer/aosp-android-jar
android-31/src/android/telephony/CellIdentity.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/telephony/CellIdentity.java
MIT
public String getMncString() { return mMncStr; }
@return MNC or null for CDMA @hide
CellIdentity::getMncString
java
Reginer/aosp-android-jar
android-31/src/android/telephony/CellIdentity.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/telephony/CellIdentity.java
MIT
public int getChannelNumber() { return INVALID_CHANNEL_NUMBER; }
Returns the channel number of the cell identity. @hide @return The channel number, or {@link #INVALID_CHANNEL_NUMBER} if not implemented
CellIdentity::getChannelNumber
java
Reginer/aosp-android-jar
android-31/src/android/telephony/CellIdentity.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/telephony/CellIdentity.java
MIT
public boolean isSameCell(@Nullable CellIdentity ci) { if (ci == null) return false; if (this.getClass() != ci.getClass()) return false; return TextUtils.equals(this.getGlobalCellId(), ci.getGlobalCellId()); }
@param ci a CellIdentity to compare to the current CellIdentity. @return true if ci has the same technology and Global Cell ID; false, otherwise. @hide
CellIdentity::isSameCell
java
Reginer/aosp-android-jar
android-31/src/android/telephony/CellIdentity.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/telephony/CellIdentity.java
MIT
public @Nullable String getPlmn() { if (mMccStr == null || mMncStr == null) return null; return mMccStr + mMncStr; }
@param ci a CellIdentity to compare to the current CellIdentity. @return true if ci has the same technology and Global Cell ID; false, otherwise. @hide public boolean isSameCell(@Nullable CellIdentity ci) { if (ci == null) return false; if (this.getClass() != ci.getClass()) return false; return TextUtils.equals(this.getGlobalCellId(), ci.getGlobalCellId()); } /** @hide
CellIdentity::getPlmn
java
Reginer/aosp-android-jar
android-31/src/android/telephony/CellIdentity.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/telephony/CellIdentity.java
MIT
public static boolean isValidPlmn(@NonNull String plmn) { if (plmn.length() < MCC_LENGTH + MNC_MIN_LENGTH || plmn.length() > MCC_LENGTH + MNC_MAX_LENGTH) { return false; } return (isMcc(plmn.substring(0, MCC_LENGTH)) && isMnc(plmn.substring(MCC_LENGTH))); }
Used by phone interface manager to verify if a given string is valid MccMnc @hide
CellIdentity::isValidPlmn
java
Reginer/aosp-android-jar
android-31/src/android/telephony/CellIdentity.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/telephony/CellIdentity.java
MIT
protected CellIdentity(String tag, int type, Parcel source) { this(tag, type, source.readString(), source.readString(), source.readString(), source.readString()); }
Construct from Parcel @hide
CellIdentity::CellIdentity
java
Reginer/aosp-android-jar
android-31/src/android/telephony/CellIdentity.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/telephony/CellIdentity.java
MIT
protected void log(String s) { Rlog.w(mTag, s); }
Construct from Parcel @hide protected CellIdentity(String tag, int type, Parcel source) { this(tag, type, source.readString(), source.readString(), source.readString(), source.readString()); } /** Implement the Parcelable interface public static final @android.annotation.NonNull Creator<CellIdentity> CREATOR = new Creator<CellIdentity>() { @Override public CellIdentity createFromParcel(Parcel in) { int type = in.readInt(); switch (type) { case CellInfo.TYPE_GSM: return CellIdentityGsm.createFromParcelBody(in); case CellInfo.TYPE_WCDMA: return CellIdentityWcdma.createFromParcelBody(in); case CellInfo.TYPE_CDMA: return CellIdentityCdma.createFromParcelBody(in); case CellInfo.TYPE_LTE: return CellIdentityLte.createFromParcelBody(in); case CellInfo.TYPE_TDSCDMA: return CellIdentityTdscdma.createFromParcelBody(in); case CellInfo.TYPE_NR: return CellIdentityNr.createFromParcelBody(in); default: throw new IllegalArgumentException("Bad Cell identity Parcel"); } } @Override public CellIdentity[] newArray(int size) { return new CellIdentity[size]; } }; /** @hide
CellIdentity::log
java
Reginer/aosp-android-jar
android-31/src/android/telephony/CellIdentity.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/telephony/CellIdentity.java
MIT
protected static final int inRangeOrUnavailable(int value, int rangeMin, int rangeMax) { if (value < rangeMin || value > rangeMax) return CellInfo.UNAVAILABLE; return value; }
Construct from Parcel @hide protected CellIdentity(String tag, int type, Parcel source) { this(tag, type, source.readString(), source.readString(), source.readString(), source.readString()); } /** Implement the Parcelable interface public static final @android.annotation.NonNull Creator<CellIdentity> CREATOR = new Creator<CellIdentity>() { @Override public CellIdentity createFromParcel(Parcel in) { int type = in.readInt(); switch (type) { case CellInfo.TYPE_GSM: return CellIdentityGsm.createFromParcelBody(in); case CellInfo.TYPE_WCDMA: return CellIdentityWcdma.createFromParcelBody(in); case CellInfo.TYPE_CDMA: return CellIdentityCdma.createFromParcelBody(in); case CellInfo.TYPE_LTE: return CellIdentityLte.createFromParcelBody(in); case CellInfo.TYPE_TDSCDMA: return CellIdentityTdscdma.createFromParcelBody(in); case CellInfo.TYPE_NR: return CellIdentityNr.createFromParcelBody(in); default: throw new IllegalArgumentException("Bad Cell identity Parcel"); } } @Override public CellIdentity[] newArray(int size) { return new CellIdentity[size]; } }; /** @hide protected void log(String s) { Rlog.w(mTag, s); } /** @hide
CellIdentity::inRangeOrUnavailable
java
Reginer/aosp-android-jar
android-31/src/android/telephony/CellIdentity.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/telephony/CellIdentity.java
MIT
protected static final long inRangeOrUnavailable(long value, long rangeMin, long rangeMax) { if (value < rangeMin || value > rangeMax) return CellInfo.UNAVAILABLE_LONG; return value; }
Construct from Parcel @hide protected CellIdentity(String tag, int type, Parcel source) { this(tag, type, source.readString(), source.readString(), source.readString(), source.readString()); } /** Implement the Parcelable interface public static final @android.annotation.NonNull Creator<CellIdentity> CREATOR = new Creator<CellIdentity>() { @Override public CellIdentity createFromParcel(Parcel in) { int type = in.readInt(); switch (type) { case CellInfo.TYPE_GSM: return CellIdentityGsm.createFromParcelBody(in); case CellInfo.TYPE_WCDMA: return CellIdentityWcdma.createFromParcelBody(in); case CellInfo.TYPE_CDMA: return CellIdentityCdma.createFromParcelBody(in); case CellInfo.TYPE_LTE: return CellIdentityLte.createFromParcelBody(in); case CellInfo.TYPE_TDSCDMA: return CellIdentityTdscdma.createFromParcelBody(in); case CellInfo.TYPE_NR: return CellIdentityNr.createFromParcelBody(in); default: throw new IllegalArgumentException("Bad Cell identity Parcel"); } } @Override public CellIdentity[] newArray(int size) { return new CellIdentity[size]; } }; /** @hide protected void log(String s) { Rlog.w(mTag, s); } /** @hide protected static final int inRangeOrUnavailable(int value, int rangeMin, int rangeMax) { if (value < rangeMin || value > rangeMax) return CellInfo.UNAVAILABLE; return value; } /** @hide
CellIdentity::inRangeOrUnavailable
java
Reginer/aosp-android-jar
android-31/src/android/telephony/CellIdentity.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/telephony/CellIdentity.java
MIT
protected static final int inRangeOrUnavailable( int value, int rangeMin, int rangeMax, int special) { if ((value < rangeMin || value > rangeMax) && value != special) return CellInfo.UNAVAILABLE; return value; }
Construct from Parcel @hide protected CellIdentity(String tag, int type, Parcel source) { this(tag, type, source.readString(), source.readString(), source.readString(), source.readString()); } /** Implement the Parcelable interface public static final @android.annotation.NonNull Creator<CellIdentity> CREATOR = new Creator<CellIdentity>() { @Override public CellIdentity createFromParcel(Parcel in) { int type = in.readInt(); switch (type) { case CellInfo.TYPE_GSM: return CellIdentityGsm.createFromParcelBody(in); case CellInfo.TYPE_WCDMA: return CellIdentityWcdma.createFromParcelBody(in); case CellInfo.TYPE_CDMA: return CellIdentityCdma.createFromParcelBody(in); case CellInfo.TYPE_LTE: return CellIdentityLte.createFromParcelBody(in); case CellInfo.TYPE_TDSCDMA: return CellIdentityTdscdma.createFromParcelBody(in); case CellInfo.TYPE_NR: return CellIdentityNr.createFromParcelBody(in); default: throw new IllegalArgumentException("Bad Cell identity Parcel"); } } @Override public CellIdentity[] newArray(int size) { return new CellIdentity[size]; } }; /** @hide protected void log(String s) { Rlog.w(mTag, s); } /** @hide protected static final int inRangeOrUnavailable(int value, int rangeMin, int rangeMax) { if (value < rangeMin || value > rangeMax) return CellInfo.UNAVAILABLE; return value; } /** @hide protected static final long inRangeOrUnavailable(long value, long rangeMin, long rangeMax) { if (value < rangeMin || value > rangeMax) return CellInfo.UNAVAILABLE_LONG; return value; } /** @hide
CellIdentity::inRangeOrUnavailable
java
Reginer/aosp-android-jar
android-31/src/android/telephony/CellIdentity.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/telephony/CellIdentity.java
MIT
private static boolean isMcc(@NonNull String mcc) { // ensure no out of bounds indexing if (mcc.length() != MCC_LENGTH) return false; // Character.isDigit allows all unicode digits, not just [0-9] for (int i = 0; i < MCC_LENGTH; i++) { if (mcc.charAt(i) < '0' || mcc.charAt(i) > '9') return false; } return true; }
Construct from Parcel @hide protected CellIdentity(String tag, int type, Parcel source) { this(tag, type, source.readString(), source.readString(), source.readString(), source.readString()); } /** Implement the Parcelable interface public static final @android.annotation.NonNull Creator<CellIdentity> CREATOR = new Creator<CellIdentity>() { @Override public CellIdentity createFromParcel(Parcel in) { int type = in.readInt(); switch (type) { case CellInfo.TYPE_GSM: return CellIdentityGsm.createFromParcelBody(in); case CellInfo.TYPE_WCDMA: return CellIdentityWcdma.createFromParcelBody(in); case CellInfo.TYPE_CDMA: return CellIdentityCdma.createFromParcelBody(in); case CellInfo.TYPE_LTE: return CellIdentityLte.createFromParcelBody(in); case CellInfo.TYPE_TDSCDMA: return CellIdentityTdscdma.createFromParcelBody(in); case CellInfo.TYPE_NR: return CellIdentityNr.createFromParcelBody(in); default: throw new IllegalArgumentException("Bad Cell identity Parcel"); } } @Override public CellIdentity[] newArray(int size) { return new CellIdentity[size]; } }; /** @hide protected void log(String s) { Rlog.w(mTag, s); } /** @hide protected static final int inRangeOrUnavailable(int value, int rangeMin, int rangeMax) { if (value < rangeMin || value > rangeMax) return CellInfo.UNAVAILABLE; return value; } /** @hide protected static final long inRangeOrUnavailable(long value, long rangeMin, long rangeMax) { if (value < rangeMin || value > rangeMax) return CellInfo.UNAVAILABLE_LONG; return value; } /** @hide protected static final int inRangeOrUnavailable( int value, int rangeMin, int rangeMax, int special) { if ((value < rangeMin || value > rangeMax) && value != special) return CellInfo.UNAVAILABLE; return value; } /** @hide
CellIdentity::isMcc
java
Reginer/aosp-android-jar
android-31/src/android/telephony/CellIdentity.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/telephony/CellIdentity.java
MIT
private static boolean isMnc(@NonNull String mnc) { // ensure no out of bounds indexing if (mnc.length() < MNC_MIN_LENGTH || mnc.length() > MNC_MAX_LENGTH) return false; // Character.isDigit allows all unicode digits, not just [0-9] for (int i = 0; i < mnc.length(); i++) { if (mnc.charAt(i) < '0' || mnc.charAt(i) > '9') return false; } return true; }
Construct from Parcel @hide protected CellIdentity(String tag, int type, Parcel source) { this(tag, type, source.readString(), source.readString(), source.readString(), source.readString()); } /** Implement the Parcelable interface public static final @android.annotation.NonNull Creator<CellIdentity> CREATOR = new Creator<CellIdentity>() { @Override public CellIdentity createFromParcel(Parcel in) { int type = in.readInt(); switch (type) { case CellInfo.TYPE_GSM: return CellIdentityGsm.createFromParcelBody(in); case CellInfo.TYPE_WCDMA: return CellIdentityWcdma.createFromParcelBody(in); case CellInfo.TYPE_CDMA: return CellIdentityCdma.createFromParcelBody(in); case CellInfo.TYPE_LTE: return CellIdentityLte.createFromParcelBody(in); case CellInfo.TYPE_TDSCDMA: return CellIdentityTdscdma.createFromParcelBody(in); case CellInfo.TYPE_NR: return CellIdentityNr.createFromParcelBody(in); default: throw new IllegalArgumentException("Bad Cell identity Parcel"); } } @Override public CellIdentity[] newArray(int size) { return new CellIdentity[size]; } }; /** @hide protected void log(String s) { Rlog.w(mTag, s); } /** @hide protected static final int inRangeOrUnavailable(int value, int rangeMin, int rangeMax) { if (value < rangeMin || value > rangeMax) return CellInfo.UNAVAILABLE; return value; } /** @hide protected static final long inRangeOrUnavailable(long value, long rangeMin, long rangeMax) { if (value < rangeMin || value > rangeMax) return CellInfo.UNAVAILABLE_LONG; return value; } /** @hide protected static final int inRangeOrUnavailable( int value, int rangeMin, int rangeMax, int special) { if ((value < rangeMin || value > rangeMax) && value != special) return CellInfo.UNAVAILABLE; return value; } /** @hide private static boolean isMcc(@NonNull String mcc) { // ensure no out of bounds indexing if (mcc.length() != MCC_LENGTH) return false; // Character.isDigit allows all unicode digits, not just [0-9] for (int i = 0; i < MCC_LENGTH; i++) { if (mcc.charAt(i) < '0' || mcc.charAt(i) > '9') return false; } return true; } /** @hide
CellIdentity::isMnc
java
Reginer/aosp-android-jar
android-31/src/android/telephony/CellIdentity.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/telephony/CellIdentity.java
MIT
public static CellIdentity create(android.hardware.radio.V1_0.CellIdentity cellIdentity) { if (cellIdentity == null) return null; switch(cellIdentity.cellInfoType) { case CellInfoType.GSM: { if (cellIdentity.cellIdentityGsm.size() == 1) { return new CellIdentityGsm(cellIdentity.cellIdentityGsm.get(0)); } break; } case CellInfoType.WCDMA: { if (cellIdentity.cellIdentityWcdma.size() == 1) { return new CellIdentityWcdma(cellIdentity.cellIdentityWcdma.get(0)); } break; } case CellInfoType.TD_SCDMA: { if (cellIdentity.cellIdentityTdscdma.size() == 1) { return new CellIdentityTdscdma(cellIdentity.cellIdentityTdscdma.get(0)); } break; } case CellInfoType.LTE: { if (cellIdentity.cellIdentityLte.size() == 1) { return new CellIdentityLte(cellIdentity.cellIdentityLte.get(0)); } break; } case CellInfoType.CDMA: { if (cellIdentity.cellIdentityCdma.size() == 1) { return new CellIdentityCdma(cellIdentity.cellIdentityCdma.get(0)); } break; } case CellInfoType.NONE: break; default: break; } return null; }
Construct from Parcel @hide protected CellIdentity(String tag, int type, Parcel source) { this(tag, type, source.readString(), source.readString(), source.readString(), source.readString()); } /** Implement the Parcelable interface public static final @android.annotation.NonNull Creator<CellIdentity> CREATOR = new Creator<CellIdentity>() { @Override public CellIdentity createFromParcel(Parcel in) { int type = in.readInt(); switch (type) { case CellInfo.TYPE_GSM: return CellIdentityGsm.createFromParcelBody(in); case CellInfo.TYPE_WCDMA: return CellIdentityWcdma.createFromParcelBody(in); case CellInfo.TYPE_CDMA: return CellIdentityCdma.createFromParcelBody(in); case CellInfo.TYPE_LTE: return CellIdentityLte.createFromParcelBody(in); case CellInfo.TYPE_TDSCDMA: return CellIdentityTdscdma.createFromParcelBody(in); case CellInfo.TYPE_NR: return CellIdentityNr.createFromParcelBody(in); default: throw new IllegalArgumentException("Bad Cell identity Parcel"); } } @Override public CellIdentity[] newArray(int size) { return new CellIdentity[size]; } }; /** @hide protected void log(String s) { Rlog.w(mTag, s); } /** @hide protected static final int inRangeOrUnavailable(int value, int rangeMin, int rangeMax) { if (value < rangeMin || value > rangeMax) return CellInfo.UNAVAILABLE; return value; } /** @hide protected static final long inRangeOrUnavailable(long value, long rangeMin, long rangeMax) { if (value < rangeMin || value > rangeMax) return CellInfo.UNAVAILABLE_LONG; return value; } /** @hide protected static final int inRangeOrUnavailable( int value, int rangeMin, int rangeMax, int special) { if ((value < rangeMin || value > rangeMax) && value != special) return CellInfo.UNAVAILABLE; return value; } /** @hide private static boolean isMcc(@NonNull String mcc) { // ensure no out of bounds indexing if (mcc.length() != MCC_LENGTH) return false; // Character.isDigit allows all unicode digits, not just [0-9] for (int i = 0; i < MCC_LENGTH; i++) { if (mcc.charAt(i) < '0' || mcc.charAt(i) > '9') return false; } return true; } /** @hide private static boolean isMnc(@NonNull String mnc) { // ensure no out of bounds indexing if (mnc.length() < MNC_MIN_LENGTH || mnc.length() > MNC_MAX_LENGTH) return false; // Character.isDigit allows all unicode digits, not just [0-9] for (int i = 0; i < mnc.length(); i++) { if (mnc.charAt(i) < '0' || mnc.charAt(i) > '9') return false; } return true; } /** @hide
CellIdentity::create
java
Reginer/aosp-android-jar
android-31/src/android/telephony/CellIdentity.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/telephony/CellIdentity.java
MIT
public static CellIdentity create(android.hardware.radio.V1_2.CellIdentity cellIdentity) { if (cellIdentity == null) return null; switch(cellIdentity.cellInfoType) { case CellInfoType.GSM: { if (cellIdentity.cellIdentityGsm.size() == 1) { return new CellIdentityGsm(cellIdentity.cellIdentityGsm.get(0)); } break; } case CellInfoType.WCDMA: { if (cellIdentity.cellIdentityWcdma.size() == 1) { return new CellIdentityWcdma(cellIdentity.cellIdentityWcdma.get(0)); } break; } case CellInfoType.TD_SCDMA: { if (cellIdentity.cellIdentityTdscdma.size() == 1) { return new CellIdentityTdscdma(cellIdentity.cellIdentityTdscdma.get(0)); } break; } case CellInfoType.LTE: { if (cellIdentity.cellIdentityLte.size() == 1) { return new CellIdentityLte(cellIdentity.cellIdentityLte.get(0)); } break; } case CellInfoType.CDMA: { if (cellIdentity.cellIdentityCdma.size() == 1) { return new CellIdentityCdma(cellIdentity.cellIdentityCdma.get(0)); } break; } case CellInfoType.NONE: break; default: break; } return null; }
Construct from Parcel @hide protected CellIdentity(String tag, int type, Parcel source) { this(tag, type, source.readString(), source.readString(), source.readString(), source.readString()); } /** Implement the Parcelable interface public static final @android.annotation.NonNull Creator<CellIdentity> CREATOR = new Creator<CellIdentity>() { @Override public CellIdentity createFromParcel(Parcel in) { int type = in.readInt(); switch (type) { case CellInfo.TYPE_GSM: return CellIdentityGsm.createFromParcelBody(in); case CellInfo.TYPE_WCDMA: return CellIdentityWcdma.createFromParcelBody(in); case CellInfo.TYPE_CDMA: return CellIdentityCdma.createFromParcelBody(in); case CellInfo.TYPE_LTE: return CellIdentityLte.createFromParcelBody(in); case CellInfo.TYPE_TDSCDMA: return CellIdentityTdscdma.createFromParcelBody(in); case CellInfo.TYPE_NR: return CellIdentityNr.createFromParcelBody(in); default: throw new IllegalArgumentException("Bad Cell identity Parcel"); } } @Override public CellIdentity[] newArray(int size) { return new CellIdentity[size]; } }; /** @hide protected void log(String s) { Rlog.w(mTag, s); } /** @hide protected static final int inRangeOrUnavailable(int value, int rangeMin, int rangeMax) { if (value < rangeMin || value > rangeMax) return CellInfo.UNAVAILABLE; return value; } /** @hide protected static final long inRangeOrUnavailable(long value, long rangeMin, long rangeMax) { if (value < rangeMin || value > rangeMax) return CellInfo.UNAVAILABLE_LONG; return value; } /** @hide protected static final int inRangeOrUnavailable( int value, int rangeMin, int rangeMax, int special) { if ((value < rangeMin || value > rangeMax) && value != special) return CellInfo.UNAVAILABLE; return value; } /** @hide private static boolean isMcc(@NonNull String mcc) { // ensure no out of bounds indexing if (mcc.length() != MCC_LENGTH) return false; // Character.isDigit allows all unicode digits, not just [0-9] for (int i = 0; i < MCC_LENGTH; i++) { if (mcc.charAt(i) < '0' || mcc.charAt(i) > '9') return false; } return true; } /** @hide private static boolean isMnc(@NonNull String mnc) { // ensure no out of bounds indexing if (mnc.length() < MNC_MIN_LENGTH || mnc.length() > MNC_MAX_LENGTH) return false; // Character.isDigit allows all unicode digits, not just [0-9] for (int i = 0; i < mnc.length(); i++) { if (mnc.charAt(i) < '0' || mnc.charAt(i) > '9') return false; } return true; } /** @hide public static CellIdentity create(android.hardware.radio.V1_0.CellIdentity cellIdentity) { if (cellIdentity == null) return null; switch(cellIdentity.cellInfoType) { case CellInfoType.GSM: { if (cellIdentity.cellIdentityGsm.size() == 1) { return new CellIdentityGsm(cellIdentity.cellIdentityGsm.get(0)); } break; } case CellInfoType.WCDMA: { if (cellIdentity.cellIdentityWcdma.size() == 1) { return new CellIdentityWcdma(cellIdentity.cellIdentityWcdma.get(0)); } break; } case CellInfoType.TD_SCDMA: { if (cellIdentity.cellIdentityTdscdma.size() == 1) { return new CellIdentityTdscdma(cellIdentity.cellIdentityTdscdma.get(0)); } break; } case CellInfoType.LTE: { if (cellIdentity.cellIdentityLte.size() == 1) { return new CellIdentityLte(cellIdentity.cellIdentityLte.get(0)); } break; } case CellInfoType.CDMA: { if (cellIdentity.cellIdentityCdma.size() == 1) { return new CellIdentityCdma(cellIdentity.cellIdentityCdma.get(0)); } break; } case CellInfoType.NONE: break; default: break; } return null; } /** @hide
CellIdentity::create
java
Reginer/aosp-android-jar
android-31/src/android/telephony/CellIdentity.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/telephony/CellIdentity.java
MIT
public static CellIdentity create(android.hardware.radio.V1_5.CellIdentity ci) { if (ci == null) return null; switch (ci.getDiscriminator()) { case android.hardware.radio.V1_5.CellIdentity.hidl_discriminator.gsm: return new CellIdentityGsm(ci.gsm()); case android.hardware.radio.V1_5.CellIdentity.hidl_discriminator.cdma: return new CellIdentityCdma(ci.cdma()); case android.hardware.radio.V1_5.CellIdentity.hidl_discriminator.lte: return new CellIdentityLte(ci.lte()); case android.hardware.radio.V1_5.CellIdentity.hidl_discriminator.wcdma: return new CellIdentityWcdma(ci.wcdma()); case android.hardware.radio.V1_5.CellIdentity.hidl_discriminator.tdscdma: return new CellIdentityTdscdma(ci.tdscdma()); case android.hardware.radio.V1_5.CellIdentity.hidl_discriminator.nr: return new CellIdentityNr(ci.nr()); default: return null; } }
Construct from Parcel @hide protected CellIdentity(String tag, int type, Parcel source) { this(tag, type, source.readString(), source.readString(), source.readString(), source.readString()); } /** Implement the Parcelable interface public static final @android.annotation.NonNull Creator<CellIdentity> CREATOR = new Creator<CellIdentity>() { @Override public CellIdentity createFromParcel(Parcel in) { int type = in.readInt(); switch (type) { case CellInfo.TYPE_GSM: return CellIdentityGsm.createFromParcelBody(in); case CellInfo.TYPE_WCDMA: return CellIdentityWcdma.createFromParcelBody(in); case CellInfo.TYPE_CDMA: return CellIdentityCdma.createFromParcelBody(in); case CellInfo.TYPE_LTE: return CellIdentityLte.createFromParcelBody(in); case CellInfo.TYPE_TDSCDMA: return CellIdentityTdscdma.createFromParcelBody(in); case CellInfo.TYPE_NR: return CellIdentityNr.createFromParcelBody(in); default: throw new IllegalArgumentException("Bad Cell identity Parcel"); } } @Override public CellIdentity[] newArray(int size) { return new CellIdentity[size]; } }; /** @hide protected void log(String s) { Rlog.w(mTag, s); } /** @hide protected static final int inRangeOrUnavailable(int value, int rangeMin, int rangeMax) { if (value < rangeMin || value > rangeMax) return CellInfo.UNAVAILABLE; return value; } /** @hide protected static final long inRangeOrUnavailable(long value, long rangeMin, long rangeMax) { if (value < rangeMin || value > rangeMax) return CellInfo.UNAVAILABLE_LONG; return value; } /** @hide protected static final int inRangeOrUnavailable( int value, int rangeMin, int rangeMax, int special) { if ((value < rangeMin || value > rangeMax) && value != special) return CellInfo.UNAVAILABLE; return value; } /** @hide private static boolean isMcc(@NonNull String mcc) { // ensure no out of bounds indexing if (mcc.length() != MCC_LENGTH) return false; // Character.isDigit allows all unicode digits, not just [0-9] for (int i = 0; i < MCC_LENGTH; i++) { if (mcc.charAt(i) < '0' || mcc.charAt(i) > '9') return false; } return true; } /** @hide private static boolean isMnc(@NonNull String mnc) { // ensure no out of bounds indexing if (mnc.length() < MNC_MIN_LENGTH || mnc.length() > MNC_MAX_LENGTH) return false; // Character.isDigit allows all unicode digits, not just [0-9] for (int i = 0; i < mnc.length(); i++) { if (mnc.charAt(i) < '0' || mnc.charAt(i) > '9') return false; } return true; } /** @hide public static CellIdentity create(android.hardware.radio.V1_0.CellIdentity cellIdentity) { if (cellIdentity == null) return null; switch(cellIdentity.cellInfoType) { case CellInfoType.GSM: { if (cellIdentity.cellIdentityGsm.size() == 1) { return new CellIdentityGsm(cellIdentity.cellIdentityGsm.get(0)); } break; } case CellInfoType.WCDMA: { if (cellIdentity.cellIdentityWcdma.size() == 1) { return new CellIdentityWcdma(cellIdentity.cellIdentityWcdma.get(0)); } break; } case CellInfoType.TD_SCDMA: { if (cellIdentity.cellIdentityTdscdma.size() == 1) { return new CellIdentityTdscdma(cellIdentity.cellIdentityTdscdma.get(0)); } break; } case CellInfoType.LTE: { if (cellIdentity.cellIdentityLte.size() == 1) { return new CellIdentityLte(cellIdentity.cellIdentityLte.get(0)); } break; } case CellInfoType.CDMA: { if (cellIdentity.cellIdentityCdma.size() == 1) { return new CellIdentityCdma(cellIdentity.cellIdentityCdma.get(0)); } break; } case CellInfoType.NONE: break; default: break; } return null; } /** @hide public static CellIdentity create(android.hardware.radio.V1_2.CellIdentity cellIdentity) { if (cellIdentity == null) return null; switch(cellIdentity.cellInfoType) { case CellInfoType.GSM: { if (cellIdentity.cellIdentityGsm.size() == 1) { return new CellIdentityGsm(cellIdentity.cellIdentityGsm.get(0)); } break; } case CellInfoType.WCDMA: { if (cellIdentity.cellIdentityWcdma.size() == 1) { return new CellIdentityWcdma(cellIdentity.cellIdentityWcdma.get(0)); } break; } case CellInfoType.TD_SCDMA: { if (cellIdentity.cellIdentityTdscdma.size() == 1) { return new CellIdentityTdscdma(cellIdentity.cellIdentityTdscdma.get(0)); } break; } case CellInfoType.LTE: { if (cellIdentity.cellIdentityLte.size() == 1) { return new CellIdentityLte(cellIdentity.cellIdentityLte.get(0)); } break; } case CellInfoType.CDMA: { if (cellIdentity.cellIdentityCdma.size() == 1) { return new CellIdentityCdma(cellIdentity.cellIdentityCdma.get(0)); } break; } case CellInfoType.NONE: break; default: break; } return null; } /** @hide
CellIdentity::create
java
Reginer/aosp-android-jar
android-31/src/android/telephony/CellIdentity.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/android/telephony/CellIdentity.java
MIT
public void fetchInitialState() { if (mWifiManager == null) { return; } updateWifiState(); final NetworkInfo networkInfo = mConnectivityManager.getNetworkInfo(ConnectivityManager.TYPE_WIFI); connected = networkInfo != null && networkInfo.isConnected(); mWifiInfo = null; ssid = null; if (connected) { mWifiInfo = mWifiManager.getConnectionInfo(); if (mWifiInfo != null) { if (mWifiInfo.isPasspointAp() || mWifiInfo.isOsuAp()) { ssid = mWifiInfo.getPasspointProviderFriendlyName(); } else { ssid = getValidSsid(mWifiInfo); } isCarrierMerged = mWifiInfo.isCarrierMerged(); subId = mWifiInfo.getSubscriptionId(); updateRssi(mWifiInfo.getRssi()); maybeRequestNetworkScore(); } } updateStatusLabel(); }
Fetches initial state as if a WifiManager.NETWORK_STATE_CHANGED_ACTION have been received. This replaces the dependency on the initial sticky broadcast.
WifiStatusTracker::fetchInitialState
java
Reginer/aosp-android-jar
android-32/src/com/android/settingslib/wifi/WifiStatusTracker.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/settingslib/wifi/WifiStatusTracker.java
MIT
public void refreshLocale() { updateStatusLabel(); mCallback.run(); }
Fetches initial state as if a WifiManager.NETWORK_STATE_CHANGED_ACTION have been received. This replaces the dependency on the initial sticky broadcast. public void fetchInitialState() { if (mWifiManager == null) { return; } updateWifiState(); final NetworkInfo networkInfo = mConnectivityManager.getNetworkInfo(ConnectivityManager.TYPE_WIFI); connected = networkInfo != null && networkInfo.isConnected(); mWifiInfo = null; ssid = null; if (connected) { mWifiInfo = mWifiManager.getConnectionInfo(); if (mWifiInfo != null) { if (mWifiInfo.isPasspointAp() || mWifiInfo.isOsuAp()) { ssid = mWifiInfo.getPasspointProviderFriendlyName(); } else { ssid = getValidSsid(mWifiInfo); } isCarrierMerged = mWifiInfo.isCarrierMerged(); subId = mWifiInfo.getSubscriptionId(); updateRssi(mWifiInfo.getRssi()); maybeRequestNetworkScore(); } } updateStatusLabel(); } public void handleBroadcast(Intent intent) { if (mWifiManager == null) { return; } String action = intent.getAction(); if (action.equals(WifiManager.WIFI_STATE_CHANGED_ACTION)) { updateWifiState(); } } private void updateWifiInfo(WifiInfo wifiInfo) { updateWifiState(); connected = wifiInfo != null; mWifiInfo = wifiInfo; ssid = null; if (mWifiInfo != null) { if (mWifiInfo.isPasspointAp() || mWifiInfo.isOsuAp()) { ssid = mWifiInfo.getPasspointProviderFriendlyName(); } else { ssid = getValidSsid(mWifiInfo); } isCarrierMerged = mWifiInfo.isCarrierMerged(); subId = mWifiInfo.getSubscriptionId(); updateRssi(mWifiInfo.getRssi()); maybeRequestNetworkScore(); } } private void updateWifiState() { state = mWifiManager.getWifiState(); enabled = state == WifiManager.WIFI_STATE_ENABLED; } private void updateRssi(int newRssi) { rssi = newRssi; level = mWifiManager.calculateSignalLevel(rssi); } private void maybeRequestNetworkScore() { NetworkKey networkKey = NetworkKey.createFromWifiInfo(mWifiInfo); if (mWifiNetworkScoreCache.getScoredNetwork(networkKey) == null) { mNetworkScoreManager.requestScores(new NetworkKey[]{ networkKey }); } } private void updateStatusLabel() { if (mWifiManager == null) { return; } NetworkCapabilities networkCapabilities; isDefaultNetwork = false; if (mDefaultNetworkCapabilities != null) { boolean isWifi = mDefaultNetworkCapabilities.hasTransport( NetworkCapabilities.TRANSPORT_WIFI); boolean isVcnOverWifi = mDefaultNetworkCapabilities.hasTransport( NetworkCapabilities.TRANSPORT_CELLULAR) && (Utils.tryGetWifiInfoForVcn(mDefaultNetworkCapabilities) != null); if (isWifi || isVcnOverWifi) { isDefaultNetwork = true; } } if (isDefaultNetwork) { // Wifi is connected and the default network. networkCapabilities = mDefaultNetworkCapabilities; } else { networkCapabilities = mConnectivityManager.getNetworkCapabilities( mWifiManager.getCurrentNetwork()); } isCaptivePortal = false; if (networkCapabilities != null) { if (networkCapabilities.hasCapability(NET_CAPABILITY_CAPTIVE_PORTAL)) { statusLabel = mContext.getString(R.string.wifi_status_sign_in_required); isCaptivePortal = true; return; } else if (networkCapabilities.hasCapability(NET_CAPABILITY_PARTIAL_CONNECTIVITY)) { statusLabel = mContext.getString(R.string.wifi_limited_connection); return; } else if (!networkCapabilities.hasCapability(NET_CAPABILITY_VALIDATED)) { final String mode = Settings.Global.getString(mContext.getContentResolver(), Settings.Global.PRIVATE_DNS_MODE); if (networkCapabilities.isPrivateDnsBroken()) { statusLabel = mContext.getString(R.string.private_dns_broken); } else { statusLabel = mContext.getString(R.string.wifi_status_no_internet); } return; } else if (!isDefaultNetwork && mDefaultNetworkCapabilities != null && mDefaultNetworkCapabilities.hasTransport(TRANSPORT_CELLULAR)) { statusLabel = mContext.getString(R.string.wifi_connected_low_quality); return; } } ScoredNetwork scoredNetwork = mWifiNetworkScoreCache.getScoredNetwork(NetworkKey.createFromWifiInfo(mWifiInfo)); statusLabel = scoredNetwork == null ? null : AccessPoint.getSpeedLabel(mContext, scoredNetwork, rssi); } /** Refresh the status label on Locale changed.
WifiStatusTracker::refreshLocale
java
Reginer/aosp-android-jar
android-32/src/com/android/settingslib/wifi/WifiStatusTracker.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/settingslib/wifi/WifiStatusTracker.java
MIT
public void dump(PrintWriter pw) { pw.println(" - WiFi Network History ------"); int size = 0; for (int i = 0; i < HISTORY_SIZE; i++) { if (mHistory[i] != null) size++; } // Print out the previous states in ordered number. for (int i = mHistoryIndex + HISTORY_SIZE - 1; i >= mHistoryIndex + HISTORY_SIZE - size; i--) { pw.println(" Previous WiFiNetwork(" + (mHistoryIndex + HISTORY_SIZE - i) + "): " + mHistory[i & (HISTORY_SIZE - 1)]); } }
Fetches initial state as if a WifiManager.NETWORK_STATE_CHANGED_ACTION have been received. This replaces the dependency on the initial sticky broadcast. public void fetchInitialState() { if (mWifiManager == null) { return; } updateWifiState(); final NetworkInfo networkInfo = mConnectivityManager.getNetworkInfo(ConnectivityManager.TYPE_WIFI); connected = networkInfo != null && networkInfo.isConnected(); mWifiInfo = null; ssid = null; if (connected) { mWifiInfo = mWifiManager.getConnectionInfo(); if (mWifiInfo != null) { if (mWifiInfo.isPasspointAp() || mWifiInfo.isOsuAp()) { ssid = mWifiInfo.getPasspointProviderFriendlyName(); } else { ssid = getValidSsid(mWifiInfo); } isCarrierMerged = mWifiInfo.isCarrierMerged(); subId = mWifiInfo.getSubscriptionId(); updateRssi(mWifiInfo.getRssi()); maybeRequestNetworkScore(); } } updateStatusLabel(); } public void handleBroadcast(Intent intent) { if (mWifiManager == null) { return; } String action = intent.getAction(); if (action.equals(WifiManager.WIFI_STATE_CHANGED_ACTION)) { updateWifiState(); } } private void updateWifiInfo(WifiInfo wifiInfo) { updateWifiState(); connected = wifiInfo != null; mWifiInfo = wifiInfo; ssid = null; if (mWifiInfo != null) { if (mWifiInfo.isPasspointAp() || mWifiInfo.isOsuAp()) { ssid = mWifiInfo.getPasspointProviderFriendlyName(); } else { ssid = getValidSsid(mWifiInfo); } isCarrierMerged = mWifiInfo.isCarrierMerged(); subId = mWifiInfo.getSubscriptionId(); updateRssi(mWifiInfo.getRssi()); maybeRequestNetworkScore(); } } private void updateWifiState() { state = mWifiManager.getWifiState(); enabled = state == WifiManager.WIFI_STATE_ENABLED; } private void updateRssi(int newRssi) { rssi = newRssi; level = mWifiManager.calculateSignalLevel(rssi); } private void maybeRequestNetworkScore() { NetworkKey networkKey = NetworkKey.createFromWifiInfo(mWifiInfo); if (mWifiNetworkScoreCache.getScoredNetwork(networkKey) == null) { mNetworkScoreManager.requestScores(new NetworkKey[]{ networkKey }); } } private void updateStatusLabel() { if (mWifiManager == null) { return; } NetworkCapabilities networkCapabilities; isDefaultNetwork = false; if (mDefaultNetworkCapabilities != null) { boolean isWifi = mDefaultNetworkCapabilities.hasTransport( NetworkCapabilities.TRANSPORT_WIFI); boolean isVcnOverWifi = mDefaultNetworkCapabilities.hasTransport( NetworkCapabilities.TRANSPORT_CELLULAR) && (Utils.tryGetWifiInfoForVcn(mDefaultNetworkCapabilities) != null); if (isWifi || isVcnOverWifi) { isDefaultNetwork = true; } } if (isDefaultNetwork) { // Wifi is connected and the default network. networkCapabilities = mDefaultNetworkCapabilities; } else { networkCapabilities = mConnectivityManager.getNetworkCapabilities( mWifiManager.getCurrentNetwork()); } isCaptivePortal = false; if (networkCapabilities != null) { if (networkCapabilities.hasCapability(NET_CAPABILITY_CAPTIVE_PORTAL)) { statusLabel = mContext.getString(R.string.wifi_status_sign_in_required); isCaptivePortal = true; return; } else if (networkCapabilities.hasCapability(NET_CAPABILITY_PARTIAL_CONNECTIVITY)) { statusLabel = mContext.getString(R.string.wifi_limited_connection); return; } else if (!networkCapabilities.hasCapability(NET_CAPABILITY_VALIDATED)) { final String mode = Settings.Global.getString(mContext.getContentResolver(), Settings.Global.PRIVATE_DNS_MODE); if (networkCapabilities.isPrivateDnsBroken()) { statusLabel = mContext.getString(R.string.private_dns_broken); } else { statusLabel = mContext.getString(R.string.wifi_status_no_internet); } return; } else if (!isDefaultNetwork && mDefaultNetworkCapabilities != null && mDefaultNetworkCapabilities.hasTransport(TRANSPORT_CELLULAR)) { statusLabel = mContext.getString(R.string.wifi_connected_low_quality); return; } } ScoredNetwork scoredNetwork = mWifiNetworkScoreCache.getScoredNetwork(NetworkKey.createFromWifiInfo(mWifiInfo)); statusLabel = scoredNetwork == null ? null : AccessPoint.getSpeedLabel(mContext, scoredNetwork, rssi); } /** Refresh the status label on Locale changed. public void refreshLocale() { updateStatusLabel(); mCallback.run(); } private String getValidSsid(WifiInfo info) { String ssid = info.getSSID(); if (ssid != null && !WifiManager.UNKNOWN_SSID.equals(ssid)) { return ssid; } return null; } private void recordLastWifiNetwork(String log) { mHistory[mHistoryIndex] = log; mHistoryIndex = (mHistoryIndex + 1) % HISTORY_SIZE; } /** Dump function.
WifiStatusTracker::dump
java
Reginer/aosp-android-jar
android-32/src/com/android/settingslib/wifi/WifiStatusTracker.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/com/android/settingslib/wifi/WifiStatusTracker.java
MIT
public ClassCircularityError() { super(); }
Constructs a {@code ClassCircularityError} with no detail message.
ClassCircularityError::ClassCircularityError
java
Reginer/aosp-android-jar
android-32/src/java/lang/ClassCircularityError.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/java/lang/ClassCircularityError.java
MIT
public ClassCircularityError(String s) { super(s); }
Constructs a {@code ClassCircularityError} with the specified detail message. @param s The detail message
ClassCircularityError::ClassCircularityError
java
Reginer/aosp-android-jar
android-32/src/java/lang/ClassCircularityError.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-32/src/java/lang/ClassCircularityError.java
MIT
public static String dumpHexString(@Nullable byte[] array) { if (array == null) return "(null)"; return dumpHexString(array, 0, array.length); }
Dump the hex string corresponding to the specified byte array. @param array byte array to be dumped.
HexDump::dumpHexString
java
Reginer/aosp-android-jar
android-31/src/com/android/net/module/util/HexDump.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/net/module/util/HexDump.java
MIT
public static String dumpHexString(@Nullable byte[] array, int offset, int length) { if (array == null) return "(null)"; StringBuilder result = new StringBuilder(); byte[] line = new byte[16]; int lineIndex = 0; result.append("\n0x"); result.append(toHexString(offset)); for (int i = offset; i < offset + length; i++) { if (lineIndex == 16) { result.append(" "); for (int j = 0; j < 16; j++) { if (line[j] > ' ' && line[j] < '~') { result.append(new String(line, j, 1)); } else { result.append("."); } } result.append("\n0x"); result.append(toHexString(i)); lineIndex = 0; } byte b = array[i]; result.append(" "); result.append(HEX_DIGITS[(b >>> 4) & 0x0F]); result.append(HEX_DIGITS[b & 0x0F]); line[lineIndex++] = b; } if (lineIndex != 16) { int count = (16 - lineIndex) * 3; count++; for (int i = 0; i < count; i++) { result.append(" "); } for (int i = 0; i < lineIndex; i++) { if (line[i] > ' ' && line[i] < '~') { result.append(new String(line, i, 1)); } else { result.append("."); } } } return result.toString(); }
Dump the hex string corresponding to the specified byte array. @param array byte array to be dumped. @param offset the offset in array where dump should start. @param length the length of bytes to be dumped.
HexDump::dumpHexString
java
Reginer/aosp-android-jar
android-31/src/com/android/net/module/util/HexDump.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/net/module/util/HexDump.java
MIT
public static String toHexString(byte b) { return toHexString(toByteArray(b)); }
Convert a byte to an uppercase hex string. @param b the byte to be converted.
HexDump::toHexString
java
Reginer/aosp-android-jar
android-31/src/com/android/net/module/util/HexDump.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/net/module/util/HexDump.java
MIT
public static String toHexString(byte[] array) { return toHexString(array, 0, array.length, true); }
Convert a byte array to an uppercase hex string. @param array the byte array to be converted.
HexDump::toHexString
java
Reginer/aosp-android-jar
android-31/src/com/android/net/module/util/HexDump.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/net/module/util/HexDump.java
MIT
public static String toHexString(byte[] array, boolean upperCase) { return toHexString(array, 0, array.length, upperCase); }
Convert a byte array to a hex string. @param array the byte array to be converted. @param upperCase whether the converted hex string should be uppercase or not.
HexDump::toHexString
java
Reginer/aosp-android-jar
android-31/src/com/android/net/module/util/HexDump.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/net/module/util/HexDump.java
MIT
public static String toHexString(byte[] array, int offset, int length) { return toHexString(array, offset, length, true); }
Convert a byte array to hex string. @param array the byte array to be converted. @param offset the offset in array where conversion should start. @param length the length of bytes to be converted.
HexDump::toHexString
java
Reginer/aosp-android-jar
android-31/src/com/android/net/module/util/HexDump.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/net/module/util/HexDump.java
MIT
public static String toHexString(byte[] array, int offset, int length, boolean upperCase) { char[] digits = upperCase ? HEX_DIGITS : HEX_LOWER_CASE_DIGITS; char[] buf = new char[length * 2]; int bufIndex = 0; for (int i = offset; i < offset + length; i++) { byte b = array[i]; buf[bufIndex++] = digits[(b >>> 4) & 0x0F]; buf[bufIndex++] = digits[b & 0x0F]; } return new String(buf); }
Convert a byte array to hex string. @param array the byte array to be converted. @param offset the offset in array where conversion should start. @param length the length of bytes to be converted. @param upperCase whether the converted hex string should be uppercase or not.
HexDump::toHexString
java
Reginer/aosp-android-jar
android-31/src/com/android/net/module/util/HexDump.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/net/module/util/HexDump.java
MIT
public static String toHexString(int i) { return toHexString(toByteArray(i)); }
Convert an integer to hex string. @param i the integer to be converted.
HexDump::toHexString
java
Reginer/aosp-android-jar
android-31/src/com/android/net/module/util/HexDump.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/net/module/util/HexDump.java
MIT
public static byte[] toByteArray(byte b) { byte[] array = new byte[1]; array[0] = b; return array; }
Convert a byte to byte array. @param b the byte to be converted.
HexDump::toByteArray
java
Reginer/aosp-android-jar
android-31/src/com/android/net/module/util/HexDump.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/net/module/util/HexDump.java
MIT
public static byte[] toByteArray(int i) { byte[] array = new byte[4]; array[3] = (byte) (i & 0xFF); array[2] = (byte) ((i >> 8) & 0xFF); array[1] = (byte) ((i >> 16) & 0xFF); array[0] = (byte) ((i >> 24) & 0xFF); return array; }
Convert an integer to byte array. @param i the integer to be converted.
HexDump::toByteArray
java
Reginer/aosp-android-jar
android-31/src/com/android/net/module/util/HexDump.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/net/module/util/HexDump.java
MIT
public static byte[] hexStringToByteArray(String hexString) { int length = hexString.length(); byte[] buffer = new byte[length / 2]; for (int i = 0; i < length; i += 2) { buffer[i / 2] = (byte) ((toByte(hexString.charAt(i)) << 4) | toByte(hexString.charAt(i + 1))); } return buffer; }
Convert a hex string to a byte array. @param hexString the string to be converted.
HexDump::hexStringToByteArray
java
Reginer/aosp-android-jar
android-31/src/com/android/net/module/util/HexDump.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/net/module/util/HexDump.java
MIT
public static StringBuilder appendByteAsHex(StringBuilder sb, byte b, boolean upperCase) { char[] digits = upperCase ? HEX_DIGITS : HEX_LOWER_CASE_DIGITS; sb.append(digits[(b >> 4) & 0xf]); sb.append(digits[b & 0xf]); return sb; }
Convert a byte to hex string and append it to StringBuilder. @param sb StringBuilder instance. @param b the byte to be converted. @param upperCase whether the converted hex string should be uppercase or not.
HexDump::appendByteAsHex
java
Reginer/aosp-android-jar
android-31/src/com/android/net/module/util/HexDump.java
https://github.com/Reginer/aosp-android-jar/blob/master/android-31/src/com/android/net/module/util/HexDump.java
MIT