Android中PackageManager学习笔记(2)-PackageInfo

PackageInfo

 

我们通过下面的方法获得PackageInfo对象信息:

 

getInstalledPackages(int flags)

 

参数flags有如下的值:

 

  • GET_ACTIVITIES :值为1.如果想获得所有标签的信息,需要传入这个值.然后通过PackageInfo.
  • GET_GIDS:值为256.获得group id的信息.
  • GET_CONFIGURATIONS:值16384.获得标签和标签的信息.
  • GET_INSTRUMENTATION:值16.获得标签的信息
  • GET_PERMISSIONS:值4096.获得标签的信息.
  • GET_PROVIDERS:值8.获得标签的信息
  • GET_RECEIVERS:值2.获得标签的信息
  • GET_SERVICES:值4.获得标签的信息
  • GET_SIGNATURES:值64.获得认证的信息.
  • GET_UNINSTALLED_PACKAGES:值8192.如果有没安装的apk,一起获得包信息。

 
  

 

我想应该是你传入相应的参数值,才能得到相应的信息。我们先把代码贴上:

 

                  List list2 = packageManager.getInstalledPackages(0);
		if (list2.size() != 0) {
			for (PackageInfo info : list2) {
				// 标签下的所有activity标签
				ActivityInfo[] activities = info.activities;
				if (activities != null && activities.length != 0) {
					for (int i = 0; i < activities.length; i++) {
						Log.i(TAG, "activities:" + i + "=" + activities[i]);
					}
				}
				ProviderInfo[] providers = info.providers;
				if (providers != null && providers.length != 0) {
					for (int i = 0; i < providers.length; i++) {
						Log.i(TAG, "providers:" + i + "=" + providers[i]);
					}
				}
				PermissionInfo[] permissions = info.permissions;
				if (permissions != null && permissions.length != 0) {
					for (int i = 0; i < permissions.length; i++) {
						Log.i(TAG, "permissions:" + i + "=" + permissions[i]);
					}
				}
				
				FeatureInfo[] reqFeatures = info.reqFeatures;
				if (reqFeatures != null && reqFeatures.length != 0) {
					for (int i = 0; i < reqFeatures.length; i++) {
						Log.i(TAG, "reqFeatures:" + i + "=" + reqFeatures[i]);
					}
				}
				ConfigurationInfo[] configs = info.configPreferences;
				if (configs != null && configs.length != 0) {
					for (int i = 0; i < configs.length; i++) {
						Log.i(TAG, "configs:" + i + "=" + configs[i]);
					}
				}
				
				ActivityInfo[] receivers = info.receivers;
				if (receivers != null && receivers.length != 0) {
					for (int i = 0; i < receivers.length; i++) {
						Log.i(TAG, "receivers:" + i + "=" + receivers[i]);
					}
				}
				InstrumentationInfo[] instrumentations = info.instrumentation;
				if (instrumentations != null && instrumentations.length != 0) {
					for (int i = 0; i < instrumentations.length; i++) {
						Log.i(TAG, "instrumentations:" + i + "=" + instrumentations[i]);
					}
				}
				String[] requestedPermissions = info.requestedPermissions;
				if (requestedPermissions != null && requestedPermissions.length != 0) {
					for (int i = 0; i < requestedPermissions.length; i++) {
						Log.i(TAG, "requestedPermissions:" + i + "=" + requestedPermissions[i]);
					}
				}
				ServiceInfo[] services = info.services;
				if (services != null && services.length != 0) {
					for (int i = 0; i < services.length; i++) {
						Log.i(TAG, "services:" + i + "=" + services[i]);
					}
				}
				Signature[] signatures = info.signatures;
				if (signatures != null && signatures.length != 0) {
					for (int i = 0; i < signatures.length; i++) {
						Log.i(TAG, "signatures:" + i + "=" + signatures[i]);
					}
				}
				
                                     int[] gids = info.gids;
                                     if(gids!=null&&gids.length!=0){
                                              for (int i = 0; i < gids.length; i++) {
                                                        Log.i(TAG, "gids:" + i + "=" + gids[i]);
                                              }
                                     }									
				int versionCode = info.versionCode;
				Log.i(TAG, "versionCode: "+versionCode);
				String versionName = info.versionName;
				Log.i(TAG, "versionName: "+versionName);
				Log.i(TAG, "===================================");
			}
		}


然后我们分别传参,查看输出信息.

 

标签

 

flags = 1.

 

getInstalledPackages(1);

 

Log信息:

 

03-29 09:33:59.681: I/MainActivity(2368): activities:0=ActivityInfo{4219e6b0 com.android.deskclock.DeskClock}
03-29 09:33:59.681: I/MainActivity(2368): activities:1=ActivityInfo{4219ec58 com.android.deskclock.SettingsActivity}
03-29 09:33:59.681: I/MainActivity(2368): activities:2=ActivityInfo{4219f1a8 com.android.deskclock.worldclock.CitiesActivity}
03-29 09:33:59.681: I/MainActivity(2368): activities:3=ActivityInfo{4219f710 com.android.deskclock.alarms.AlarmActivity}
03-29 09:33:59.681: I/MainActivity(2368): activities:4=ActivityInfo{4219fc68 com.android.deskclock.ScreensaverActivity}
03-29 09:33:59.681: I/MainActivity(2368): activities:5=ActivityInfo{421a01c0 com.android.deskclock.HandleApiCalls}
03-29 09:33:59.681: I/MainActivity(2368): activities:6=ActivityInfo{421a07f0 com.android.deskclock.HandleSetAlarm}
03-29 09:33:59.681: I/MainActivity(2368): activities:7=ActivityInfo{421a0e20 com.android.deskclock.ScreensaverSettingsActivity}
03-29 09:33:59.681: I/MainActivity(2368): activities:8=ActivityInfo{421a1388 com.android.deskclock.timer.TimerAlertFullScreen}
03-29 09:33:59.681: I/MainActivity(2368): activities:9=ActivityInfo{421a18f0 com.sprd.alarm.AlarmActivity}
03-29 09:33:59.681: I/MainActivity(2368): activities:10=ActivityInfo{421a1e30 com.sprd.worldclock.CityChooserActivity}
03-29 09:33:59.681: I/MainActivity(2368): activities:11=ActivityInfo{421a23e8 com.sprd.worldclock.DeleteCity}
03-29 09:33:59.681: I/MainActivity(2368): activities:12=ActivityInfo{421a2928 com.sprd.worldclock.WCReorderActivity}
03-29 09:33:59.681: I/MainActivity(2368): activities:13=ActivityInfo{421a2e78 com.sprd.timer.TimerAlertActivity}
03-29 09:33:59.681: I/MainActivity(2368): versionCode: 301
03-29 09:33:59.681: I/MainActivity(2368): versionName: 3.0.0
03-29 09:33:59.681: I/MainActivity(2368): ===================================
03-29 09:33:59.681: I/MainActivity(2368): versionCode: 19
03-29 09:33:59.681: I/MainActivity(2368): versionName: 4.4.2-W14.12.2-02
03-29 09:33:59.681: I/MainActivity(2368): ===================================
03-29 09:33:59.681: I/MainActivity(2368): activities:0=ActivityInfo{421a3e60 com.android.shell.BugreportWarningActivity}
03-29 09:33:59.681: I/MainActivity(2368): versionCode: 19
03-29 09:33:59.681: I/MainActivity(2368): versionName: 4.4.2-W14.12.2-02
03-29 09:33:59.681: I/MainActivity(2368): ===================================
03-29 09:33:59.681: I/MainActivity(2368): activities:0=ActivityInfo{421a48e8 com.android.stk1.StkMenuActivity}
03-29 09:33:59.681: I/MainActivity(2368): activities:1=ActivityInfo{421a4e38 com.android.stk1.StkInputActivity}
03-29 09:33:59.681: I/MainActivity(2368): activities:2=ActivityInfo{421a5388 com.android.stk1.StkDialogActivity}
03-29 09:33:59.681: I/MainActivity(2368): activities:3=ActivityInfo{421a58d8 com.android.stk1.ToneDialog}
03-29 09:33:59.681: I/MainActivity(2368): activities:4=ActivityInfo{421a5e20 com.android.stk1.StkMessageActivity}
03-29 09:33:59.681: I/MainActivity(2368): versionCode: 19
03-29 09:33:59.681: I/MainActivity(2368): versionName: 4.4.2-W14.12.2-02
03-29 09:33:59.681: I/MainActivity(2368): ===================================


