Change references to old loadSafeLabel method
... to prevent proliferation of the method via copy+paste. Bug: 77964730 Test: Built Change-Id: I663879dbdf94c4c5e7d1146028fd5ff7610a1e44
This commit is contained in:
@@ -27,6 +27,7 @@ import android.content.DialogInterface;
|
|||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.IntentFilter;
|
import android.content.IntentFilter;
|
||||||
import android.content.pm.ApplicationInfo;
|
import android.content.pm.ApplicationInfo;
|
||||||
|
import android.content.pm.PackageItemInfo;
|
||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
@@ -327,7 +328,10 @@ public class RequestPermissionActivity extends Activity implements
|
|||||||
try {
|
try {
|
||||||
ApplicationInfo applicationInfo = getPackageManager().getApplicationInfo(
|
ApplicationInfo applicationInfo = getPackageManager().getApplicationInfo(
|
||||||
packageName, 0);
|
packageName, 0);
|
||||||
mAppLabel = applicationInfo.loadSafeLabel(getPackageManager());
|
mAppLabel = applicationInfo.loadSafeLabel(getPackageManager(),
|
||||||
|
PackageItemInfo.DEFAULT_MAX_LABEL_SIZE_PX,
|
||||||
|
PackageItemInfo.SAFE_LABEL_FLAG_TRIM
|
||||||
|
| PackageItemInfo.SAFE_LABEL_FLAG_FIRST_LINE);
|
||||||
} catch (PackageManager.NameNotFoundException e) {
|
} catch (PackageManager.NameNotFoundException e) {
|
||||||
Log.e(TAG, "Couldn't find app with package name " + packageName);
|
Log.e(TAG, "Couldn't find app with package name " + packageName);
|
||||||
setResult(RESULT_CANCELED);
|
setResult(RESULT_CANCELED);
|
||||||
|
@@ -23,6 +23,7 @@ import android.content.DialogInterface;
|
|||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.IntentFilter;
|
import android.content.IntentFilter;
|
||||||
import android.content.pm.ApplicationInfo;
|
import android.content.pm.ApplicationInfo;
|
||||||
|
import android.content.pm.PackageItemInfo;
|
||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
import android.net.wifi.WifiManager;
|
import android.net.wifi.WifiManager;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
@@ -80,7 +81,9 @@ public class RequestToggleWiFiActivity extends AlertActivity
|
|||||||
try {
|
try {
|
||||||
ApplicationInfo applicationInfo = getPackageManager().getApplicationInfo(
|
ApplicationInfo applicationInfo = getPackageManager().getApplicationInfo(
|
||||||
packageName, 0);
|
packageName, 0);
|
||||||
mAppLabel = applicationInfo.loadSafeLabel(getPackageManager());
|
mAppLabel = applicationInfo.loadSafeLabel(getPackageManager(),
|
||||||
|
PackageItemInfo.DEFAULT_MAX_LABEL_SIZE_PX, PackageItemInfo.SAFE_LABEL_FLAG_TRIM
|
||||||
|
| PackageItemInfo.SAFE_LABEL_FLAG_FIRST_LINE);
|
||||||
} catch (PackageManager.NameNotFoundException e) {
|
} catch (PackageManager.NameNotFoundException e) {
|
||||||
Log.e(LOG_TAG, "Couldn't find app with package name " + packageName);
|
Log.e(LOG_TAG, "Couldn't find app with package name " + packageName);
|
||||||
finish();
|
finish();
|
||||||
|
Reference in New Issue
Block a user