Com Android Defcontainer | [Lập Trình Android] Tìm Hiểu Broadcast + Receiver – Ứng Dụng Chat – Lập Trình Android 인기 답변 업데이트

당신은 주제를 찾고 있습니까 “com android defcontainer – [Lập trình android] Tìm hiểu Broadcast + Receiver – Ứng dụng chat – Lập trình android“? 다음 카테고리의 웹사이트 https://chewathai27.com/you 에서 귀하의 모든 질문에 답변해 드립니다: https://chewathai27.com/you/blog. 바로 아래에서 답을 찾을 수 있습니다. 작성자 GokiSoft – Học Lập Trình Online 이(가) 작성한 기사에는 조회수 892회 및 좋아요 8개 개의 좋아요가 있습니다.

com android defcontainer 주제에 대한 동영상 보기

여기에서 이 주제에 대한 비디오를 시청하십시오. 주의 깊게 살펴보고 읽고 있는 내용에 대한 피드백을 제공하세요!

d여기에서 [Lập trình android] Tìm hiểu Broadcast + Receiver – Ứng dụng chat – Lập trình android – com android defcontainer 주제에 대한 세부정보를 참조하세요

[Lập trình android] Tìm hiểu Broadcast + Receiver – Ứng dụng chat – Lập trình android
[Source Code]https://github.com/tranvandiep/C1812L-Android

com android defcontainer 주제에 대한 자세한 내용은 여기를 참조하세요.

Remove Package Access Helper (Free Guide) – Jul 2021 update

andro.defcontainer package and helps Andro devices installing and uninstalling applications. While it is a legitimate built-in process …

+ 여기에 표시

Source: www.2-spyware.com

Date Published: 10/26/2021

View: 1852

Package Access Helper APK – Tải về (Android App)

Tải Package Access Helper APK 9 – Package Access Helper Mobile App cho Andro – GP: com.andro.defcontainer – OPPO APK – Phiên bản mới nhất – Miễn phí.

+ 자세한 내용은 여기를 클릭하십시오

Source: apkcombo.com

Date Published: 12/19/2022

View: 7753

DefaultContainerService.java – Google Git

package com.andro.defcontainer;. import com.andro.internal.app.IMediaContainerService; … private static final String TAG = “DefContainer”;.

+ 여기를 클릭

Source: android.googlesource.com

Date Published: 11/28/2022

View: 5892

What is the Package Access Helper?? | Android Forums & News

Package Access Helper is the common name of package com.andro.defcontainer, and is proved by the APK DefaultContainerService.apk.

+ 여기에 표시

Source: www.droidforums.net

Date Published: 8/9/2021

View: 747

Package Access Helper – APK Tools

Version, 9 ; Update, 4 years ago ; Size, 28.40 KB (29,086 bytes) ; Developer, Google LLC ; Package Name, com.andro.defcontainer.

+ 여기에 더 보기

Source: apk.tools

Date Published: 2/28/2022

View: 7609

process com.android.defcontainer

My kindle fire comes up with this all the time: The application package access helper (process com.andro.defcontainer) has stopped unexpectedly.

+ 여기에 표시

Source: www.amazonforum.com

Date Published: 4/22/2022

View: 405

주제와 관련된 이미지 com android defcontainer

주제와 관련된 더 많은 사진을 참조하십시오 [Lập trình android] Tìm hiểu Broadcast + Receiver – Ứng dụng chat – Lập trình android. 댓글에서 더 많은 관련 이미지를 보거나 필요한 경우 더 많은 관련 기사를 볼 수 있습니다.

[Lập trình android] Tìm hiểu Broadcast + Receiver - Ứng dụng chat - Lập trình android
[Lập trình android] Tìm hiểu Broadcast + Receiver – Ứng dụng chat – Lập trình android

주제에 대한 기사 평가 com android defcontainer

  • Author: GokiSoft – Học Lập Trình Online
  • Views: 조회수 892회
  • Likes: 좋아요 8개
  • Date Published: 2020. 12. 9.
  • Video Url link: https://www.youtube.com/watch?v=t5tgiMuKxsw

