Android 源码热门改动速查(持续更新.....)

2024-08-22 06:32

本文主要是介绍Android 源码热门改动速查(持续更新.....),希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

1、8.1 默认音量调整

frameworks\base\media\java\android\media\AudioSystem.java
修改 DEFAULT_STREAM_VOLUME 数组,最大值和最小值修改对应文件

frameworks\base\services\core\java\com\android\server\audio\AudioService.java

MIN_STREAM_VOLUME MAX_STREAM_VOLUME

媒体音量在 AudioService 中被初始化修改了,可以强制赋值

AudioSystem.DEFAULT_STREAM_VOLUME[AudioSystem.STREAM_MUSIC] = defaultMusicVolume;

或可以通过配置 ro.config.media_vol_default 修改

device\mediateksample\xxxx\system.prop

2、USB 连接图标修改

frameworks\base\core\res\res\drawable-nodpi\stat_sys_adb.xml

6.0 以前都一直使用小机器人图标,8.1 是 奥利奥图标,9.0 是 P图标,如果怀旧可以从 6.0 复制并覆盖

3、系统触摸提示音开启和关闭

vendor\mediatek\proprietary\packages\apps\SettingsProvider\res\values\defaults.xml

<!-- Default for UI touch sounds enabled -->
<bool name="def_sound_effects_enabled">true</bool>

java 代码中可通过

 private void handleSoundEffects(boolean isOpen){Settings.System.putInt(getContentResolver(),Settings.System.SOUND_EFFECTS_ENABLED, isOpen ? 1 : 0);final AudioManager am = (AudioManager) getSystemService(Context.AUDIO_SERVICE);if (isOpen) {am.loadSoundEffects();} else {am.unloadSoundEffects();}}

如要替换触摸提示音可至路径 frameworks\base\data\sounds\effects\Effect_Tick.ogg

4、修改系统默认字体大小

查看系统支持的字体大小范围
vendor\mediatek\proprietary\packages\apps\MtkSettings\res\values\arrays.xml

    <string-array name="entryvalues_font_size" translatable="false"><item>0.85</item><item>1.0</item><item>1.15</item><item>1.30</item></string-array>

以下三处地方的改动,请根据实际生效情况而定

