Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 24cf2d9d authored by Eugene Susla's avatar Eugene Susla Committed by android-build-merger
Browse files

[DO NOT MERGE] Improve the error msg when started not for result

am: 5423b4e0

Change-Id: I44b112065b12b10cfd00498479380a9c5ad57be4
parents c9741d13 5423b4e0
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@ import android.widget.ProgressBar;
import android.widget.TextView;

import com.android.companiondevicemanager.DeviceDiscoveryService.DeviceFilterPair;
import com.android.internal.util.Preconditions;

public class DeviceChooserActivity extends Activity {

@@ -92,8 +93,11 @@ public class DeviceChooserActivity extends Activity {
    private CharSequence getCallingAppName() {
        try {
            final PackageManager packageManager = getPackageManager();
            String callingPackage = Preconditions.checkStringNotEmpty(
                    getCallingPackage(),
                    "This activity must be called for result");
            return packageManager.getApplicationLabel(
                    packageManager.getApplicationInfo(getCallingPackage(), 0));
                    packageManager.getApplicationInfo(callingPackage, 0));
        } catch (PackageManager.NameNotFoundException e) {
            throw new RuntimeException(e);
        }