只得到activity、versionCode、versionName属性的值。

 

标签

 

flags=4.

 

getInstalledPackages(4)

 

Log输出:

 

03-29 09:38:18.921: I/MainActivity(2534): services:0=ServiceInfo{41f8ca40 com.android.deskclock.alarms.AlarmService}
03-29 09:38:18.921: I/MainActivity(2534): services:1=ServiceInfo{41f8cf78 com.android.alarmclock.DigitalAppWidgetService}
03-29 09:38:18.921: I/MainActivity(2534): services:2=ServiceInfo{41f8d538 com.android.deskclock.Screensaver}
03-29 09:38:18.921: I/MainActivity(2534): services:3=ServiceInfo{41f8da60 com.android.deskclock.TimerRingService}
03-29 09:38:18.931: I/MainActivity(2534): services:4=ServiceInfo{41f8df90 com.android.deskclock.stopwatch.StopwatchService}
03-29 09:38:18.931: I/MainActivity(2534): services:5=ServiceInfo{41f8e4d8 com.sprd.timer.TimerAlertService}
03-29 09:38:18.931: I/MainActivity(2534): versionCode: 301
03-29 09:38:18.931: I/MainActivity(2534): versionName: 3.0.0
03-29 09:38:18.931: I/MainActivity(2534): ===================================
03-29 09:38:18.931: I/MainActivity(2534): services:0=ServiceInfo{41f8ef40 com.android.keyguard.KeyguardService}
03-29 09:38:18.931: I/MainActivity(2534): versionCode: 19
03-29 09:38:18.931: I/MainActivity(2534): versionName: 4.4.2-W14.12.2-02
03-29 09:38:18.931: I/MainActivity(2534): ===================================
03-29 09:38:18.931: I/MainActivity(2534): versionCode: 19
03-29 09:38:18.931: I/MainActivity(2534): versionName: 4.4.2-W14.12.2-02
03-29 09:38:18.931: I/MainActivity(2534): ===================================
03-29 09:38:18.931: I/MainActivity(2534): services:0=ServiceInfo{41f8fe60 com.android.stk1.StkAppService}
03-29 09:38:18.931: I/MainActivity(2534): versionCode: 19
03-29 09:38:18.931: I/MainActivity(2534): versionName: 4.4.2-W14.12.2-02
03-29 09:38:18.931: I/MainActivity(2534): ===================================


只得到service、versionCode、versionName的值。

 

标签

 

flags=2.

 

getInstalledPackages(2)

 

Log输出:

 

03-29 09:41:21.031: I/MainActivity(2678): receivers:0=ActivityInfo{41f8dbe8 com.android.deskclock.alarms.AlarmStateManager}
03-29 09:41:21.031: I/MainActivity(2678): receivers:1=ActivityInfo{41f8e1a8 com.android.deskclock.AlarmInitReceiver}
03-29 09:41:21.031: I/MainActivity(2678): receivers:2=ActivityInfo{41f8e760 com.android.alarmclock.AnalogAppWidgetProvider}
03-29 09:41:21.031: I/MainActivity(2678): receivers:3=ActivityInfo{41f8ed20 com.android.alarmclock.DigitalAppWidgetProvider}
03-29 09:41:21.031: I/MainActivity(2678): receivers:4=ActivityInfo{41f8f2e8 com.android.alarmclock.DigitalWidgetViewsFactory}
03-29 09:41:21.031: I/MainActivity(2678): receivers:5=ActivityInfo{41f8f8b0 com.android.deskclock.timer.TimerReceiver}
03-29 09:41:21.031: I/MainActivity(2678): receivers:6=ActivityInfo{41f8fe68 com.sprd.timer.TimerReceiver}
03-29 09:41:21.031: I/MainActivity(2678): receivers:7=ActivityInfo{41f90408 com.sprd.alarmwidget.SpreadAnalogAppWidgetProvider}
03-29 09:41:21.031: I/MainActivity(2678): receivers:8=ActivityInfo{41f909d0 com.sprd.alarmwidget.SpreadAnalogAppWidgetProvider2}
03-29 09:41:21.041: I/MainActivity(2678): versionCode: 301
03-29 09:41:21.041: I/MainActivity(2678): versionName: 3.0.0
03-29 09:41:21.041: I/MainActivity(2678): ===================================


只得到receiver、versionCode、versionName的值。

 

标签

 

flags=8.

 

getInstalledPackages(8)

 

Log输出:

 

03-29 09:43:58.261: I/MainActivity(2809): providers:0=ContentProviderInfo{name=contacts;com.android.contacts className=com.android.providers.contacts.ContactsProvider2}
03-29 09:43:58.261: I/MainActivity(2809): providers:1=ContentProviderInfo{name=call_log className=com.android.providers.contacts.CallLogProvider}
03-29 09:43:58.261: I/MainActivity(2809): providers:2=ContentProviderInfo{name=com.android.voicemail className=com.android.providers.contacts.VoicemailContentProvider}
03-29 09:43:58.261: I/MainActivity(2809): providers:3=ContentProviderInfo{name=gecode_location className=com.sprd.providers.geocode.GeocodeProvider}
03-29 09:43:58.261: I/MainActivity(2809): providers:4=ContentProviderInfo{name=com.android.contacts.dumpfile className=com.android.providers.contacts.debug.DumpFileProvider}
03-29 09:43:58.261: I/MainActivity(2809): versionCode: 19
03-29 09:43:58.261: I/MainActivity(2809): versionName: 4.4.2-W14.12.2-02
03-29 09:43:58.261: I/MainActivity(2809): ===================================


只得到provider、versionCode、versionName的值。

 

标签

 

flags=4096.

 

getInstalledPackages(4096)

 

Log输出:

 

