| Index: sky/services/intents/src/org/domokit/intents/ActivityManagerImpl.java
|
| diff --git a/sky/services/intents/src/org/domokit/intents/ActivityManagerImpl.java b/sky/services/intents/src/org/domokit/intents/ActivityManagerImpl.java
|
| deleted file mode 100644
|
| index 70b4ca9e68a08c54b73c59d51c7c50254df8b828..0000000000000000000000000000000000000000
|
| --- a/sky/services/intents/src/org/domokit/intents/ActivityManagerImpl.java
|
| +++ /dev/null
|
| @@ -1,95 +0,0 @@
|
| -// Copyright 2015 The Chromium Authors. All rights reserved.
|
| -// Use of this source code is governed by a BSD-style license that can be
|
| -// found in the LICENSE file.
|
| -
|
| -package org.domokit.intents;
|
| -
|
| -import android.app.Activity;
|
| -import android.content.ActivityNotFoundException;
|
| -import android.net.Uri;
|
| -import android.util.Log;
|
| -
|
| -import org.chromium.mojo.system.MojoException;
|
| -import org.chromium.mojom.intents.ActivityManager;
|
| -import org.chromium.mojom.intents.ComponentName;
|
| -import org.chromium.mojom.intents.Intent;
|
| -import org.chromium.mojom.intents.StringExtra;
|
| -
|
| -/**
|
| - * Android implementation of ActivityManager.
|
| - */
|
| -public class ActivityManagerImpl implements ActivityManager {
|
| - private static final String TAG = "ActivityManagerImpl";
|
| - private static Activity sCurrentActivity;
|
| -
|
| - public ActivityManagerImpl() {
|
| - }
|
| -
|
| - public static void setCurrentActivity(Activity activity) {
|
| - sCurrentActivity = activity;
|
| - }
|
| -
|
| - @Override
|
| - public void close() {}
|
| -
|
| - @Override
|
| - public void onConnectionError(MojoException e) {}
|
| -
|
| - @Override
|
| - public void startActivity(Intent intent) {
|
| - if (sCurrentActivity == null) {
|
| - Log.e(TAG, "Unable to startActivity");
|
| - return;
|
| - }
|
| -
|
| - final android.content.Intent androidIntent = new android.content.Intent(
|
| - intent.action, Uri.parse(intent.url));
|
| -
|
| - if (intent.component != null) {
|
| - ComponentName component = intent.component;
|
| - android.content.ComponentName androidComponent =
|
| - new android.content.ComponentName(component.packageName, component.className);
|
| - androidIntent.setComponent(androidComponent);
|
| - }
|
| -
|
| - if (intent.stringExtras != null) {
|
| - for (StringExtra extra : intent.stringExtras) {
|
| - androidIntent.putExtra(extra.name, extra.value);
|
| - }
|
| - }
|
| -
|
| - if (intent.flags != 0) {
|
| - androidIntent.setFlags(intent.flags);
|
| - }
|
| -
|
| - try {
|
| - sCurrentActivity.startActivity(androidIntent);
|
| - } catch (ActivityNotFoundException e) {
|
| - Log.e(TAG, "Unable to startActivity", e);
|
| - }
|
| - }
|
| -
|
| - @Override
|
| - public void finishCurrentActivity() {
|
| - if (sCurrentActivity != null) {
|
| - sCurrentActivity.finish();
|
| - } else {
|
| - Log.e(TAG, "Unable to finishCurrentActivity");
|
| - }
|
| - }
|
| -
|
| - @Override
|
| - public void setTaskDescription(
|
| - org.chromium.mojom.intents.TaskDescription description) {
|
| - if (sCurrentActivity == null) {
|
| - return;
|
| - }
|
| - sCurrentActivity.setTaskDescription(
|
| - new android.app.ActivityManager.TaskDescription(
|
| - description.label,
|
| - null,
|
| - description.primaryColor
|
| - )
|
| - );
|
| - }
|
| -}
|
|
|