Remove Package Access Helper (Free Guide)

More information about Intego and Uninstall Instructions . Please review Intego EULA and Privacy Policy . Intego scanner and manual repair option is free. An advanced version must be purchased.

More information about Reimаge and Uninstall Instructions . Please review Reimаge EULA and Privacy Policy . Reimаge scanner and manual repair option is free. An advanced version must be purchased.

Package Access Helper is a legitimate process that helps the Android operating system handle the un/installation of various software packages. If you noticed that this service is eating too much battery and your phone is dying because of it, you should make sure that it is not malware that is disguising as Package Helper. For that, scan your device with reputable anti-malware software

What is Package Access Helper?

Package Access Helper is a built-in Android process that sometimes drains way too much power from the phone

This app is a part of a built-in Android package that allows the OS to install and uninstall new apps.

Package Access Helper (PAH) is a service that belongs to com.android.defcontainer package and helps Android devices installing and uninstalling applications. While it is a legitimate built-in process designed for specific purposes, many users complained that the Package Helper is continually draining battery life and uses a lot of device resources.

Therefore, many users suspect that this process can be a version of the Android virus[1] due to the unknown appearance and because it is draining a lot of the battery – around 35%.[2], or even more. However, specialists assume that this activity is triggered by the incorrectly installed application or its update. Users should not remove Package Access Helper, unless the process is related to malware (which is unlikely).

Name Package Access Helper Type Android service Developer Google Related package com.android.defcontainer Related APK APK DefaultContainerService.apk Encountered issues Users comaplained that process drains way too much battery and also sometimes causes errors like “Unfortunately, Package Access Helper has stopped” Remedy To address the battery draining issue, you should update all your applications via Google Play and make sure you are running the latest system software on your Android. Additionally, cleaning catches of all applications might help as well Additional solutions In some cases, high battery drain might indicate malware infection – scan your Android with anti-malware software. You can also run Reimage Intego Special Offer Remove it now Remove it now Uninstall, We offer Reimage to detect damaged files. Fix them with either free manual repair or purchase the full version.More information about Reimage Terms and Privacy Uninstall, We offer Intego to detect damaged files. Fix them with either free manual repair or purchase the full version.More information about Intego Terms and Privacy

When the install/uninstall process is not finished completely, the process keeps running. In some cases, users can remove Package Access Helper problem by reinstalling the update or app. Additionally, installing all available updates from Google Play Store might help too.

Additionally, Android users report receiving the error soon after upgrading operating systems or applications. It is reported that the error occurred when using Spotify, Wiko Ufeel Prime, and Amazon apps. However, the same issue might occur with other applications too.

Due to the “Unfortunately, package access helper has stopped” error, applications cannot be opened or installed. Additionally, they can crash or trigger device reboot. There’s no doubt that these activities are not normal and have to be fixed.

Despite numerous complaints about Android or Google forums, there’s still unclear why this issue occurs and how to get rid of it properly. However, in some cases, it might be related to the infiltration of mobile malware. Usually, it’s a system-related problem. Thus, users are advised to perform the Factory reset or flash the factory image.[3]

However, if this error message or high battery usage is followed by an increased amount of ads, redirects to suspicious websites or strange security pop-ups, your smartphone or tablet is most likely to be infected with Android malware. In this case, you should scan the system with the mobile anti-malware to perform automatic Package Helper virus removal.

The process often uses a lot of Android phone resources and drains the battery, which might prevent users from using the smartphone normally.

The application appears after incorrect app installation or updates

As we have already mentioned, the Package Access Helper shows up as soon as some problems with an update, upgrade or install processes occur. Users report that they noticed diminished battery life and spotted this app after upgrading to Android Lolipop. Others tell that the issue emerged after upgrading other apps.