03-29 09:46:43.571: I/MainActivity(2973): permissions:0=PermissionInfo{41f633c0 com.android.email.permission.READ_ATTACHMENT}
03-29 09:46:43.571: I/MainActivity(2973): permissions:1=PermissionInfo{41f63560 com.android.email.permission.ACCESS_PROVIDER}
03-29 09:46:43.571: I/MainActivity(2973): requestedPermissions:0=android.permission.RECEIVE_BOOT_COMPLETED
03-29 09:46:43.571: I/MainActivity(2973): requestedPermissions:1=android.permission.ACCESS_NETWORK_STATE
03-29 09:46:43.571: I/MainActivity(2973): requestedPermissions:2=android.permission.INTERNET
03-29 09:46:43.571: I/MainActivity(2973): requestedPermissions:3=android.permission.VIBRATE
03-29 09:46:43.571: I/MainActivity(2973): requestedPermissions:4=android.permission.WRITE_EXTERNAL_STORAGE
03-29 09:46:43.571: I/MainActivity(2973): requestedPermissions:5=android.permission.GET_ACCOUNTS
03-29 09:46:43.571: I/MainActivity(2973): requestedPermissions:6=android.permission.MANAGE_ACCOUNTS
03-29 09:46:43.571: I/MainActivity(2973): requestedPermissions:7=android.permission.AUTHENTICATE_ACCOUNTS
03-29 09:46:43.571: I/MainActivity(2973): requestedPermissions:8=android.permission.READ_SYNC_SETTINGS
03-29 09:46:43.571: I/MainActivity(2973): requestedPermissions:9=android.permission.WRITE_SYNC_SETTINGS
03-29 09:46:43.571: I/MainActivity(2973): requestedPermissions:10=android.permission.WRITE_CONTACTS
03-29 09:46:43.571: I/MainActivity(2973): requestedPermissions:11=android.permission.READ_CONTACTS
03-29 09:46:43.571: I/MainActivity(2973): requestedPermissions:12=android.permission.READ_CALENDAR
03-29 09:46:43.571: I/MainActivity(2973): requestedPermissions:13=android.permission.WRITE_CALENDAR
03-29 09:46:43.571: I/MainActivity(2973): requestedPermissions:14=android.permission.READ_PROFILE
03-29 09:46:43.571: I/MainActivity(2973): requestedPermissions:15=android.permission.NFC
03-29 09:46:43.571: I/MainActivity(2973): requestedPermissions:16=android.permission.WAKE_LOCK
03-29 09:46:43.571: I/MainActivity(2973): requestedPermissions:17=android.permission.READ_PHONE_STATE
03-29 09:46:43.571: I/MainActivity(2973): requestedPermissions:18=android.permission.DOWNLOAD_WITHOUT_NOTIFICATION
03-29 09:46:43.571: I/MainActivity(2973): requestedPermissions:19=com.android.email.permission.READ_ATTACHMENT
03-29 09:46:43.571: I/MainActivity(2973): requestedPermissions:20=android.permission.USE_CREDENTIALS
03-29 09:46:43.571: I/MainActivity(2973): requestedPermissions:21=com.android.email.permission.ACCESS_PROVIDER
03-29 09:46:43.571: I/MainActivity(2973): requestedPermissions:22=android.permission.READ_EXTERNAL_STORAGE
03-29 09:46:43.571: I/MainActivity(2973): versionCode: 500060
03-29 09:46:43.571: I/MainActivity(2973): versionName: 4.4.2-W14.12.2-02
03-29 09:46:43.571: I/MainActivity(2973): ===================================


只得到了requestedPermission、permission、versionCode、versionName的值。

 

标签

 

flags=16.

 

getInstalledPackages(16)

 

Log输出:

 

03-29 09:54:20.531: I/MainActivity(3178): versionCode: 19
03-29 09:54:20.531: I/MainActivity(3178): versionName: 4.4.2-W14.12.2-02
03-29 09:54:20.531: I/MainActivity(3178): ===================================


并没有得到我们所要,可能系统里的应用配置文件里没有这个标签,那我们安装一个自己写的应用里面带有.重新运行程序Log输出:

 

03-29 09:57:49.721: I/MainActivity(3178): instrumentations:0=InstrumentationInfo{41f53908 com.spreadtrum.broadcast}
03-29 09:57:49.731: I/MainActivity(3178): versionCode: 1
03-29 09:57:49.731: I/MainActivity(3178): versionName: 1.0
03-29 09:57:49.731: I/MainActivity(3178): ===================================


得到了instrumentation信息,说明系统应用里的没有这个标签。

 

标签&标签

 

flags=16384.

 

getInstalledPackages(16384)

 

Log输出:

 

03-29 10:04:34.251: I/MainActivity(3634): reqFeatures:0=FeatureInfo{41f5de00 glEsVers=2.0 fl=0x1}
03-29 10:04:34.251: I/MainActivity(3634): configs:0=ConfigurationInfo{41f5ddc8 touchscreen = 0 inputMethod = 0 navigation = 0 reqInputFeatures = 0 reqGlEsVersion = 131072}
03-29 10:04:34.251: I/MainActivity(3634): versionCode: 19
03-29 10:04:34.251: I/MainActivity(3634): versionName: 4.4.2-W14.12.2-02
03-29 10:04:34.251: I/MainActivity(3634): ===================================


只得到reqFeatures、configs、versionCode、versionName信息。

 

signature信息

 

flags=64.

 

getInstalledPackages(64)

 

Log输出:

 

03-29 10:13:49.041: I/MainActivity(3866): signatures:0=android.content.pm.Signature@b4addb29
03-29 10:13:49.041: I/MainActivity(3866): versionCode: 201
03-29 10:13:49.041: I/MainActivity(3866): versionName: 2.0.1
03-29 10:13:49.041: I/MainActivity(3866): ===================================
03-29 10:13:49.041: I/MainActivity(3866): signatures:0=android.content.pm.Signature@d7f1f224
03-29 10:13:49.041: I/MainActivity(3866): versionCode: 1
03-29 10:13:49.041: I/MainActivity(3866): versionName: 1.0
03-29 10:13:49.041: I/MainActivity(3866): ===================================
03-29 10:13:49.041: I/MainActivity(3866): signatures:0=android.content.pm.Signature@b4addb29
03-29 10:13:49.041: I/MainActivity(3866): versionCode: 1
03-29 10:13:49.041: I/MainActivity(3866): versionName: 1.0
03-29 10:13:49.041: I/MainActivity(3866): ===================================

 

PackageName

 

flags=8192.

 

flags=8192代表没有安装的包信息,说实在的我也不理解到底啥意思。那么我们分别传入64和8192的参数,看看对比!我们前面的程序都没有打印包名。所以我们把之前的程序for循环的代码块注释掉。加上下面的代码:

 

String packageName = info.packageName;
Log.i(TAG, "packageName: " + packageName);

 

传入64,Log信息:

 