1、frameworks\base\core\java\android\provider\Settings.java

 public static final class System extends NameValueTable {private static final float DEFAULT_FONT_SCALE = 1.0f;

2、frameworks\base\core\java\android\content\res\Configuration.java

    public void setToDefaults() {fontScale = 1;mcc = mnc = 0;

3、vendor\mediatek\proprietary\packages\apps\SettingsProvider\src\com\android\providers\settings\DatabaseHelper.java

private void loadSystemSettings(SQLiteDatabase db) {....
loadSetting(stmt, Settings.System.FONT_SCALE, 0.85f);

5、休眠时间增加永不息屏选项

vendor/mediatek/proprietary/packages/apps/MtkSettings/res/values-zh-rCN/arrays.xml

+++ b/alps/vendor/mediatek/proprietary/packages/apps/MtkSettings/res/values-zh-rCN/arrays.xml
@@ -37,6 +37,7 @@<item msgid="7489864775127957179">"5分钟"</item><item msgid="2314124409517439288">"10分钟"</item><item msgid="6864027152847611413">"30分钟"</item>
+    <item msgid="7149253832238213885">"永不息屏"</item></string-array><string-array name="dream_timeout_entries"><item msgid="3149294732238283185">"永不"</item>

vendor/mediatek/proprietary/packages/apps/MtkSettings/res/values/arrays.xml

+++ b/alps/vendor/mediatek/proprietary/packages/apps/MtkSettings/res/values/arrays.xml
@@ -48,6 +48,7 @@<item>5 minutes</item><item>10 minutes</item><item>30 minutes</item>
+        <item>never</item></string-array><!-- Do not translate. -->
@@ -66,6 +67,8 @@<item>600000</item><!-- Do not translate. --><item>1800000</item>
+        <!-- MAX. -->
+        <item>2147483647</item></string-array>

Android 8.1
vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/display/TimeoutPreferenceController.java

+++ b/alps/vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/display/TimeoutPreferenceController.java
@@ -111,7 +111,11 @@ public class TimeoutPreferenceController extends AbstractPreferenceController im} else {final CharSequence timeoutDescription = getTimeoutDescription(currentTimeout, entries, values);
-            summary = timeoutDescription == null
+            //cczheng add for show never sleep
+            if (currentTimeout == Integer.MAX_VALUE)
+                summary = entries[entries.length-1].toString();
+            else
+                summary = timeoutDescription == null? "": mContext.getString(R.string.screen_timeout_summary, timeoutDescription);}

Android6.0
packages\apps\Settings\src\com\android\settings\DisplaySettings.java

private void updateTimeoutPreferenceDescription(long currentTimeout) {ListPreference preference = mScreenTimeoutPreference;String summary;if (currentTimeout < 0) {// Unsupported valuesummary = "";} else {final CharSequence[] entries = preference.getEntries();final CharSequence[] values = preference.getEntryValues();if (entries == null || entries.length == 0) {summary = "";} else {int best = 0;for (int i = 0; i < values.length; i++) {long timeout = Long.parseLong(values[i].toString());if (currentTimeout >= timeout) {best = i;}}//cczheng add for show never sleepif (currentTimeout == Integer.MAX_VALUE)summary = entries[best].toString();elsesummary = preference.getContext().getString(R.string.screen_timeout_summary,entries[best]);}}preference.setSummary(summary);}

6、Launcher的 hotseat 自动上下跳动

vendor\mediatek\proprietary\packages\apps\Launcher3\src\com\android\launcher3\Launcher.java
注释onResume() 中的如下方法

 @Overrideprotected void onResume() {long startTime = 0;..../*if (shouldShowDiscoveryBounce()) {mAllAppsController.showDiscoveryBounce();}*/

7、非系统拨号应用呼叫紧急号码直接呼出,不跳转至Dialer

vendor\mediatek\proprietary\packages\services\Telecomm\src\com\android\server\telecom\NewOutgoingCallIntentBroadcaster.java

去除 mIsDefaultOrSystemPhoneApp 判断

    @VisibleForTestingpublic int processIntent() {Log.v(this, "Processing call intent in OutgoingCallIntentBroadcaster.");....if (Intent.ACTION_CALL.equals(action)) {if (isPotentialEmergencyNumber) {//cczheng remove the default Dialer islaunched when call an EmergencyNumber/*if (!mIsDefaultOrSystemPhoneApp) {Log.w(this, "Cannot call potential emergency number %s with CALL Intent %s "+ "unless caller is system or default dialer.", number, intent);launchSystemDialer(intent.getData());return DisconnectCause.OUTGOING_CANCELED;} else {*/callImmediately = true;//}}} else if (Intent.ACTION_CALL_EMERGENCY.equals(action)) {......

8、vlote电话自动转语音电话通知

vendor\mediatek\proprietary\packages\apps\Dialer\java\com\android\incallui\InCallActivity.java

private String lastUIScreenShow;private String currentUIScreen;private void showMainInCallFragment() {// If the activity's onStart method hasn't been called yet then defer doing any work.if (!isVisible) {LogUtil.i("InCallActivity.showMainInCallFragment", "not visible yet/anymore");return;}// Don't let this be reentrant.if (isInShowMainInCallFragment) {LogUtil.i("InCallActivity.showMainInCallFragment", "already in method, bailing");return;}isInShowMainInCallFragment = true;ShouldShowUiResult shouldShowAnswerUi = getShouldShowAnswerUi();ShouldShowUiResult shouldShowVideoUi = getShouldShowVideoUi();LogUtil.d("InCallActivity.showMainInCallFragment","shouldShowAnswerUi: %b, shouldShowVideoUi: %b, "+ "didShowAnswerScreen: %b, didShowInCallScreen: %b, didShowVideoCallScreen: %b",shouldShowAnswerUi.shouldShow,shouldShowVideoUi.shouldShow,didShowAnswerScreen,didShowInCallScreen,didShowVideoCallScreen);android.util.Log.i("InCallActivity.showMainInCallFragment",String.format("shouldShowAnswerUi: %b, shouldShowVideoUi: %b, "+ "didShowAnswerScreen: %b, didShowInCallScreen: %b, didShowVideoCallScreen: %b",shouldShowAnswerUi.shouldShow,shouldShowVideoUi.shouldShow,didShowAnswerScreen,didShowInCallScreen,didShowVideoCallScreen));/// M:[ALPS03482828] modify allow orientation conditions.incallactivity and videocallpresenter///have conflicts on allow orientation.keep incallactivity and videocallpresenter have same///conditions. @{/// Google original code:@{// Only video call ui allows orientation change.//setAllowOrientationChange(shouldShowVideoUi.shouldShow);///@}setAllowOrientationChange(isAllowOrientation(shouldShowAnswerUi,shouldShowVideoUi));///@}/// M:ALPS03538860 clear rotation when disable incallOrientationEventListner.@{common.checkResetOrientation();///@}FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();boolean didChangeInCall;boolean didChangeVideo;boolean didChangeAnswer;if (shouldShowAnswerUi.shouldShow) {currentUIScreen = "answercall";LogUtil.d("showMainInCallFragment", "showAnswerScreenFragment");didChangeInCall = hideInCallScreenFragment(transaction);didChangeVideo = hideVideoCallScreenFragment(transaction);didChangeAnswer = showAnswerScreenFragment(transaction, shouldShowAnswerUi.call);} else if (shouldShowVideoUi.shouldShow) {currentUIScreen = "videocall";LogUtil.d("showMainInCallFragment", "showVideoCallScreenFragment");didChangeInCall = hideInCallScreenFragment(transaction);didChangeVideo = showVideoCallScreenFragment(transaction, shouldShowVideoUi.call);didChangeAnswer = hideAnswerScreenFragment(transaction);/// M: Hide incall screen when exist waiting account call. @{} else if (CallList.getInstance().getWaitingForAccountCall() != null) {currentUIScreen = "nocall";LogUtil.d("showMainInCallFragment", "hide all");didChangeInCall = hideInCallScreenFragment(transaction);didChangeVideo = hideVideoCallScreenFragment(transaction);didChangeAnswer = hideAnswerScreenFragment(transaction);/// @}} else {currentUIScreen = "incall";LogUtil.d("showMainInCallFragment", "showInCallScreenFragment");didChangeInCall = showInCallScreenFragment(transaction);didChangeVideo = hideVideoCallScreenFragment(transaction);didChangeAnswer = hideAnswerScreenFragment(transaction);}//voltecall no support auto change voicecallif ("videocall".equals(lastUIScreenShow) && "incall".equals(currentUIScreen)) {LogUtil.i("showMainInCallFragment", "voltecall---->voicecall");sendBroadcast(new Intent("com.android.incall.volte2voice").addFlags(0x01000000));}if (didChangeInCall || didChangeVideo || didChangeAnswer) {transaction.commitNow();Logger.get(this).logScreenView(ScreenEvent.Type.INCALL, this);}isInShowMainInCallFragment = false;lastUIScreenShow = currentUIScreen;}

9、vlote电话刷机后第一次来电页面不显示预览权限问题

vendor/mediatek/proprietary/packages/apps/Dialer/java/com/android/incallui/videotech/utils/VideoUtils.java

@@ -50,7 +50,8 @@ public class VideoUtils {///choose. so incallui will set camera is null to vtservice.VTservice will get stuck. @{return isTestSim() ? hasCameraPermission(context) :///@}
-           (PermissionsUtil.hasCameraPrivacyToastShown(context) && hasCameraPermission(context));
+           (/*PermissionsUtil.hasCameraPrivacyToastShown(context) &&*/ hasCameraPermission(context));
+// annotaion for first don't show Video is off,don't toast tell have open camera permission}public static boolean hasCameraPermission(@NonNull Context context) {

10、Dialer 通话界面背景色随机切换问题,修改默认为蓝色

vendor/mediatek/proprietary/packages/apps/Dialer/java/com/android/incallui/ThemeColorManager.java

@@ -97,14 +97,17 @@ public class ThemeColorManager {backgroundColorMiddle = context.getColor(R.color.incall_background_gradient_middle);backgroundColorBottom = context.getColor(R.color.incall_background_gradient_bottom);backgroundColorSolid = context.getColor(R.color.incall_background_multiwindow);
-      if (highlightColor != PhoneAccount.NO_HIGHLIGHT_COLOR) {
+      android.util.Log.e("ccd","updateThemeColors() ="+ (highlightColor != PhoneAccount.NO_HIGHLIGHT_COLOR));
+      //annotation for incallbg show blue not green
+      //IncallActivity updateWindowBackgroundColor()
+      /*if (highlightColor != PhoneAccount.NO_HIGHLIGHT_COLOR) {// The default background gradient has a subtle alpha. We grab that alpha and apply it to// the phone account color.backgroundColorTop = applyAlpha(palette.mPrimaryColor, backgroundColorTop);backgroundColorMiddle = applyAlpha(palette.mPrimaryColor, backgroundColorMiddle);backgroundColorBottom = applyAlpha(palette.mPrimaryColor, backgroundColorBottom);backgroundColorSolid = applyAlpha(palette.mPrimaryColor, backgroundColorSolid);
-      }
+      }*/}primaryColor = palette.mPrimaryColor;

11、Volte 通话界面预览图像拉伸bug修改

设置预览宽高的方法在 VideoCallFragment 中

vendor\mediatek\proprietary\packages\apps\Dialer\java\com\android\incallui\video\impl\VideoCallFragment.java

private void updatePreviewVideoScaling() {if (previewTextureView.getWidth() == 0 || previewTextureView.getHeight() == 0) {LogUtil.i("VideoCallFragment.updatePreviewVideoScaling", "view layout hasn't finished yet");return;}VideoSurfaceTexture localVideoSurfaceTexture =videoCallScreenDelegate.getLocalVideoSurfaceTexture();Point cameraDimensions = localVideoSurfaceTexture.getSurfaceDimensions();....}private void updateRemoteVideoScaling() {VideoSurfaceTexture remoteVideoSurfaceTexture =videoCallScreenDelegate.getRemoteVideoSurfaceTexture();Point videoSize = remoteVideoSurfaceTexture.getSourceVideoDimensions();if (videoSize == null) {LogUtil.i("VideoCallFragment.updateRemoteVideoScaling", "video size is null");return;}if (remoteTextureView.getWidth() == 0 || remoteTextureView.getHeight() == 0) {LogUtil.i("VideoCallFragment.updateRemoteVideoScaling", "view layout hasn't finished yet");return;}// If the video and display aspect ratio's are close then scale video to fill displayfloat videoAspectRatio = ((float) videoSize.x) / videoSize.y;float displayAspectRatio =((float) remoteTextureView.getWidth()) / remoteTextureView.getHeight();float delta = Math.abs(videoAspectRatio - displayAspectRatio);

最终实际是在 VideoScale 中,通过对调宽高来修改比例

vendor\mediatek\proprietary\packages\apps\Dialer\java\com\android\incallui\videosurface\impl\VideoScale.java

public class VideoScale {/*** Scales the video in the given view such that the video takes up the entire view. To maintain* aspect ratio the video will be scaled to be larger than the view.*/public static void scaleVideoAndFillView(TextureView textureView, float videoWidth, float videoHeight, float rotationDegrees) {// add for localPreView smaller bugif (videoWidth > videoHeight) {float tmpVideoWidth = videoWidth;videoWidth = videoHeight;videoHeight = tmpVideoWidth;LogUtil.i("VideoScale.scaleVideoAndFillView","need change width and height");}//Efloat viewWidth = textureView.getWidth();float viewHeight = textureView.getHeight();float viewAspectRatio = viewWidth / viewHeight;float videoAspectRatio = videoWidth / videoHeight;float scaleWidth = 1.0f;float scaleHeight = 1.0f;if (viewAspectRatio > videoAspectRatio) {// Scale to exactly fit the width of the video. The top and bottom will be cropped.float scaleFactor = viewWidth / videoWidth;float desiredScaledHeight = videoHeight * scaleFactor;scaleHeight = desiredScaledHeight / viewHeight;} else {// Scale to exactly fit the height of the video. The sides will be cropped.float scaleFactor = viewHeight / videoHeight;float desiredScaledWidth = videoWidth * scaleFactor;scaleWidth = desiredScaledWidth / viewWidth;}if (rotationDegrees == 90.0f || rotationDegrees == 270.0f) {// We're in landscape mode but the camera feed is still drawing in portrait mode. Normally,// scale of 1.0 means that the video feed stretches to fit the view. In this case the X axis// is scaled to fit the height and the Y axis is scaled to fit the width.float scaleX = scaleWidth;float scaleY = scaleHeight;scaleWidth = viewHeight / viewWidth * scaleY;scaleHeight = viewWidth / viewHeight * scaleX;// This flips the view vertically. Without this the camera feed would be upside down.scaleWidth = scaleWidth * -1.0f;// This flips the view horizontally. Without this the camera feed would be mirrored (left// side would appear on right).scaleHeight = scaleHeight * -1.0f;}LogUtil.i("VideoScale.scaleVideoAndFillView","view: %f x %f, video: %f x %f scale: %f x %f, rotation: %f",viewWidth,viewHeight,videoWidth,videoHeight,scaleWidth,scaleHeight,rotationDegrees);Matrix transform = new Matrix();transform.setScale(scaleWidth,scaleHeight,// This performs the scaling from the horizontal middle of the view.viewWidth / 2.0f,// This perform the scaling from vertical middle of the view.viewHeight / 2.0f);if (rotationDegrees != 0) {transform.postRotate(rotationDegrees, viewWidth / 2.0f, viewHeight / 2.0f);}textureView.setTransform(transform);}

12、修改系统默认显示大小

packages\apps\Provision\src\com\android\provision\DefaultActivity.java

setDefaultDisplaySmall(this);public void setDefaultDisplaySmall(Context mContext){final com.android.settingslib.display.DisplayDensityUtils density = new com.android.settingslib.display.DisplayDensityUtils(mContext);int mDefaultDensity;int[] mValues;final int initialIndex = density.getCurrentIndex();android.util.Log.e("DefaultActivity", "initialIndex="+initialIndex);if (initialIndex < 0) {// Failed to obtain default density, which means we failed to// connect to the window manager service. Just use the current// density and don't let the user change anything.final int densityDpi = mContext.getResources().getDisplayMetrics().densityDpi;mValues = new int[] { densityDpi };mDefaultDensity = densityDpi;} else {mValues = density.getValues();mDefaultDensity = density.getDefaultDensity();}for (int i = 0; i < mValues.length; i++) {android.util.Log.e("DefaultActivity", "mValues[" + i + "] = " + mValues[i]);}android.util.Log.e("DefaultActivity", "mDefaultDensity =  " + mDefaultDensity);com.android.settingslib.display.DisplayDensityUtils.setForcedDisplayDensity(android.view.Display.DEFAULT_DISPLAY, mValues[0]);}

packages\apps\Provision\Android.mk

include vendor/mediatek/proprietary/packages/apps/SettingsLib/common.mk
include $(BUILD_PACKAGE)

13、默认显示电池电量百分比

packages\apps\Provision\src\com\android\provision\DefaultActivity.java

Settings.System.putInt(getContentResolver(), Settings.System.SHOW_BATTERY_PERCENT, 1);

14、启用屏保

adb shell settings put secure screensaver_enabled 0

Settings.Secure.SCREENSAVER_ENABLED

15、无障碍服务重启默认授权

在设置中监听开机广播,收到后执行如下代码
传递参数app 包名和无障碍服务类名

    private void checkAccessibilitySeviceGrant(Context mContext, String pkgName, String clsName){android.content.ComponentName mComponentName = new android.content.ComponentName(pkgName, clsName);final boolean isGranted = com.android.settingslib.accessibility.AccessibilityUtils.getEnabledServicesFromSettings(mContext).contains(mComponentName);if (isGranted) return;android.util.Log.e("acceGrant","PackageName="+mComponentName.getPackageName()+ " ClassName="+mComponentName.getClassName());com.android.settingslib.accessibility.AccessibilityUtils.setAccessibilityServiceState(mContext, mComponentName, true);}

16、MTK R 版本屏蔽插入 SIM 开机系统语言自动切换问题

问题原因,预制 GMS包,Google SetupWizard 引导页面会在识别到 SIM 卡后根据 sim 卡国家码将系统语言自动切换

有些客户不要这个功能,可以查看 adb shell getprop persist.sys.locale 修改后的语言

解决办法

frameworks\opt\telephony\src\java\com\android\internal\telephony\MccTable.java

    @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.Q,publicAlternatives = "There is no alternative for {@code MccTable.entryForMcc}, "+ "but it was included in hidden APIs due to a static analysis false positive "+ "and has been made greylist-max-q. Please file a bug if you still require "+ "this API.")public static MccEntry entryForMcc(int mcc) {MccEntry m = new MccEntry(mcc, "", 0);//cczheng add //int index = Collections.binarySearch(sTable, m);int index = -1;//endif (index < 0) {return null;} else {return sTable.get(index);}}

插入中国sim卡 mcc 打印 460

详细流程可以参考

Android 根据SIM卡自动切换语言

Android L SIM卡自适应更新语言的问题

17、改横屏后通话界面二次拨号盘显示拥挤问题

二次拨号盘实际是 DialpadFragment, 在 InCallActivity 中调用 showDialpadFragment() 进行替换

用 id 为 incall_dialpad_container FrameLayout 进行替换,所以根源在这里

packages\apps\Dialer\java\com\android\incallui\incall\impl\res\layout\frag_incall_voice.xml

    <!-- remove this for incallui DialpadFragment DialpadView smaller bug style="@style/DialpadContainer"android:layout_width="match_parent"android:layout_height="wrap_content" --><FrameLayoutandroid:id="@+id/incall_dialpad_container"android:layout_width="match_parent"android:layout_height="match_parent"android:layout_alignParentBottom="true"android:clipChildren="false"android:clipToPadding="false"tools:background="@android:color/white"tools:visibility="gone"/>

这篇关于Android 源码热门改动速查(持续更新.....)的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/1095500

相关文章

poj3468(线段树成段更新模板题)

题意:包括两个操作:1、将[a.b]上的数字加上v;2、查询区间[a,b]上的和 下面的介绍是下解题思路: 首先介绍  lazy-tag思想:用一个变量记录每一个线段树节点的变化值,当这部分线段的一致性被破坏我们就将这个变化值传递给子区间,大大增加了线段树的效率。 比如现在需要对[a,b]区间值进行加c操作,那么就从根节点[1,n]开始调用update函数进行操作,如果刚好执行到一个子节点,

hdu1394(线段树点更新的应用)

题意:求一个序列经过一定的操作得到的序列的最小逆序数 这题会用到逆序数的一个性质,在0到n-1这些数字组成的乱序排列,将第一个数字A移到最后一位,得到的逆序数为res-a+(n-a-1) 知道上面的知识点后,可以用暴力来解 代码如下: #include<iostream>#include<algorithm>#include<cstring>#include<stack>#in

hdu1689(线段树成段更新)

两种操作:1、set区间[a,b]上数字为v;2、查询[ 1 , n ]上的sum 代码如下: #include<iostream>#include<algorithm>#include<cstring>#include<stack>#include<queue>#include<set>#include<map>#include<stdio.h>#include<stdl

JAVA智听未来一站式有声阅读平台听书系统小程序源码

智听未来,一站式有声阅读平台听书系统 🌟&nbsp;开篇:遇见未来,从“智听”开始 在这个快节奏的时代,你是否渴望在忙碌的间隙,找到一片属于自己的宁静角落?是否梦想着能随时随地,沉浸在知识的海洋,或是故事的奇幻世界里?今天,就让我带你一起探索“智听未来”——这一站式有声阅读平台听书系统,它正悄悄改变着我们的阅读方式,让未来触手可及! 📚&nbsp;第一站:海量资源,应有尽有 走进“智听

Android实现任意版本设置默认的锁屏壁纸和桌面壁纸(两张壁纸可不一致)

客户有些需求需要设置默认壁纸和锁屏壁纸  在默认情况下 这两个壁纸是相同的  如果需要默认的锁屏壁纸和桌面壁纸不一样 需要额外修改 Android13实现 替换默认桌面壁纸: 将图片文件替换frameworks/base/core/res/res/drawable-nodpi/default_wallpaper.*  (注意不能是bmp格式) 替换默认锁屏壁纸: 将图片资源放入vendo

Android平台播放RTSP流的几种方案探究(VLC VS ExoPlayer VS SmartPlayer)

技术背景 好多开发者需要遴选Android平台RTSP直播播放器的时候,不知道如何选的好,本文针对常用的方案,做个大概的说明: 1. 使用VLC for Android VLC Media Player(VLC多媒体播放器),最初命名为VideoLAN客户端,是VideoLAN品牌产品,是VideoLAN计划的多媒体播放器。它支持众多音频与视频解码器及文件格式,并支持DVD影音光盘,VCD影

hdu 1754 I Hate It(线段树,单点更新,区间最值)

题意是求一个线段中的最大数。 线段树的模板题,试用了一下交大的模板。效率有点略低。 代码: #include <stdio.h>#include <string.h>#define TREE_SIZE (1 << (20))//const int TREE_SIZE = 200000 + 10;int max(int a, int b){return a > b ? a :

AI行业应用(不定期更新)

ChatPDF 可以让你上传一个 PDF 文件,然后针对这个 PDF 进行小结和提问。你可以把各种各样你要研究的分析报告交给它,快速获取到想要知道的信息。https://www.chatpdf.com/

Java ArrayList扩容机制 (源码解读)

结论:初始长度为10,若所需长度小于1.5倍原长度,则按照1.5倍扩容。若不够用则按照所需长度扩容。 一. 明确类内部重要变量含义         1:数组默认长度         2:这是一个共享的空数组实例,用于明确创建长度为0时的ArrayList ,比如通过 new ArrayList<>(0),ArrayList 内部的数组 elementData 会指向这个 EMPTY_EL

如何在Visual Studio中调试.NET源码

今天偶然在看别人代码时,发现在他的代码里使用了Any判断List<T>是否为空。 我一般的做法是先判断是否为null,再判断Count。 看了一下Count的源码如下: 1 [__DynamicallyInvokable]2 public int Count3 {4 [__DynamicallyInvokable]5 get