However, a mobile security team from virusi.hr[4] note that in some cases the legit name of the Android process might be used by cybercriminals. Malicious apps can be downloaded even from the legit Google Play store too. However, in most cases, mobile malware sneaks into the system after installing applications from third-party stores.

Therefore, Android users are reminded to avoid unauthorized app stores and always check the information about developers and read user reviews even though you are downloading apps from Google Play Store.

Remove Package Helper virus from your Android device

It’s impossible to remove the intruder. You cannot delete or uninstall it as an ordinary Android app. It’s a part of the system package. Therefore, in order to fix the problem and save your battery from damage, you have to try one of these methods:

restart the device;

install all available updates from Google Play Store;

reinstall the program that triggered the “Unfortunately, package access helper has stopped” error;

uninstall/reinstall app updates;

downgrade/upgrade Android OS;

clear cache partition;

format and remove SD card;

factory reset;

flash the factory image (Warning: if your device is under warranty, you should bring it to the warranty service. It’s not only a complicated task, but it also voids the warranty due to the necessity to unlock device’s bootloader).

Android users can often find the suspicious process running on their Android phones, and usually it does not cause any issues. However, some users said the process is draining way too much battery or crashes.

For a more detailed guide on how to fix “Unfortunately, Package Access Helper has stopped” error, visit this article.

However, if you suspect that you are dealing with a mobile virus, you should opt for the automatic Package Access Helper removal. It requires scanning your Android device with professional and up-to-date mobile anti-malware.

packages/DefaultContainerService/src/com/android/defcontainer/DefaultContainerService.java

/*

* Copyright (C) 2010 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 . defcontainer ;

import com . android . internal . app . IMediaContainerService ;

import com . android . internal . content . NativeLibraryHelper ;

import com . android . internal . content . PackageHelper ;

import android . app . IntentService ;

import android . content . Intent ;

import android . content . pm . IPackageManager ;

import android . content . pm . PackageInfo ;

import android . content . pm . PackageInfoLite ;

import android . content . pm . PackageManager ;

import android . content . pm . PackageParser ;

import android . content . res . ObbInfo ;

import android . content . res . ObbScanner ;

import android . net . Uri ;

import android . os . Environment ;

import android . os . FileUtils ;

import android . os . IBinder ;

import android . os . ParcelFileDescriptor ;

import android . os . Process ;

import android . os . RemoteException ;

import android . os . ServiceManager ;

import android . os . StatFs ;

import android . provider . Settings ;

import android . util . DisplayMetrics ;

import android . util . Slog ;

import java . io . BufferedInputStream ;

import java . io . File ;

import java . io . FileInputStream ;

import java . io . FileNotFoundException ;

import java . io . IOException ;

import java . io . InputStream ;

import java . io . OutputStream ;

/*

* This service copies a downloaded apk to a file passed in as

* a ParcelFileDescriptor or to a newly created container specified

* by parameters. The DownloadManager gives access to this process

* based on its uid. This process also needs the ACCESS_DOWNLOAD_MANAGER

* permission to access apks downloaded via the download manager.

*/