03-29 10:19:08.011: I/MainActivity(4145): packageName: com.sprd.note
03-29 10:19:08.011: I/MainActivity(4145): ===================================
03-29 10:19:08.011: I/MainActivity(4145): packageName: com.android.defcontainer
03-29 10:19:08.011: I/MainActivity(4145): ===================================
03-29 10:19:08.011: I/MainActivity(4145): packageName: com.sprd.carddav_sync
03-29 10:19:08.011: I/MainActivity(4145): ===================================
03-29 10:19:08.011: I/MainActivity(4145): packageName: com.sohu.newsclient
03-29 10:19:08.011: I/MainActivity(4145): ===================================
03-29 10:19:08.011: I/MainActivity(4145): packageName: com.android.quicksearchbox
03-29 10:19:08.011: I/MainActivity(4145): ===================================
03-29 10:19:08.011: I/MainActivity(4145): packageName: com.spreadst.drag
03-29 10:19:08.011: I/MainActivity(4145): ===================================
03-29 10:19:08.011: I/MainActivity(4145): packageName: com.android.contacts
03-29 10:19:08.021: I/MainActivity(4145): ===================================
03-29 10:19:08.021: I/MainActivity(4145): packageName: com.android.phone
03-29 10:19:08.021: I/MainActivity(4145): ===================================
03-29 10:19:08.021: I/MainActivity(4145): packageName: com.sprd.monkeytest
03-29 10:19:08.021: I/MainActivity(4145): ===================================
03-29 10:19:08.021: I/MainActivity(4145): packageName: com.spreadtrum.broadcast
03-29 10:19:08.021: I/MainActivity(4145): ===================================
03-29 10:19:08.021: I/MainActivity(4145): packageName: com.android.calculator2
03-29 10:19:08.021: I/MainActivity(4145): ===================================
03-29 10:19:08.021: I/MainActivity(4145): packageName: com.android.htmlviewer
03-29 10:19:08.021: I/MainActivity(4145): ===================================
03-29 10:19:08.021: I/MainActivity(4145): packageName: com.chinaunicom.deviceregister
03-29 10:19:08.021: I/MainActivity(4145): ===================================
03-29 10:19:08.021: I/MainActivity(4145): packageName: com.android.cellbroadcastreceiver
03-29 10:19:08.021: I/MainActivity(4145): ===================================
03-29 10:19:08.031: I/MainActivity(4145): packageName: com.android.bluetooth
03-29 10:19:08.031: I/MainActivity(4145): ===================================
03-29 10:19:08.031: I/MainActivity(4145): packageName: com.android.providers.calendar
03-29 10:19:08.031: I/MainActivity(4145): ===================================
03-29 10:19:08.031: I/MainActivity(4145): packageName: com.sprd.engineermode
03-29 10:19:08.031: I/MainActivity(4145): ===================================
03-29 10:19:08.031: I/MainActivity(4145): packageName: cn.wps.moffice_eng
03-29 10:19:08.031: I/MainActivity(4145): ===================================
03-29 10:19:08.031: I/MainActivity(4145): packageName: com.android.calendar
03-29 10:19:08.031: I/MainActivity(4145): ===================================
03-29 10:19:08.031: I/MainActivity(4145): packageName: com.android.browser
03-29 10:19:08.031: I/MainActivity(4145): ===================================
03-29 10:19:08.041: I/MainActivity(4145): packageName: com.android.music
03-29 10:19:08.041: I/MainActivity(4145): ===================================
03-29 10:19:08.041: I/MainActivity(4145): packageName: com.sprd.caldav_sync
03-29 10:19:08.041: I/MainActivity(4145): ===================================
03-29 10:19:08.041: I/MainActivity(4145): packageName: com.sprd.security.manager.rdc
03-29 10:19:08.041: I/MainActivity(4145): ===================================
03-29 10:19:08.041: I/MainActivity(4145): packageName: com.android.onetimeinitializer
03-29 10:19:08.041: I/MainActivity(4145): ===================================
03-29 10:19:08.041: I/MainActivity(4145): packageName: com.android.launcher3
03-29 10:19:08.041: I/MainActivity(4145): ===================================
03-29 10:19:08.041: I/MainActivity(4145): packageName: com.android.providers.downloads.ui
03-29 10:19:08.041: I/MainActivity(4145): ===================================
03-29 10:19:08.041: I/MainActivity(4145): packageName: com.android.documentsui
03-29 10:19:08.041: I/MainActivity(4145): ===================================
03-29 10:19:08.041: I/MainActivity(4145): packageName: com.android.sharedstoragebackup
03-29 10:19:08.041: I/MainActivity(4145): ===================================
03-29 10:19:08.041: I/MainActivity(4145): packageName: com.android.camera2
03-29 10:19:08.041: I/MainActivity(4145): ===================================
03-29 10:19:08.041: I/MainActivity(4145): packageName: com.android.dialogs
03-29 10:19:08.041: I/MainActivity(4145): ===================================
03-29 10:19:08.041: I/MainActivity(4145): packageName: com.android.mms
03-29 10:19:08.041: I/MainActivity(4145): ===================================
03-29 10:19:08.041: I/MainActivity(4145): packageName: com.android.provision
03-29 10:19:08.041: I/MainActivity(4145): ===================================
03-29 10:19:08.041: I/MainActivity(4145): packageName: com.android.providers.media
03-29 10:19:08.041: I/MainActivity(4145): ===================================
03-29 10:19:08.041: I/MainActivity(4145): packageName: com.google.android.marvin.talkback
03-29 10:19:08.041: I/MainActivity(4145): ===================================
03-29 10:19:08.041: I/MainActivity(4145): packageName: com.android.certinstaller
03-29 10:19:08.051: I/MainActivity(4145): ===================================
03-29 10:19:08.051: I/MainActivity(4145): packageName: com.sprd.security.manager.asa
03-29 10:19:08.051: I/MainActivity(4145): ===================================
03-29 10:19:08.051: I/MainActivity(4145): packageName: com.infinit.wostore.ui
03-29 10:19:08.051: I/MainActivity(4145): ===================================
03-29 10:19:08.051: I/MainActivity(4145): packageName: com.android.dreams.phototable
03-29 10:19:08.051: I/MainActivity(4145): ===================================
03-29 10:19:08.051: I/MainActivity(4145): packageName: com.cucc.homepage
03-29 10:19:08.051: I/MainActivity(4145): ===================================
03-29 10:19:08.051: I/MainActivity(4145): packageName: com.android.settings
03-29 10:19:08.051: I/MainActivity(4145): ===================================
03-29 10:19:08.051: I/MainActivity(4145): packageName: com.sinovatech.unicom.ui
03-29 10:19:08.051: I/MainActivity(4145): ===================================
03-29 10:19:08.051: I/MainActivity(4145): packageName: com.spreadtrum.accessibilityservice
03-29 10:19:08.051: I/MainActivity(4145): ===================================
03-29 10:19:08.051: I/MainActivity(4145): packageName: com.sina.weibopro
03-29 10:19:08.051: I/MainActivity(4145): ===================================
03-29 10:19:08.051: I/MainActivity(4145): packageName: com.android.gallery3d
03-29 10:19:08.061: I/MainActivity(4145): ===================================
03-29 10:19:08.061: I/MainActivity(4145): packageName: com.android.providers.drm
03-29 10:19:08.061: I/MainActivity(4145): ===================================
03-29 10:19:08.061: I/MainActivity(4145): packageName: com.android.musicvis
03-29 10:19:08.061: I/MainActivity(4145): ===================================
03-29 10:19:08.061: I/MainActivity(4145): packageName: com.android.exchange
03-29 10:19:08.061: I/MainActivity(4145): ===================================
03-29 10:19:08.061: I/MainActivity(4145): packageName: com.android.wallpaper.livepicker
03-29 10:19:08.061: I/MainActivity(4145): ===================================
03-29 10:19:08.061: I/MainActivity(4145): packageName: com.android.resource.security
03-29 10:19:08.061: I/MainActivity(4145): ===================================
03-29 10:19:08.061: I/MainActivity(4145): packageName: com.android.packageinstaller
03-29 10:19:08.061: I/MainActivity(4145): ===================================
03-29 10:19:08.061: I/MainActivity(4145): packageName: com.sprd.videoswallpapers
03-29 10:19:08.061: I/MainActivity(4145): ===================================
03-29 10:19:08.061: I/MainActivity(4145): packageName: com.android.providers.telephony
03-29 10:19:08.061: I/MainActivity(4145): ===================================
03-29 10:19:08.061: I/MainActivity(4145): packageName: com.sprd.fileexplorer
03-29 10:19:08.061: I/MainActivity(4145): ===================================
03-29 10:19:08.061: I/MainActivity(4145): packageName: com.svox.pico
03-29 10:19:08.061: I/MainActivity(4145): ===================================
03-29 10:19:08.061: I/MainActivity(4145): packageName: com.android.noisefield
03-29 10:19:08.061: I/MainActivity(4145): ===================================
03-29 10:19:08.061: I/MainActivity(4145): packageName: com.android.email
03-29 10:19:08.061: I/MainActivity(4145): ===================================
03-29 10:19:08.061: I/MainActivity(4145): packageName: com.android.dialer
03-29 10:19:08.061: I/MainActivity(4145): ===================================
03-29 10:19:08.061: I/MainActivity(4145): packageName: com.android.modemassert
03-29 10:19:08.061: I/MainActivity(4145): ===================================
03-29 10:19:08.061: I/MainActivity(4145): packageName: com.baidu.BaiduMap
03-29 10:19:08.061: I/MainActivity(4145): ===================================
03-29 10:19:08.061: I/MainActivity(4145): packageName: com.sprd.audioprofile
03-29 10:19:08.061: I/MainActivity(4145): ===================================
03-29 10:19:08.071: I/MainActivity(4145): packageName: com.android.wallpapercropper
03-29 10:19:08.071: I/MainActivity(4145): ===================================
03-29 10:19:08.071: I/MainActivity(4145): packageName: com.android.location.fused
03-29 10:19:08.071: I/MainActivity(4145): ===================================
03-29 10:19:08.071: I/MainActivity(4145): packageName: com.android.backupconfirm
03-29 10:19:08.071: I/MainActivity(4145): ===================================
03-29 10:19:08.071: I/MainActivity(4145): packageName: com.android.magicsmoke
03-29 10:19:08.071: I/MainActivity(4145): ===================================
03-29 10:19:08.071: I/MainActivity(4145): packageName: com.android.providers.settings
03-29 10:19:08.071: I/MainActivity(4145): ===================================
03-29 10:19:08.071: I/MainActivity(4145): packageName: com.android.providers.downloads
03-29 10:19:08.071: I/MainActivity(4145): ===================================
03-29 10:19:08.071: I/MainActivity(4145): packageName: com.sprd.validationtools
03-29 10:19:08.071: I/MainActivity(4145): ===================================
03-29 10:19:08.071: I/MainActivity(4145): packageName: com.android.musicfx
03-29 10:19:08.071: I/MainActivity(4145): ===================================
03-29 10:19:08.071: I/MainActivity(4145): packageName: com.android.phasebeam
03-29 10:19:08.071: I/MainActivity(4145): ===================================
03-29 10:19:08.071: I/MainActivity(4145): packageName: com.ibm.packagemanager
03-29 10:19:08.071: I/MainActivity(4145): ===================================
03-29 10:19:08.071: I/MainActivity(4145): packageName: com.android.soundrecorder
03-29 10:19:08.071: I/MainActivity(4145): ===================================
03-29 10:19:08.071: I/MainActivity(4145): packageName: com.neusoft.td.android.wo116114
03-29 10:19:08.071: I/MainActivity(4145): ===================================
03-29 10:19:08.071: I/MainActivity(4145): packageName: com.android.inputmethod.latin
03-29 10:19:08.071: I/MainActivity(4145): ===================================
03-29 10:19:08.071: I/MainActivity(4145): packageName: com.android.proxyhandler
03-29 10:19:08.071: I/MainActivity(4145): ===================================
03-29 10:19:08.071: I/MainActivity(4145): packageName: com.sohu.inputmethod.sogou
03-29 10:19:08.071: I/MainActivity(4145): ===================================
03-29 10:19:08.071: I/MainActivity(4145): packageName: com.android.inputdevices
03-29 10:19:08.071: I/MainActivity(4145): ===================================
03-29 10:19:08.111: I/MainActivity(4145): packageName: com.android.wallpaper.holospiral
03-29 10:19:08.111: I/MainActivity(4145): ===================================
03-29 10:19:08.121: I/MainActivity(4145): packageName: com.baidu.appsearch
03-29 10:19:08.121: I/MainActivity(4145): ===================================
03-29 10:19:08.121: I/MainActivity(4145): packageName: com.android.stk
03-29 10:19:08.121: I/MainActivity(4145): ===================================
03-29 10:19:08.121: I/MainActivity(4145): packageName: com.android.providers.userdictionary
03-29 10:19:08.121: I/MainActivity(4145): ===================================
03-29 10:19:08.121: I/MainActivity(4145): packageName: com.android.inputmethod.pinyin
03-29 10:19:08.121: I/MainActivity(4145): ===================================
03-29 10:19:08.121: I/MainActivity(4145): packageName: com.android.pacprocessor
03-29 10:19:08.121: I/MainActivity(4145): ===================================
03-29 10:19:08.121: I/MainActivity(4145): packageName: com.thunderst.radio
03-29 10:19:08.121: I/MainActivity(4145): ===================================
03-29 10:19:08.131: I/MainActivity(4145): packageName: com.android.galaxy4
03-29 10:19:08.131: I/MainActivity(4145): ===================================
03-29 10:19:08.131: I/MainActivity(4145): packageName: com.ibm.activitymanager
03-29 10:19:08.131: I/MainActivity(4145): ===================================
03-29 10:19:08.131: I/MainActivity(4145): packageName: com.spreadst.s2lockscreen
03-29 10:19:08.131: I/MainActivity(4145): ===================================
03-29 10:19:08.131: I/MainActivity(4145): packageName: com.android.printspooler
03-29 10:19:08.131: I/MainActivity(4145): ===================================
03-29 10:19:08.131: I/MainActivity(4145): packageName: android
03-29 10:19:08.131: I/MainActivity(4145): ===================================
03-29 10:19:08.131: I/MainActivity(4145): packageName: com.android.providers.contacts
03-29 10:19:08.131: I/MainActivity(4145): ===================================
03-29 10:19:08.131: I/MainActivity(4145): packageName: com.asiainfo.android
03-29 10:19:08.131: I/MainActivity(4145): ===================================
03-29 10:19:08.131: I/MainActivity(4145): packageName: com.sprd.ramoptimizer
03-29 10:19:08.131: I/MainActivity(4145): ===================================
03-29 10:19:08.131: I/MainActivity(4145): packageName: com.android.externalstorage
03-29 10:19:08.131: I/MainActivity(4145): ===================================
03-29 10:19:08.131: I/MainActivity(4145): packageName: com.android.providers.applications
03-29 10:19:08.131: I/MainActivity(4145): ===================================
03-29 10:19:08.141: I/MainActivity(4145): packageName: com.mobiletools.systemhelper
03-29 10:19:08.141: I/MainActivity(4145): ===================================
03-29 10:19:08.141: I/MainActivity(4145): packageName: com.spreadst.thememanager
03-29 10:19:08.141: I/MainActivity(4145): ===================================
03-29 10:19:08.141: I/MainActivity(4145): packageName: com.android.dreams.basic
03-29 10:19:08.141: I/MainActivity(4145): ===================================
03-29 10:19:08.141: I/MainActivity(4145): packageName: com.android.systemui
03-29 10:19:08.141: I/MainActivity(4145): ===================================
03-29 10:19:08.141: I/MainActivity(4145): packageName: com.android.keychain
03-29 10:19:08.141: I/MainActivity(4145): ===================================
03-29 10:19:08.141: I/MainActivity(4145): packageName: com.spreadst.security.permission
03-29 10:19:08.141: I/MainActivity(4145): ===================================
03-29 10:19:08.141: I/MainActivity(4145): packageName: com.cucc.ireader
03-29 10:19:08.141: I/MainActivity(4145): ===================================
03-29 10:19:08.141: I/MainActivity(4145): packageName: com.sprd.practicaltools
03-29 10:19:08.141: I/MainActivity(4145): ===================================
03-29 10:19:08.141: I/MainActivity(4145): packageName: com.spreadst.lockscreen
03-29 10:19:08.141: I/MainActivity(4145): ===================================
03-29 10:19:08.141: I/MainActivity(4145): packageName: com.android.wallpaper
03-29 10:19:08.141: I/MainActivity(4145): ===================================
03-29 10:19:08.141: I/MainActivity(4145): packageName: com.android.deskclock
03-29 10:19:08.141: I/MainActivity(4145): ===================================
03-29 10:19:08.141: I/MainActivity(4145): packageName: com.android.keyguard
03-29 10:19:08.141: I/MainActivity(4145): ===================================
03-29 10:19:08.141: I/MainActivity(4145): packageName: com.android.shell
03-29 10:19:08.141: I/MainActivity(4145): ===================================
03-29 10:19:08.141: I/MainActivity(4145): packageName: com.android.stk1
03-29 10:19:08.141: I/MainActivity(4145): ===================================



传入8192,Log输出:

 

03-29 10:24:45.891: I/MainActivity(4322): packageName: com.sprd.note
03-29 10:24:45.891: I/MainActivity(4322): ===================================
03-29 10:24:45.901: I/MainActivity(4322): packageName: com.android.defcontainer
03-29 10:24:45.901: I/MainActivity(4322): ===================================
03-29 10:24:45.901: I/MainActivity(4322): packageName: com.sprd.carddav_sync
03-29 10:24:45.901: I/MainActivity(4322): ===================================
03-29 10:24:45.901: I/MainActivity(4322): packageName: com.sohu.newsclient
03-29 10:24:45.901: I/MainActivity(4322): ===================================
03-29 10:24:45.901: I/MainActivity(4322): packageName: com.android.quicksearchbox
03-29 10:24:45.901: I/MainActivity(4322): ===================================
03-29 10:24:45.901: I/MainActivity(4322): packageName: com.spreadst.drag
03-29 10:24:45.901: I/MainActivity(4322): ===================================
03-29 10:24:45.901: I/MainActivity(4322): packageName: com.android.contacts
03-29 10:24:45.901: I/MainActivity(4322): ===================================
03-29 10:24:45.901: I/MainActivity(4322): packageName: com.android.phone
03-29 10:24:45.901: I/MainActivity(4322): ===================================
03-29 10:24:45.901: I/MainActivity(4322): packageName: com.sprd.monkeytest
03-29 10:24:45.901: I/MainActivity(4322): ===================================
03-29 10:24:45.901: I/MainActivity(4322): packageName: com.spreadtrum.broadcast
03-29 10:24:45.901: I/MainActivity(4322): ===================================
03-29 10:24:45.901: I/MainActivity(4322): packageName: com.android.calculator2
03-29 10:24:45.911: I/MainActivity(4322): ===================================
03-29 10:24:45.911: I/MainActivity(4322): packageName: com.android.htmlviewer
03-29 10:24:45.911: I/MainActivity(4322): ===================================
03-29 10:24:45.911: I/MainActivity(4322): packageName: com.chinaunicom.deviceregister
03-29 10:24:45.911: I/MainActivity(4322): ===================================
03-29 10:24:45.911: I/MainActivity(4322): packageName: com.android.cellbroadcastreceiver
03-29 10:24:45.911: I/MainActivity(4322): ===================================
03-29 10:24:45.911: I/MainActivity(4322): packageName: com.android.bluetooth
03-29 10:24:45.911: I/MainActivity(4322): ===================================
03-29 10:24:45.911: I/MainActivity(4322): packageName: com.android.providers.calendar
03-29 10:24:45.911: I/MainActivity(4322): ===================================
03-29 10:24:45.911: I/MainActivity(4322): packageName: com.sprd.engineermode
03-29 10:24:45.911: I/MainActivity(4322): ===================================
03-29 10:24:45.911: I/MainActivity(4322): packageName: cn.wps.moffice_eng
03-29 10:24:45.911: I/MainActivity(4322): ===================================
03-29 10:24:45.911: I/MainActivity(4322): packageName: com.android.calendar
03-29 10:24:45.911: I/MainActivity(4322): ===================================
03-29 10:24:45.911: I/MainActivity(4322): packageName: com.android.browser
03-29 10:24:45.911: I/MainActivity(4322): ===================================
03-29 10:24:45.921: I/MainActivity(4322): packageName: com.android.music
03-29 10:24:45.921: I/MainActivity(4322): ===================================
03-29 10:24:45.921: I/MainActivity(4322): packageName: com.sprd.caldav_sync
03-29 10:24:45.921: I/MainActivity(4322): ===================================
03-29 10:24:45.921: I/MainActivity(4322): packageName: com.sprd.security.manager.rdc
03-29 10:24:45.921: I/MainActivity(4322): ===================================
03-29 10:24:45.921: I/MainActivity(4322): packageName: com.android.onetimeinitializer
03-29 10:24:45.921: I/MainActivity(4322): ===================================
03-29 10:24:45.921: I/MainActivity(4322): packageName: com.android.providers.downloads.ui
03-29 10:24:45.921: I/MainActivity(4322): ===================================
03-29 10:24:45.921: I/MainActivity(4322): packageName: com.android.launcher3
03-29 10:24:45.921: I/MainActivity(4322): ===================================
03-29 10:24:45.921: I/MainActivity(4322): packageName: com.android.documentsui
03-29 10:24:45.921: I/MainActivity(4322): ===================================
03-29 10:24:45.921: I/MainActivity(4322): packageName: com.android.sharedstoragebackup
03-29 10:24:45.921: I/MainActivity(4322): ===================================
03-29 10:24:45.921: I/MainActivity(4322): packageName: com.android.camera2
03-29 10:24:45.921: I/MainActivity(4322): ===================================
03-29 10:24:45.921: I/MainActivity(4322): packageName: com.android.dialogs
03-29 10:24:45.921: I/MainActivity(4322): ===================================
03-29 10:24:45.921: I/MainActivity(4322): packageName: com.android.mms
03-29 10:24:45.921: I/MainActivity(4322): ===================================
03-29 10:24:45.921: I/MainActivity(4322): packageName: com.android.provision
03-29 10:24:45.921: I/MainActivity(4322): ===================================
03-29 10:24:45.921: I/MainActivity(4322): packageName: com.android.providers.media
03-29 10:24:45.921: I/MainActivity(4322): ===================================
03-29 10:24:45.921: I/MainActivity(4322): packageName: com.google.android.marvin.talkback
03-29 10:24:45.921: I/MainActivity(4322): ===================================
03-29 10:24:45.931: I/MainActivity(4322): packageName: com.android.certinstaller
03-29 10:24:45.931: I/MainActivity(4322): ===================================
03-29 10:24:45.931: I/MainActivity(4322): packageName: com.sprd.security.manager.asa
03-29 10:24:45.931: I/MainActivity(4322): ===================================
03-29 10:24:45.931: I/MainActivity(4322): packageName: com.infinit.wostore.ui
03-29 10:24:45.931: I/MainActivity(4322): ===================================
03-29 10:24:45.931: I/MainActivity(4322): packageName: com.android.dreams.phototable
03-29 10:24:45.931: I/MainActivity(4322): ===================================
03-29 10:24:45.931: I/MainActivity(4322): packageName: com.cucc.homepage
03-29 10:24:45.931: I/MainActivity(4322): ===================================
03-29 10:24:45.931: I/MainActivity(4322): packageName: com.android.settings
03-29 10:24:45.931: I/MainActivity(4322): ===================================
03-29 10:24:45.931: I/MainActivity(4322): packageName: com.sinovatech.unicom.ui
03-29 10:24:45.931: I/MainActivity(4322): ===================================
03-29 10:24:45.931: I/MainActivity(4322): packageName: com.spreadtrum.accessibilityservice
03-29 10:24:45.931: I/MainActivity(4322): ===================================
03-29 10:24:45.931: I/MainActivity(4322): packageName: com.sina.weibopro
03-29 10:24:45.931: I/MainActivity(4322): ===================================
03-29 10:24:45.931: I/MainActivity(4322): packageName: com.android.providers.drm
03-29 10:24:45.931: I/MainActivity(4322): ===================================
03-29 10:24:45.931: I/MainActivity(4322): packageName: com.android.gallery3d
03-29 10:24:45.931: I/MainActivity(4322): ===================================
03-29 10:24:45.931: I/MainActivity(4322): packageName: com.android.musicvis
03-29 10:24:45.931: I/MainActivity(4322): ===================================
03-29 10:24:45.931: I/MainActivity(4322): packageName: com.android.exchange
03-29 10:24:45.931: I/MainActivity(4322): ===================================
03-29 10:24:45.931: I/MainActivity(4322): packageName: com.android.wallpaper.livepicker
03-29 10:24:45.931: I/MainActivity(4322): ===================================
03-29 10:24:45.931: I/MainActivity(4322): packageName: com.android.resource.security
03-29 10:24:45.931: I/MainActivity(4322): ===================================
03-29 10:24:45.931: I/MainActivity(4322): packageName: com.android.packageinstaller
03-29 10:24:45.931: I/MainActivity(4322): ===================================
03-29 10:24:45.941: I/MainActivity(4322): packageName: com.android.providers.telephony
03-29 10:24:45.941: I/MainActivity(4322): ===================================
03-29 10:24:45.941: I/MainActivity(4322): packageName: com.sprd.videoswallpapers
03-29 10:24:45.941: I/MainActivity(4322): ===================================
03-29 10:24:45.941: I/MainActivity(4322): packageName: com.sprd.fileexplorer
03-29 10:24:45.941: I/MainActivity(4322): ===================================
03-29 10:24:45.941: I/MainActivity(4322): packageName: com.svox.pico
03-29 10:24:45.941: I/MainActivity(4322): ===================================
03-29 10:24:45.941: I/MainActivity(4322): packageName: com.android.noisefield
03-29 10:24:45.941: I/MainActivity(4322): ===================================
03-29 10:24:45.941: I/MainActivity(4322): packageName: com.android.email
03-29 10:24:45.941: I/MainActivity(4322): ===================================
03-29 10:24:45.941: I/MainActivity(4322): packageName: com.android.dialer
03-29 10:24:45.941: I/MainActivity(4322): ===================================
03-29 10:24:45.941: I/MainActivity(4322): packageName: com.android.modemassert
03-29 10:24:45.941: I/MainActivity(4322): ===================================
03-29 10:24:45.941: I/MainActivity(4322): packageName: com.sprd.audioprofile
03-29 10:24:45.941: I/MainActivity(4322): ===================================
03-29 10:24:45.941: I/MainActivity(4322): packageName: com.android.location.fused
03-29 10:24:45.941: I/MainActivity(4322): ===================================
03-29 10:24:45.941: I/MainActivity(4322): packageName: com.baidu.BaiduMap
03-29 10:24:45.941: I/MainActivity(4322): ===================================
03-29 10:24:45.941: I/MainActivity(4322): packageName: com.android.wallpapercropper
03-29 10:24:45.941: I/MainActivity(4322): ===================================
03-29 10:24:45.941: I/MainActivity(4322): packageName: com.android.backupconfirm
03-29 10:24:45.941: I/MainActivity(4322): ===================================
03-29 10:24:45.941: I/MainActivity(4322): packageName: com.android.providers.settings
03-29 10:24:45.941: I/MainActivity(4322): ===================================
03-29 10:24:45.941: I/MainActivity(4322): packageName: com.android.magicsmoke
03-29 10:24:45.941: I/MainActivity(4322): ===================================
03-29 10:24:45.941: I/MainActivity(4322): packageName: com.android.providers.downloads
03-29 10:24:45.941: I/MainActivity(4322): ===================================
03-29 10:24:45.941: I/MainActivity(4322): packageName: com.sprd.validationtools
03-29 10:24:45.941: I/MainActivity(4322): ===================================
03-29 10:24:45.951: I/MainActivity(4322): packageName: com.android.musicfx
03-29 10:24:45.951: I/MainActivity(4322): ===================================
03-29 10:24:45.951: I/MainActivity(4322): packageName: com.android.phasebeam
03-29 10:24:45.951: I/MainActivity(4322): ===================================
03-29 10:24:45.951: I/MainActivity(4322): packageName: com.android.soundrecorder
03-29 10:24:45.951: I/MainActivity(4322): ===================================
03-29 10:24:45.951: I/MainActivity(4322): packageName: com.ibm.packagemanager
03-29 10:24:45.951: I/MainActivity(4322): ===================================
03-29 10:24:45.951: I/MainActivity(4322): packageName: com.neusoft.td.android.wo116114
03-29 10:24:45.951: I/MainActivity(4322): ===================================
03-29 10:24:45.951: I/MainActivity(4322): packageName: com.android.inputmethod.latin
03-29 10:24:45.951: I/MainActivity(4322): ===================================
03-29 10:24:45.951: I/MainActivity(4322): packageName: com.android.proxyhandler
03-29 10:24:45.951: I/MainActivity(4322): ===================================
03-29 10:24:45.951: I/MainActivity(4322): packageName: com.sohu.inputmethod.sogou
03-29 10:24:45.951: I/MainActivity(4322): ===================================
03-29 10:24:45.951: I/MainActivity(4322): packageName: com.android.inputdevices
03-29 10:24:45.951: I/MainActivity(4322): ===================================
03-29 10:24:45.951: I/MainActivity(4322): packageName: com.android.wallpaper.holospiral
03-29 10:24:45.951: I/MainActivity(4322): ===================================
03-29 10:24:45.951: I/MainActivity(4322): packageName: com.baidu.appsearch
03-29 10:24:45.951: I/MainActivity(4322): ===================================
03-29 10:24:45.951: I/MainActivity(4322): packageName: com.android.stk
03-29 10:24:45.951: I/MainActivity(4322): ===================================
03-29 10:24:45.951: I/MainActivity(4322): packageName: com.android.providers.userdictionary
03-29 10:24:45.951: I/MainActivity(4322): ===================================
03-29 10:24:45.951: I/MainActivity(4322): packageName: com.android.inputmethod.pinyin
03-29 10:24:45.951: I/MainActivity(4322): ===================================
03-29 10:24:45.951: I/MainActivity(4322): packageName: com.android.pacprocessor
03-29 10:24:45.951: I/MainActivity(4322): ===================================
03-29 10:24:45.961: I/MainActivity(4322): packageName: com.thunderst.radio
03-29 10:24:45.961: I/MainActivity(4322): ===================================
03-29 10:24:45.961: I/MainActivity(4322): packageName: com.android.galaxy4
03-29 10:24:45.961: I/MainActivity(4322): ===================================
03-29 10:24:45.961: I/MainActivity(4322): packageName: com.ibm.activitymanager
03-29 10:24:45.961: I/MainActivity(4322): ===================================
03-29 10:24:45.961: I/MainActivity(4322): packageName: com.spreadst.s2lockscreen
03-29 10:24:45.961: I/MainActivity(4322): ===================================
03-29 10:24:45.961: I/MainActivity(4322): packageName: com.android.printspooler
03-29 10:24:45.961: I/MainActivity(4322): ===================================
03-29 10:24:45.961: I/MainActivity(4322): packageName: android
03-29 10:24:45.961: I/MainActivity(4322): ===================================
03-29 10:24:45.961: I/MainActivity(4322): packageName: com.android.providers.contacts
03-29 10:24:45.961: I/MainActivity(4322): ===================================
03-29 10:24:45.961: I/MainActivity(4322): packageName: com.sprd.ramoptimizer
03-29 10:24:45.961: I/MainActivity(4322): ===================================
03-29 10:24:45.961: I/MainActivity(4322): packageName: com.asiainfo.android
03-29 10:24:45.961: I/MainActivity(4322): ===================================
03-29 10:24:45.961: I/MainActivity(4322): packageName: com.android.externalstorage
03-29 10:24:45.961: I/MainActivity(4322): ===================================
03-29 10:24:45.961: I/MainActivity(4322): packageName: com.android.providers.applications
03-29 10:24:45.961: I/MainActivity(4322): ===================================
03-29 10:24:45.961: I/MainActivity(4322): packageName: com.mobiletools.systemhelper
03-29 10:24:45.961: I/MainActivity(4322): ===================================
03-29 10:24:45.961: I/MainActivity(4322): packageName: com.spreadst.thememanager
03-29 10:24:45.961: I/MainActivity(4322): ===================================
03-29 10:24:45.961: I/MainActivity(4322): packageName: com.android.dreams.basic
03-29 10:24:45.961: I/MainActivity(4322): ===================================
03-29 10:24:45.961: I/MainActivity(4322): packageName: com.android.systemui
03-29 10:24:45.961: I/MainActivity(4322): ===================================
03-29 10:24:45.961: I/MainActivity(4322): packageName: com.android.keychain
03-29 10:24:45.961: I/MainActivity(4322): ===================================
03-29 10:24:45.961: I/MainActivity(4322): packageName: com.spreadst.security.permission
03-29 10:24:45.961: I/MainActivity(4322): ===================================
03-29 10:24:45.991: I/MainActivity(4322): packageName: com.cucc.ireader
03-29 10:24:45.991: I/MainActivity(4322): ===================================
03-29 10:24:45.991: I/MainActivity(4322): packageName: com.sprd.practicaltools
03-29 10:24:45.991: I/MainActivity(4322): ===================================
03-29 10:24:45.991: I/MainActivity(4322): packageName: com.spreadst.lockscreen
03-29 10:24:45.991: I/MainActivity(4322): ===================================
03-29 10:24:45.991: I/MainActivity(4322): packageName: com.android.wallpaper
03-29 10:24:45.991: I/MainActivity(4322): ===================================
03-29 10:24:45.991: I/MainActivity(4322): packageName: com.android.deskclock
03-29 10:24:45.991: I/MainActivity(4322): ===================================
03-29 10:24:45.991: I/MainActivity(4322): packageName: com.android.keyguard
03-29 10:24:45.991: I/MainActivity(4322): ===================================
03-29 10:24:45.991: I/MainActivity(4322): packageName: com.android.shell
03-29 10:24:45.991: I/MainActivity(4322): ===================================
03-29 10:24:45.991: I/MainActivity(4322): packageName: com.android.stk1
03-29 10:24:45.991: I/MainActivity(4322): ===================================