public class DefaultContainerService extends IntentService {

private static final String TAG = “DefContainer” ;

private static final boolean localLOGV = true ;

private static final String LIB_DIR_NAME = “lib” ;

private IMediaContainerService . Stub mBinder = new IMediaContainerService . Stub () {

/*

* Creates a new container and copies resource there.

* @param paackageURI the uri of resource to be copied. Can be either

* a content uri or a file uri

* @param cid the id of the secure container that should

* be used for creating a secure container into which the resource

* will be copied.

* @param key Refers to key used for encrypting the secure container

* @param resFileName Name of the target resource file(relative to newly

* created secure container)

* @return Returns the new cache path where the resource has been copied into

*

*/

public String copyResourceToContainer ( final Uri packageURI ,

final String cid ,

final String key , final String resFileName ) {

if ( packageURI == null || cid == null ) {

return null ;

}

return copyResourceInner ( packageURI , cid , key , resFileName );

}

/*

* Copy specified resource to output stream

* @param packageURI the uri of resource to be copied. Should be a file

* uri

* @param outStream Remote file descriptor to be used for copying

* @return returns status code according to those in {@link

* PackageManager}

*/

public int copyResource ( final Uri packageURI , ParcelFileDescriptor outStream ) {

if ( packageURI == null || outStream == null ) {

return PackageManager . INSTALL_FAILED_INVALID_URI ;

}

ParcelFileDescriptor . AutoCloseOutputStream autoOut

= new ParcelFileDescriptor . AutoCloseOutputStream ( outStream );

try {

copyFile ( packageURI , autoOut );

return PackageManager . INSTALL_SUCCEEDED ;

} catch ( FileNotFoundException e ) {

Slog . e ( TAG , “Could not copy URI ” + packageURI . toString () + ” FNF: ”

+ e . getMessage ());

return PackageManager . INSTALL_FAILED_INVALID_URI ;

} catch ( IOException e ) {

Slog . e ( TAG , “Could not copy URI ” + packageURI . toString () + ” IO: ”

+ e . getMessage ());

return PackageManager . INSTALL_FAILED_INSUFFICIENT_STORAGE ;

}

}

/*

* Determine the recommended install location for package

* specified by file uri location.

* @param fileUri the uri of resource to be copied. Should be a

* file uri

* @return Returns PackageInfoLite object containing

* the package info and recommended app location.

*/

public PackageInfoLite getMinimalPackageInfo ( final Uri fileUri , int flags , long threshold ) {

PackageInfoLite ret = new PackageInfoLite ();

if ( fileUri == null ) {

Slog . i ( TAG , “Invalid package uri ” + fileUri );

ret . recommendedInstallLocation = PackageHelper . RECOMMEND_FAILED_INVALID_APK ;

return ret ;

}

String scheme = fileUri . getScheme ();

if ( scheme != null && ! scheme . equals ( “file” )) {

Slog . w ( TAG , “Falling back to installing on internal storage only” );

ret . recommendedInstallLocation = PackageHelper . RECOMMEND_INSTALL_INTERNAL ;

return ret ;

}

String archiveFilePath = fileUri . getPath ();

DisplayMetrics metrics = new DisplayMetrics ();

metrics . setToDefaults ();

PackageParser . PackageLite pkg = PackageParser . parsePackageLite ( archiveFilePath , 0 );

if ( pkg == null ) {

Slog . w ( TAG , “Failed to parse package” );

final File apkFile = new File ( archiveFilePath );

if (! apkFile . exists ()) {

ret . recommendedInstallLocation = PackageHelper . RECOMMEND_FAILED_INVALID_URI ;

} else {

ret . recommendedInstallLocation = PackageHelper . RECOMMEND_FAILED_INVALID_APK ;

}

return ret ;

}

ret . packageName = pkg . packageName ;

ret . installLocation = pkg . installLocation ;

ret . verifiers = pkg . verifiers ;

ret . recommendedInstallLocation = recommendAppInstallLocation ( pkg . installLocation ,

archiveFilePath , flags , threshold );

return ret ;

}

@Override

public boolean checkInternalFreeStorage ( Uri packageUri , long threshold )

throws RemoteException {

final File apkFile = new File ( packageUri . getPath ());

try {

return isUnderInternalThreshold ( apkFile , threshold );

} catch ( FileNotFoundException e ) {

return true ;

}

}

@Override

public boolean checkExternalFreeStorage ( Uri packageUri ) throws RemoteException {

final File apkFile = new File ( packageUri . getPath ());

try {

return isUnderExternalThreshold ( apkFile );

} catch ( FileNotFoundException e ) {

return true ;

}

}

public ObbInfo getObbInfo ( String filename ) {

try {

return ObbScanner . getObbInfo ( filename );

} catch ( IOException e ) {

Slog . d ( TAG , “Couldn’t get OBB info for ” + filename );

return null ;

}

}

@Override

public long calculateDirectorySize ( String path ) throws RemoteException {

final File directory = new File ( path );

if ( directory . exists () && directory . isDirectory ()) {

return MeasurementUtils . measureDirectory ( path );

} else {

return 0L ;

}

}

};

public DefaultContainerService () {

super ( “DefaultContainerService” );

setIntentRedelivery ( true );

}

@Override

protected void onHandleIntent ( Intent intent ) {

if ( PackageManager . ACTION_CLEAN_EXTERNAL_STORAGE . equals ( intent . getAction ())) {

IPackageManager pm = IPackageManager . Stub . asInterface (

ServiceManager . getService ( “package” ));

String pkg = null ;

try {

while (( pkg = pm . nextPackageToClean ( pkg )) != null ) {

eraseFiles ( Environment . getExternalStorageAppDataDirectory ( pkg ));

eraseFiles ( Environment . getExternalStorageAppMediaDirectory ( pkg ));

eraseFiles ( Environment . getExternalStorageAppObbDirectory ( pkg ));

}

} catch ( RemoteException e ) {

}

}

}

void eraseFiles ( File path ) {

if ( path . isDirectory ()) {

String [] files = path . list ();

if ( files != null ) {

for ( String file : files ) {

eraseFiles ( new File ( path , file ));

}

}

}

path . delete ();

}

public IBinder onBind ( Intent intent ) {

return mBinder ;

}

private String copyResourceInner ( Uri packageURI , String newCid , String key , String resFileName ) {

// Make sure the sdcard is mounted.

String status = Environment . getExternalStorageState ();

if (! status . equals ( Environment . MEDIA_MOUNTED )) {

Slog . w ( TAG , “Make sure sdcard is mounted.” );

return null ;

}

// The .apk file

String codePath = packageURI . getPath ();

File codeFile = new File ( codePath );

// Calculate size of container needed to hold base APK.

int sizeMb ;

try {

sizeMb = calculateContainerSize ( codeFile );

} catch ( FileNotFoundException e ) {

Slog . w ( TAG , “File does not exist when trying to copy ” + codeFile . getPath ());

return null ;

}

// Create new container

final String newCachePath ;

if (( newCachePath = PackageHelper . createSdDir ( sizeMb , newCid , key , Process . myUid ())) == null ) {

Slog . e ( TAG , “Failed to create container ” + newCid );

return null ;

}

if ( localLOGV ) {

Slog . i ( TAG , “Created container for ” + newCid + ” at path : ” + newCachePath );

}

final File resFile = new File ( newCachePath , resFileName );

if ( FileUtils . copyFile ( new File ( codePath ), resFile )) {

if ( localLOGV ) {

Slog . i ( TAG , “Copied ” + codePath + ” to ” + resFile );

}

} else {

Slog . e ( TAG , “Failed to copy ” + codePath + ” to ” + resFile );

// Clean up container

PackageHelper . destroySdDir ( newCid );

return null ;

}

final File sharedLibraryDir = new File ( newCachePath , LIB_DIR_NAME );

if ( sharedLibraryDir . mkdir ()) {

int ret = NativeLibraryHelper . copyNativeBinariesIfNeededLI ( codeFile , sharedLibraryDir );

if ( ret != PackageManager . INSTALL_SUCCEEDED ) {

Slog . e ( TAG , “Could not copy native libraries to ” + sharedLibraryDir . getPath ());

PackageHelper . destroySdDir ( newCid );

return null ;

}

} else {

Slog . e ( TAG , “Could not create native lib directory: ” + sharedLibraryDir . getPath ());

PackageHelper . destroySdDir ( newCid );

return null ;

}

if (! PackageHelper . finalizeSdDir ( newCid )) {

Slog . e ( TAG , “Failed to finalize ” + newCid + ” at path ” + newCachePath );

// Clean up container

PackageHelper . destroySdDir ( newCid );

return null ;

}

if ( localLOGV ) {

Slog . i ( TAG , “Finalized container ” + newCid );

}

if ( PackageHelper . isContainerMounted ( newCid )) {

if ( localLOGV ) {

Slog . i ( TAG , “Unmounting ” + newCid + ” at path ” + newCachePath );

}

// Force a gc to avoid being killed.

Runtime . getRuntime (). gc ();

PackageHelper . unMountSdDir ( newCid );

} else {

if ( localLOGV ) {

Slog . i ( TAG , “Container ” + newCid + ” not mounted” );

}

}

return newCachePath ;

}

private static void copyToFile ( InputStream inputStream , OutputStream out ) throws IOException {

byte [] buffer = new byte [ 16384 ];

int bytesRead ;

while (( bytesRead = inputStream . read ( buffer )) >= 0 ) {

out . write ( buffer , 0 , bytesRead );

}

}

private static void copyToFile ( File srcFile , OutputStream out )

throws FileNotFoundException , IOException {

InputStream inputStream = new BufferedInputStream ( new FileInputStream ( srcFile ));

try {

copyToFile ( inputStream , out );

} finally {

try { inputStream . close (); } catch ( IOException e ) {}

}

}

private void copyFile ( Uri pPackageURI , OutputStream outStream ) throws FileNotFoundException ,

IOException {

String scheme = pPackageURI . getScheme ();

if ( scheme == null || scheme . equals ( “file” )) {

final File srcPackageFile = new File ( pPackageURI . getPath ());

// We copy the source package file to a temp file and then rename it to the

// destination file in order to eliminate a window where the package directory

// scanner notices the new package file but it’s not completely copied yet.

copyToFile ( srcPackageFile , outStream );

} else if ( scheme . equals ( “content” )) {

ParcelFileDescriptor fd = null ;

try {

fd = getContentResolver (). openFileDescriptor ( pPackageURI , “r” );

} catch ( FileNotFoundException e ) {

Slog . e ( TAG , “Couldn’t open file descriptor from download service. ”

+ “Failed with exception ” + e );

throw e ;

}

if ( fd == null ) {

Slog . e ( TAG , “Provider returned no file descriptor for ” + pPackageURI . toString ());

throw new FileNotFoundException ( “provider returned no file descriptor” );

} else {

if ( localLOGV ) {

Slog . i ( TAG , “Opened file descriptor from download service.” );

}

ParcelFileDescriptor . AutoCloseInputStream dlStream

= new ParcelFileDescriptor . AutoCloseInputStream ( fd );

// We copy the source package file to a temp file and then rename it to the

// destination file in order to eliminate a window where the package directory

// scanner notices the new package file but it’s not completely

// copied

copyToFile ( dlStream , outStream );

}

} else {

Slog . e ( TAG , “Package URI is not ‘file:’ or ‘content:’ – ” + pPackageURI );

throw new FileNotFoundException ( “Package URI is not ‘file:’ or ‘content:'” );

}

}

private static final int PREFER_INTERNAL = 1 ;

private static final int PREFER_EXTERNAL = 2 ;

private int recommendAppInstallLocation ( int installLocation , String archiveFilePath , int flags ,

long threshold ) {

int prefer ;

boolean checkBoth = false ;

check_inner : {

/*

* Explicit install flags should override the manifest settings.

*/

if (( flags & PackageManager . INSTALL_FORWARD_LOCK ) != 0 ) {

/*

* Forward-locked applications cannot be installed on SD card,

* so only allow checking internal storage.

*/

prefer = PREFER_INTERNAL ;

break check_inner ;

} else if (( flags & PackageManager . INSTALL_INTERNAL ) != 0 ) {

prefer = PREFER_INTERNAL ;

break check_inner ;

} else if (( flags & PackageManager . INSTALL_EXTERNAL ) != 0 ) {

prefer = PREFER_EXTERNAL ;

break check_inner ;

}

/* No install flags. Check for manifest option. */

if ( installLocation == PackageInfo . INSTALL_LOCATION_INTERNAL_ONLY ) {

prefer = PREFER_INTERNAL ;

break check_inner ;

} else if ( installLocation == PackageInfo . INSTALL_LOCATION_PREFER_EXTERNAL ) {

prefer = PREFER_EXTERNAL ;

checkBoth = true ;

break check_inner ;

} else if ( installLocation == PackageInfo . INSTALL_LOCATION_AUTO ) {

// We default to preferring internal storage.

prefer = PREFER_INTERNAL ;

checkBoth = true ;

break check_inner ;

}

// Pick user preference

int installPreference = Settings . System . getInt ( getApplicationContext ()

. getContentResolver (),

Settings . Secure . DEFAULT_INSTALL_LOCATION ,

PackageHelper . APP_INSTALL_AUTO );

if ( installPreference == PackageHelper . APP_INSTALL_INTERNAL ) {

prefer = PREFER_INTERNAL ;

break check_inner ;

} else if ( installPreference == PackageHelper . APP_INSTALL_EXTERNAL ) {

prefer = PREFER_EXTERNAL ;

break check_inner ;

}

/*

* Fall back to default policy of internal-only if nothing else is

* specified.

*/

prefer = PREFER_INTERNAL ;

}

final boolean emulated = Environment . isExternalStorageEmulated ();

final File apkFile = new File ( archiveFilePath );

boolean fitsOnInternal = false ;

if ( checkBoth || prefer == PREFER_INTERNAL ) {

try {

fitsOnInternal = isUnderInternalThreshold ( apkFile , threshold );

} catch ( FileNotFoundException e ) {

return PackageHelper . RECOMMEND_FAILED_INVALID_URI ;

}

}

boolean fitsOnSd = false ;

if (! emulated && ( checkBoth || prefer == PREFER_EXTERNAL )) {

try {

fitsOnSd = isUnderExternalThreshold ( apkFile );

} catch ( FileNotFoundException e ) {

return PackageHelper . RECOMMEND_FAILED_INVALID_URI ;

}

}

if ( prefer == PREFER_INTERNAL ) {

if ( fitsOnInternal ) {

return PackageHelper . RECOMMEND_INSTALL_INTERNAL ;

}

} else if (! emulated && prefer == PREFER_EXTERNAL ) {

if ( fitsOnSd ) {

return PackageHelper . RECOMMEND_INSTALL_EXTERNAL ;

}

}

if ( checkBoth ) {

if ( fitsOnInternal ) {

return PackageHelper . RECOMMEND_INSTALL_INTERNAL ;

} else if (! emulated && fitsOnSd ) {

return PackageHelper . RECOMMEND_INSTALL_EXTERNAL ;

}

}

/*

* If they requested to be on the external media by default, return that

* the media was unavailable. Otherwise, indicate there was insufficient

* storage space available.

*/

if (! emulated && ( checkBoth || prefer == PREFER_EXTERNAL )

&& ! Environment . MEDIA_MOUNTED . equals ( Environment . getExternalStorageState ())) {

return PackageHelper . RECOMMEND_MEDIA_UNAVAILABLE ;

} else {

return PackageHelper . RECOMMEND_FAILED_INSUFFICIENT_STORAGE ;

}

}

/**

* Measure a file to see if it fits within the free space threshold.

*

* @param apkFile file to check

* @param threshold byte threshold to compare against

* @return true if file fits under threshold

* @throws FileNotFoundException when APK does not exist

*/

private boolean isUnderInternalThreshold ( File apkFile , long threshold )

throws FileNotFoundException {

final long size = apkFile . length ();

if ( size == 0 && ! apkFile . exists ()) {

throw new FileNotFoundException ();

}

final StatFs internalStats = new StatFs ( Environment . getDataDirectory (). getPath ());

final long availInternalSize = ( long ) internalStats . getAvailableBlocks ()

* ( long ) internalStats . getBlockSize ();

return ( availInternalSize – size ) > threshold ;

}

/**

* Measure a file to see if it fits in the external free space.

*

* @param apkFile file to check

* @return true if file fits

* @throws IOException when file does not exist

*/

private boolean isUnderExternalThreshold ( File apkFile ) throws FileNotFoundException {

if ( Environment . isExternalStorageEmulated ()) {

return false ;

}

final int sizeMb = calculateContainerSize ( apkFile );

final int availSdMb ;

if ( Environment . MEDIA_MOUNTED . equals ( Environment . getExternalStorageState ())) {

final StatFs sdStats = new StatFs ( Environment . getExternalStorageDirectory (). getPath ());

final int blocksToMb = ( 1 << 20 ) / sdStats . getBlockSize (); availSdMb = sdStats . getAvailableBlocks () * blocksToMb ; } else { availSdMb = - 1 ; } return availSdMb > sizeMb ;

}

/**

* Calculate the container size for an APK. Takes into account the

*

* @param apkFile file from which to calculate size

* @return size in megabytes (2^20 bytes)

* @throws FileNotFoundException when file does not exist

*/

private int calculateContainerSize ( File apkFile ) throws FileNotFoundException {

// Calculate size of container needed to hold base APK.

long sizeBytes = apkFile . length ();

if ( sizeBytes == 0 && ! apkFile . exists ()) {

throw new FileNotFoundException ();

}

// Check all the native files that need to be copied and add that to the

// container size.

sizeBytes += NativeLibraryHelper . sumNativeBinariesLI ( apkFile );

int sizeMb = ( int ) ( sizeBytes >> 20 );

if (( sizeBytes – ( sizeMb * 1024 * 1024 )) > 0 ) {

sizeMb ++;

}

/*

* Add buffer size because we don’t have a good way to determine the

* real FAT size. Your FAT size varies with how many directory entries

* you need, how big the whole filesystem is, and other such headaches.

*/

sizeMb ++;

return sizeMb ;

}

What is the Package Access Helper??

acejavelin said: Package Access Helper is the common name of package com.android.defcontainer, and is provided by the APK DefaultContainerService.apk. It is used in installing (and possibly uninstalling) other packages. I don’t know why it would have high battery usage unless an install did not complete correctly and left the process running. Have you tried a battery pull reset? Click to expand…

Thanks Ace! Likely you are right about an install/update gone bad as it seems to occur after I have a number of updates. It isn’t one app in particular. Seems that it sort of “fixes itself” after a few hours. Without watchdog I wouldn’t even catch it as during the day if I’m at my desk I have my phone plugged in.This and Android Media Process seem to be the biggest offenders. It’s hard to diagnose the problem as these apps support other ones that are likely the ultimate culprit. Oh well, usually it remedies itself given time. Cheers!

키워드에 대한 정보 com android defcontainer

다음은 Bing에서 com android defcontainer 주제에 대한 검색 결과입니다. 필요한 경우 더 읽을 수 있습니다.

이 기사는 인터넷의 다양한 출처에서 편집되었습니다. 이 기사가 유용했기를 바랍니다. 이 기사가 유용하다고 생각되면 공유하십시오. 매우 감사합니다!

사람들이 주제에 대해 자주 검색하는 키워드 [Lập trình android] Tìm hiểu Broadcast + Receiver – Ứng dụng chat – Lập trình android

  • 동영상
  • 공유
  • 카메라폰
  • 동영상폰
  • 무료
  • 올리기
[Lập #trình #android] #Tìm #hiểu #Broadcast #+ #Receiver #- #Ứng #dụng #chat #- #Lập #trình #android


YouTube에서 com android defcontainer 주제의 다른 동영상 보기

주제에 대한 기사를 시청해 주셔서 감사합니다 [Lập trình android] Tìm hiểu Broadcast + Receiver – Ứng dụng chat – Lập trình android | com android defcontainer, 이 기사가 유용하다고 생각되면 공유하십시오, 매우 감사합니다.

Leave a Comment