对比一下没有区别,说明不存在没被安装的apk。

 

 Group Id

 

flags=256.

 

getInstalledPackages(256);

 

Log输出:

 

03-29 10:48:02.041: I/MainActivity(4954): gids:0=1028
03-29 10:48:02.041: I/MainActivity(4954): gids:1=1015
03-29 10:48:02.041: I/MainActivity(4954): gids:2=1023
03-29 10:48:02.041: I/MainActivity(4954): gids:3=1051
03-29 10:48:02.041: I/MainActivity(4954): gids:4=1052
03-29 10:48:02.041: I/MainActivity(4954): gids:5=3002
03-29 10:48:02.041: I/MainActivity(4954): gids:6=3001
03-29 10:48:02.041: I/MainActivity(4954): gids:7=3003
03-29 10:48:02.041: I/MainActivity(4954): versionCode: 19
03-29 10:48:02.041: I/MainActivity(4954): versionName: 4.4.2-W14.12.2-02
03-29 10:48:02.041: I/MainActivity(4954): ===================================

 


只获得了gids、versionCode、versionName的信息。

 

 总结

 

获取PackageInfo信息的方法,参入的参数不同,得到的PackageInfo所包含的信息也就不同。好了,PackageManager的学习就到这了,里面还有很多内容如果以后有时间,慢慢学习。

 

你可能感兴趣的:(语言学习[Android])